[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 18:11:28 CEST 2012

On 06/09/12 15:26, Mattias Gaertner wrote:
> patspiper <patspiper at gmail.com> hat am 6. September 2012 um 13:58 geschrieben:
>> http://bugs.freepascal.org/view.php?id=22814
>> To launch the IDE, I use a script that lets me select the FPC version
>> and then:
>> -----------------------------
>> export PATH=/home/me/Programs/fpc/$FPC_VER/lib/fpc/$FPC_VER:$PATH
> Why the above path?
Because the actual compiler and cross-compilers are there. Otherwise fpc 
(which is in /home/me/Programs/fpc/$FPC_VER/bin) would not be able to 
locate ppc386 and ppcross386. And consequently, one cannot switch FPC 
versions without restarting the IDE.
>> export PATH=/home/me/Programs/fpc/$FPC_VER/bin:$PATH
>> export PATH=/home/me/Programs/fpc/crossbinutils/bin:$PATH
>> cd /tmp
>> /home/supra/Programs/lazarus/lazarus-svn/startlazarus
>> --pcp="/home/me/Programs/lazarus/config-lazarus-svn" ${CMD_LINE_PARAMS}
>> -----------------------------
>> $FPC_VER is 2.6.1 or 2.7.1 for example.
>> CMD_LINE_PARAMS is for debug purposes
>> --debug-log=/tmp/laz.log")
>> 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.
- if the actual compiler is in the path, then an odd situation will 
arise where the IDE will report a mix of FPC versions in about FPC (IDE 
internals), the old actual compiler will still be used, and the new 
sources are used.
> You can switch the compiler by using the combobox in the project's options or by
> using build modes.
The target in project options just cause fpc to call the required actual 
compiler. The pitfall is the same as above.
>> Are there fpc executables other than fpc and the actual compiler needed
>> by the IDE?
> Yes. What exactly depends on your program. For example fpcres is commonly used.
> These tools are called by the compiler, not the IDE.
This is why the 1st path is required (they are located in the same 
folder as the fpc binary).

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20120906/f000c5ed/attachment-0003.html>

More information about the Lazarus mailing list