[fpc-devel] Delphi-like Packages, Plan

Dimitri Smits smitco at telenet.be
Mon Oct 4 01:23:39 CEST 2010


----- "Hans-Peter Diettrich" <DrDiettrich1 at aol.com> schreef:

> Willibald Krenn schrieb:
> 
> > Here comes my 'official' plan on how I want to implement Delphi-like
> 
> > Package Support for FPC on Win64. Feel free to comment.
> [...]
> >         -K <File>[ <File>]*
> >                         Command line arg to tell fpc to compile
> >                         program/dll with runtime package support.
> 
> I don't like the Delph all-or-nothing philosophy here. I'd prefer to 
> specify the packages, that shall be loaded at runtime, while all other
> 
> packages can be linked into the executable. This would allow to use an
> minimal set of external modules, which are shared by the exe and the 
> really self-contained packages.
> 
> The same effect could be achieved by a separation of packages into 
> (Lazarus-type) static libraries, and packages *designed* for dynamic 
> loading (plug-ins...).

Delphi compiler does this as well. One caveat in this discussion is for instance:
when you "build with runtime packages" vclXXX.bpl, db*.bpl; even though you didn't specify them, all packages your bpls depend on are loaded runtime only as well. (rtlXXX.bpl for instance)

the reason is simply: there can only be one instance loaded of EVERY unit you use in your program (or that is included in some bpl).

It is therefore simple to say in delphi that you want to build with rtlXXX.bpl only, but still have the vclXXX.dcp statically linked into your executable when you use a TForm and include the Forms unit somewhere in your code.

kind regards,
Dimitri Smits



More information about the fpc-devel mailing list