alternative aliases [Re: [fpc-devel] Re: [fpc-pascal] Re: Ideas for namespace implementation]
graemeg.lists at gmail.com
Tue Jul 27 14:49:33 CEST 2010
Op 2010-07-27 13:27, Martin het geskryf:
> I added several point to
[... 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.
Below is the actual fpGUI directory hierarchy. 'lib' contains the compiled
units (*.ppu) for each target platform. Inside 'src' is the various units
split between two main directories: 'corelib' for the backend API code, and
'gui' for the higher level visual UI components. 'gui' and 'corelib'
contain common code. 'gdi' and 'x11' contain backend specific code.
With Lazarus I had to create two fpgui_toolkit.lpk packages, but in
different directories - depending on which platform you are working on.
Good news is that your application simply requires 'fpgui_toolkit.lpk',
irrespective of it's location, so switching between platforms doesn't break
the application compilation.
|-----gdi *--> fpgui_toolkit.lpk
|-----x11 *--> fpgui_toolkit.lpk
Here follows the extrafpc.cfg file content I pass to fpc when I compile
fpGUI from the command line (eg: fpc -dX11 @extrafpc.cfg). You will note
that there are multiple -Fu paths and multiple -Fi paths.
-------------------[ src/extrafpc.cfg ]-------------------------
# * * * I M P O R T A N T * * *
# You need to specify which backend you are compiling for
# Your options are:
# -dX11 for X11 support (eg: Linux, FreeBSD, Arm, MacOSX)
# -dGDI for Windows GDI support (including WinCE)
# Slashes are also allowed under Windows
# search path for include files
# search path for units and other system dependent things
# Unit output path
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
The above is obviously possible with Lazarus Packages, because I can
specify multiple search paths in the *.lpk compiler configuration dialog.
- Graeme -
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
More information about the fpc-devel