alternative aliases [Re: [fpc-devel] Re: [fpc-pascal] Re: Ideas for namespace implementation]

Martin fpc at mfriebe.de
Tue Jul 27 15:13:20 CEST 2010


Please see also the latest alternative with local fpc.cfg conf files to 
set up the namespaces....

On 27/07/2010 13:49, Graeme Geldenhuys wrote:
> Op 2010-07-27 13:27, Martin het geskryf:
>    
>> I added several point to
>> http://wiki.lazarus.freepascal.org/Namespaces#Mapping_Namespace_to_each_search_path
>>      
> [... maybe this is stretching your idea of "packages" a bit, but I thought
> I would ask either way...]
>
> I like your "packages" idea, it sounds similar to Lazarus Packages (*.lpk),
> but without the Lazarus IDE requirement. I currently use Lazarus Packages
> support for managing fpGUI based applications, and would like to see if
> your idea could fit in with fpGUI too (without needing Lazarus IDE
> support). The problem I see, is that your "alias/package" only seems to
> take one directory location for source code (*.pas). For fpGUI, I have a
> directory hierarchy for the fpGUI sources.
>    
....
> I can't see your idea working for compiling a fpGUI based application
> directly from source. But I can see your idea work for projects using the
> pre-compiled fpGUI units ('lib' directory with *.ppu files), because the
> latter is only one path. Whereas the sources are multiple source paths and
> multiple include paths. Am I correct?
>
> I can only use:  -Fl=FPGUI:~/programming/fpgui/lib/i386-linux
>
> but can't use -Fu or -Fi:  -Fu=FPGUI:~/programming/fpgui/src
> because the latter doesn't include all the unit and include paths required
> for fpGUI.
>
>
> The above is obviously possible with Lazarus Packages, because I can
> specify multiple search paths in the *.lpk compiler configuration dialog.
>
>    

It shouldn't depend on lpk files.

the lpk files are only for lazarus, the compiler doesn't see them. Any 
info in them is translated by lazarus for fpc.

For your case, it would simply be necessary to specify the same 
namespace for multiply -Fu => and as a result expect all of them to be 
in this namespace

-FuFPGUI:.
-FuFPGUI:corelib/
#IFDEF X11
   -FuFPGUI:corelib/x11/
#ENDIF
#IFDEF GDI
   -FuFPGUI:corelib/gdi/
#ENDIF
-FuFPGUI:gui/
-FuFPGUI:gui/db/

The only problem with this is, that it wouldn't detect any other package using this namespace =>  no reflict would be reported, but instead the namespaces be merged
-FuFPGUI:/path/to/mfr/package


alternatively (either in-Fu or in local fpc.cfg) =<  the namespace can be specified in a separate instruction, specifing that it applies recursive to subdirectories.

having all your directories in -Fu you would do
-FNFPGUI:/path/to/fpguibase/*

the asterisk specifies =>  recursive

==>  need to be added to wiki

Martin









More information about the fpc-devel mailing list