[Lazarus] Bug 0022814: fpc executable's path should be relative if fpc is present in the env path
patspiper
patspiper at gmail.com
Thu Sep 6 20:34:42 CEST 2012
On 06/09/12 21:07, Sven Barth wrote:
> On 06.09.2012 18:11, patspiper wrote:
>>>> An FPCVER dropdown list in the IDE options could be a solution
>>>> (Changing
>>>> it must trigger the rescan FPC source directory in case it is affected
>>>> by the version change). However, will fpc be able to locate ppc386
>>>> (the
>>>> actual compiler)?
>>> Changing the the compiler in the IDE triggers a rescan of the
>>> compiler, which
>>> updates the FPCVer macro. If the path to the FPC sources contains
>>> the macro
>>> FPCVer the IDE switches to it. If this directory was not yet scanned
>>> it will be
>>> scanned now. The IDE has a cache for multiple compilers and multiple
>>> FPC source
>>> directories.
>> Great! But the only shortcoming is that:
>> - if the actual compiler is not in the path, fpc cannot call it no
>> matter what.
>
> 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).
Stephano
More information about the Lazarus
mailing list