[Lazarus] Bug 0022814: fpc executable's path should be relative if fpc is present in the env path

patspiper patspiper at gmail.com
Sat Sep 8 16:07:32 CEST 2012

On 06/09/12 21:38, Mattias Gaertner wrote:
> On Thu, 06 Sep 2012 21:34:42 +0300
> patspiper <patspiper at gmail.com> wrote:
>> On 06/09/12 21:07, Sven Barth wrote:
>> [...]
>>> You can pass the option "-Xp/some/path" to fpc to tell it to look for
>>> ppcXXX in that specific directory. It will look there first, then in
>>> the path of the fpc binary and then in PATH.
>> This is interesting! If we can specify in the IDE options the relative
>> path to move from the fpc binary folder (ex:
>> /home/me/Programs/fpc/$FPC_VER/lib/fpc/$FPC_VER) to the actual compiler
>> folder (ex: /home/me/Programs/fpc/$FPC_VER/bin), then the IDE can call
>> <fpc bin folder>fpc -Xp<relative path>.
>> Since all fpc installations have the same relative path, then it becomes
>> enough to specify that relative path once in the IDE options so that
>> changing the fpc binary path is enough for all purposes. By default,
>> that path is ../lib/fpc/$(FPCVER).
> Maybe you can add this to your fpc.cfg? A normal fpc.cfg already
> contains a -XP.
As per Sven's message, this cannot be done. The fpc binary must be able 
to locate the actual compiler either using the env path, or the -Xp 
switch. Two options are available:
- Specify the relative path between the 2 folders.
- Specify the actual compiler path (the IDE can even store the relative 
path instead)

Both options can make use of the FPCVER macro.
fpc binary: /home/me/Programs/fpc/2.6.1/lib/fpc/2.6.1
actual compiler: /home/me/Programs/fpc/$FPC_VER/bin


More information about the Lazarus mailing list