[Lazarus] Lazarus Release 2.2.6

Bo Berglund bo.berglund at gmail.com
Thu Mar 16 20:51:40 CET 2023


On Thu, 16 Mar 2023 20:00:02 +0100, Martin Frb via lazarus
<lazarus at lists.lazarus-ide.org> wrote:

>On 16/03/2023 18:46, Bo Berglund via lazarus wrote:
>>
>> But it also seems like on each system there is only one version of fpc that can
>> be "active" (at least on Linux) because its config is stored outside of the pcp
>> dir in a user global fashion.
>> How can I make the fpc compiler versions co-exist and be recognized by the
>> respecive versions of Lazarus?
>>
>
>As for Lazarus:
>Lazarus takes an argument --pcp=
>So each version can be pointed to its own config.

I start Lazarus from desktop files in ~/.local/share/applications.

THe Lazarus_2.2.6.desktop file looks like this (long lines wrapped):

[Desktop Entry]
Comment=Lazarus IDE 2.2.6
Terminal=false
Name=Lazarus 2.2.6
#Entry below in order to set up PATH correctly on start
Exec=/bin/bash -l -c '/home/bosse/dev/lazarus/2.2.6/startlazarus
--pcp=/home/bosse/.lazarus_2.2.6'
Type=Application
Icon=/home/bosse/dev/lazarus/2.2.6/images/ide_icon48x48.png
Categories=Application;IDE;Development;GTK;GUIDesigner;Programming;
NoDisplay=false
Keywords=editor;Pascal;IDE;FreePascal;fpc;Design;Designer;


>That option can be put into a file called lazarus.cfg which is to reside 
>in the directory of your lazarus exe file

Never heard about this before...

>(or the startlazarus file if you use that / you only need that if you 
>have non-writable root installs, and/or for restarting after build)
>Mind that if you have root installs, then the lazarus exe eventually 
>ends up in the pcp, and the lazarus.cfg must be with the startlazarus 
>that would start the lazarus.

As I tried to explain my installs are all located inside $HOME, I do not like
having global installs of tools that are built from sources like I do.

>
>As for FPC:
>Either use scripts to start lazarus and set the $PATH for each fpc.

What do you mean by "set the $PATH"?
I have tried pointing the compiler setting in the dialog that pops up on first
start to the actual correct version of ppcx64, but the setting is not
accepted...
So I have symlinked it into $HOME/bin/ instead. But this is a single compiler
then and will be the one for all Lazarus versions... 

>Or start the ppc directly // configure lazarus to use the ppc.

As I said above Lazarus is started from a desktop file where the ppc dir is
defined...

>
>Mind that you also need the fpc.cfg to be found (so that can have ifdefs 
>based on the version)

This is a big problem since the fpc.cfg seems to be located in a common location
too.


I will have to study the info below and see how it can be applied to my case...

>
>---------------
> From my setup script
>
>this sets a folder for each fpc, and creates some symlinks
>- The IDE must be pointed to use the ppc in the lib/fpc/3.2.2/ folder.
>- there must be no global fpc.cfg (/etc or /home/name/.fpc or the like)
>
>compiling with -va allows to check what is used.
>
>$INSTPATH can be whatever.
>
>-------------
>
>mkdir -p /home/m/fpc/$INSTPATH/
>mkdir -p /home/m/fpc/$INSTPATH/gl
>mkdir -p /home/m/fpc/$INSTPATH/gw
>mkdir -p /home/m/fpc/$INSTPATH/def
>mkdir -p /home/m/fpc/$INSTPATH/o4
>
>############################
>cd /home/m/fpc/$INSTSRC/source
>
>make clean
>make all    OPT="-gw -O-1  "
>make install INSTALL_PREFIX=/home/m/fpc/$INSTPATH/gw
>
>mkdir -p /home/m/fpc/$INSTPATH/gw/lib/fpc/etc
>mkdir -p /home/m/fpc/$INSTPATH/gw/etc
>
>cd /home/m/fpc/$INSTPATH
>gw/bin/fpcmkcfg -d basepath=/home/m/fpc/$INSTPATH/gw/lib/fpc/$INSTVERS > 
>gw/lib/fpc/etc/fpc.cfg
>gw/bin/fpcmkcfg -d basepath=/home/m/fpc/$INSTPATH/gw/lib/fpc/$INSTVERS > 
>gw/etc/fpc.cfg
>
>ln -s /home/m/fpc/$INSTPATH/gw/lib/fpc/$INSTVERS/ppcx64 
>/home/m/fpc/$INSTPATH/gw/bin/ppcx64


-- 
Bo Berglund
Developer in Sweden



More information about the lazarus mailing list