<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
</head>
<body>
<p style="margin: 0pt;">
<span>
<span></span>
</span>
</p>
<p style="margin: 0px; "></p>
<div style="margin: 5px 0px;">
<br/>
patspiper <patspiper@gmail.com> hat am 15. März 2012 um 12:26 geschrieben:
<br/>
<br/>
> As per Vincent's request, the discussion has been moved from the bug
<br/>
> tracker to the mailing list.
<br/>
>
<br/>
> I will list my vague recollection of the ideas I had for brain storming
<br/>
> purposes, as I used to cross-compile a lot (it has been some time since
<br/>
> I haven't!), and switch different FPC versions. I thus devised a script
<br/>
> that help me switch easily:
<br/>
>
<br/>
> ---------------------------------------
<br/>
> #!/bin/sh
<br/>
>
<br/>
> # Disable Ubuntu's overlay scroll bars which do not work with Lazarus
<br/>
> export LIBOVERLAY_SCROLLBAR=0
<br/>
>
<br/>
> # Specify FPC version
<br/>
> FPC_VER=2.6.1
<br/>
>
<br/>
> # Add to the path the 3 required paths for the full operation of FPC and
<br/>
> binutils for cross compilation
<br/>
> export PATH=/home/me/Programs/fpc/$FPC_VER/lib/fpc/$FPC_VER:$PATH
<br/>
> export PATH=/home/me/Programs/fpc/$FPC_VER/bin:$PATH
<br/>
> export PATH=/home/me/Programs/fpc/crossbinutils/bin:$PATH
<br/>
>
<br/>
> echo $PATH
<br/>
> cd /tmp
<br/>
> /home/me/Programs/lazarus/lazarus-svn/lazarus
<br/>
> --pcp="/home/me/Programs/lazarus/config-lazarus-svn"
<br/>
> ---------------------------------------
<br/>
>
<br/>
> The downside is:
<br/>
> 1- Having one script per FPC version
</div>
<div style="margin: 5px 0px;">> 2- The FPC executable and sources path must be changed in the IDE options.</div>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;">You can use macros in the IDE options. For example:</p>
<p style="margin: 0px;">export FPC_VER=2.6.1 && ./lazarus</p>
<p style="margin: 0px;">Then you can use the macro $ENV(FPC_VER) in IDE options. </p>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;"> </p>
<div style="margin: 5px 0px;">> 3- Rebuilding Lazarus from within does not relaunch the IDE automatically.</div>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;">For relaunching use startlazarus:</p>
<p style="margin: 0px;">/home/me/Programs/lazarus/lazarus-svn/startlazarus --pcp="/home/me/Programs/lazarus/config-lazarus-svn"</p>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;"> </p>
<div style="margin: 5px 0px;">
>
<br/>
> Selecting the proper fpc version in the environment options the way it
<br/>
> is now is difficult as 2 paths have to be edited and changed (once for
<br/>
> the fpc executable and another for the fpc sources).
</div>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;">Normally you set the compiler path to the fpc executable.</p>
<p style="margin: 0px;">The IDE will then get the fpc version from it. So you can use the IDE's FPCVer macro. For example you can use this macro in the FPC sources directory.</p>
<p style="margin: 0px;">Changing the compiler will automatically switch the FPC sources.</p>
<p style="margin: 0px;">Changing the target OS of the project automatically switches compiler and FPC sources. </p>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;"> </p>
<div style="margin: 5px 0px;">>[...]I say leave fpc itself locate the actual compiler.</div>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;">+1 </p>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;"> </p>
<div style="margin: 5px 0px;">
>
<br/>
> My proposal is:
<br/>
> - Add to the IDE's option a dropdown list where one can add versions and
<br/>
> select the required one which will be used as an FPC_VER macro.
</div>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;">The compiler path of the IDE has already a history drop down list. </p>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;"> </p>
<div style="margin: 5px 0px;">
> - Allow the export of environment variables such as the PATH in the
<br/>
> IDE's options.
</div>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;">Yes, it's a todo to implement run parameters for the compiler (and the other external tools). </p>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;"> </p>
<div style="margin: 5px 0px;">
>
<br/>
> This will not solve downside #3, as a script is still needed for the
<br/>
> --pcp option and the overlay scrollbars issue, but it will make
<br/>
> switching FPC versions a breeze.
</div>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;">When you use macros, you only need one pcp and then you can use the default. </p>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;">Mattias</p>
<p style="margin: 0px;"> </p>
</body>
</html>