[Lazarus] Using different FPC versions

patspiper patspiper at gmail.com
Mon Feb 10 16:07:41 CET 2014


On 10/02/14 15:44, Michael Van Canneyt wrote:
>
>
> On Mon, 10 Feb 2014, patspiper wrote:
>
>> On 10/02/14 11:33, Michael Van Canneyt wrote:
>>>
>>> Hello,
>>>
>>> A single Lazarus installation
>>> * Can work with different CPUs. * It can work with different OS-es.
>>> * It can work with different widgetsets.
>>>
>>> It caters for this by adapting the compiler unit search/output path 
>>> into $(cpu)-$(os)/$(widgetset)
>>> - and it does so by default. This is great. (the variable names used 
>>> may differ from actual names).
>>>
>>> Lazarus also can work with different compilers versions: you can 
>>> select the compiler in the options dialog.
>>
>> What exactly do you change in your setup? Compiler path + make path?
>
> Just compiler.
>
>>
>> Do you use fpc or ppc386 as compiler path? With a fully qualified 
>> path or without any path?
>
> I use a full path to ppcx64-x.y.z

My solution to this is:

- Install different fpc versions in folders differing only by the fpc 
version

- Use a script (with an fpc version variable) that includes in the 
environment PATH the bin folder (where fpc is) and the compiler folder 
(where ppcx64 is) to launch the Lazarus IDE.

- Specify fpc with no path for the IDE compiler options. The IDE will 
query fpc for the version and set the $FPCVER macro accordingly. Note: 
using ppcx64 instead will prevent you from cross-compiling.

>
> I do this, because lazarus does not - out of the box - support the 
> passing of the version to FPC as in:
>
> fpc -V2.6.4
>
> for instance, the above command will execute the correct binary: 
> ppcx64-2.6.4, as can be seen as:
>
> home: >fpc -V2.6.4 -iV
> 2.6.4
> home: >fpc -V2.7.1 -iV
> 2.7.1
>
> I guess this can also be solved with the dialog that Mattias mentions,

Overrides do not solve this particular issue.

> but I believe that this should in fact be solved at a more fundamental 
> level.
>
> Maybe the lazarus devels are not aware of this -V option. It's not 
> widely used or propagated, after all.

I look forward to being able to specify options for fpc in the compiler 
path. This allows me to change my method above as follows:

- No need for the environment path anymore

- Specify the full path of fpc, using fully qualified paths that include 
the version (ex 2.6.3). That means there is no more need to restart the 
IDE to switch versions.

- Specify the fpc option that allows fpc to locate the compiler folder 
(where ppcx64 is)

Btw, IIRC some fpc options are not even included in the fpc help (fpc -h).

Stephano




More information about the Lazarus mailing list