[Lazarus] One project and many versions of FPC?

Mattias Gaertner nc-gaertnma at netcologne.de
Thu Sep 17 15:22:14 CEST 2009


On Thu, 17 Sep 2009 14:39:54 +0200
Graeme Geldenhuys <graemeg at opensoft.homeip.net> wrote:

> Hi,
> 
> I came across a message posted by Martin (developer of MSEide). He
> does exactly what I need to do, but I need to do it with Lazarus IDE.
> Having one project that must be compiled with various versions of
> FPC. Simple example is a app being distributed as 32-bit and 64-bit.
> Then there is also the case of using the stable released version of
> FPC vs the unstable "trunk" or stable "fixes" versions.
> 
> Is something like this possible with Lazarus? If so, how does one go
> about setting this up? 

The weapons are 
- the fpc config fpc.cfg
- lazarus macros like $FPCVer, $TargetOS and $TargetCPU
- using lazarus command line parameter --pcp

The standard fpc.cfg is already suitable for multiple FPC versions. It
uses FPC macros. So you can install for example fpc 2.2.4, 2.2.5
and 2.5.1. You switch between them by switching the compiler
(/usr/lib/fpc/2.5.1/ppc386).

The fpc sources should correspond to the compiler. The lazarus option
for the FPC source directory allows macros, especially the macro
$FPCVer which resolves for example to 2.2.5. Put the three
sources
under /home/username/pascal/2.5.1/fpc, /home/username/pascal/2.2.4/fpc, ...
and set the source directory to /home/username/pascal/$FPCVer/fpc. 
Every time you switch the compiler, lazarus will automatically switch the source
directory.


> Also see attached images for how it looks in
> MSEide. He has various custom "macro groups" and various build modes
> (6 of them: Make, Build, Custom1-4).
> 
> Is something like this at all possible with Lazarus IDE?

Build modes are started but I can't say when I will have the time to
finish them.

 
> ------------[ Martin's setup with MSEide ]-----------------------
> I use the following script to compile RTL and packages of a FPC SVN
> checkout with debuginfo:

I recommend to use the FPC way of compiling FPC. Otherwise you can
easily run into trouble that no one can reproduce.


> [...]
> make OPT="-gl -O-" FPC=${fpcdir}/compiler/ppc386 rtl packages
>
> In .fpc.cfg there are ifdef'd sections of -Fu defines:
> "
> #IFDEF svnfixes_2_4
> -Fu/home/mse/packs/standard/svn/fp/fixes_2_4/rtl/units/$fpctarget
> -Fu/home/mse/packs/standard/svn/fp/fixes_2_4/packages/fcl-base/units/$fpctarget
> -Fu/home/mse/packs/standard/svn/fp/fixes_2_4/packages/fcl-image/units/$fpctarget
> -Fu/home/mse/packs/standard/svn/fp/fixes_2_4/packages/fcl-db/units/$fpctarget
> -Fu/home/mse/packs/standard/svn/fp/fixes_2_4/packages/pasjpeg/units/$fpctarget
> -Fu/home/mse/packs/standard/svn/fp/fixes_2_4/packages/paszlib/units/$fpctarget
> -Fu/home/mse/packs/standard/svn/fp/fixes_2_4/packages/hash/units/$fpctarget
> -Fu/home/mse/packs/standard/svn/fp/fixes_2_4/packages/libc/units/$fpctarget
> -Fu/home/mse/packs/standard/svn/fp/fixes_2_4/packages/ibase/units/$fpctarget
> -Fu/home/mse/packs/standard/svn/fp/fixes_2_4/packages/odbc/units/$fpctarget
> -Fu/home/mse/packs/standard/svn/fp/fixes_2_4/packages/postgres/units/$fpctarget
> -Fu/home/mse/packs/standard/svn/fp/fixes_2_4/packages/sqlite/units/$fpctarget
> -Fu/home/mse/packs/standard/svn/fp/fixes_2_4/packages/mysql/units/$fpctarget
> -Fu/home/mse/packs/standard/svn/fp/fixes_2_4/packages/x11/units/$fpctarget
> #ELSE
> #IFDEF svnfixes_2_2
> -Fu/home/mse/packs/standard/svn/fp/fixes_2_2/rtl/units/$fpctarget
> -Fu/home/mse/packs/standard/svn/fp/fixes_2_2/packages/fcl-base/units/$fpctarget
> -Fu/home/mse/packs/standard/svn/fp/fixes_2_2/packages/fcl-image/units/$fpctarget
> -Fu/home/mse/packs/standard/svn/fp/fixes_2_2/packages/fcl-db/units/$fpctarget
> -Fu/home/mse/packs/standard/svn/fp/fixes_2_2/packages/pasjpeg/units/$fpctarget
> -Fu/home/mse/packs/standard/svn/fp/fixes_2_2/packages/paszlib/units/$fpctarget
> -Fu/home/mse/packs/standard/svn/fp/fixes_2_2/packages/hash/units/$fpctarget
> -Fu/home/mse/packs/standard/svn/fp/fixes_2_2/packages/libc/units/$fpctarget
> -Fu/home/mse/packs/standard/svn/fp/fixes_2_2/packages/ibase/units/$fpctarget
> -Fu/home/mse/packs/standard/svn/fp/fixes_2_2/packages/odbc/units/$fpctarget
> -Fu/home/mse/packs/standard/svn/fp/fixes_2_2/packages/postgres/units/$fpctarget
> -Fu/home/mse/packs/standard/svn/fp/fixes_2_2/packages/sqlite/units/$fpctarget
> -Fu/home/mse/packs/standard/svn/fp/fixes_2_2/packages/mysql/units/$fpctarget
> -Fu/home/mse/packs/standard/svn/fp/fixes_2_2/packages/x11/units/$fpctarget
> #ELSE
> # searchpath for units and other system dependent things
> -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget
> -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/*
> #ENDIF
> #ENDIF
> #ENDIF
> "
> In 'Project'-'Options'-'Macros' there are settings for different FPC
> versions which can be switched easy, see attachments.


Mattias




More information about the Lazarus mailing list