[Lazarus] Lazarus and FreePascal version relations on Linux and Windows?

Martin Frb lazarus at mfriebe.de
Wed Feb 22 11:11:38 CET 2023

On 22/02/2023 10:00, Bo Berglund via lazarus wrote:
> Now I am having problems installing Lazarus 2.2.4 on Linux systems where older
> Lazarus version exist because they use an older FPC which the new Lazarus cannot
> use (3.0.4 vs 3.2.2).
You can install several fpc on Linux.

** But you need to remove the global /etc/fpc.cfg and have it local to 
the install. **
You can look at the output of
     fpc -va  empty_project.pas | grep fpc.cfg
to find the locations were fpc looks for it.

There may also be a way (I don't know) to have the IDE pass a param to 
fpc telling fpc which fpc.cfg to use....

And you either need to start the IDE via a script, setting a suitable 
%PATH env, so the correct fpc can be found. And fpc can find the correct 
Or if you don't cross compile, you can invoke ppc directly .

I use the below. It allows several builds, even of the same version 
(debug / opt)


mkdir -p /home/m/fpc/$INSTSRC
mkdir -p /home/m/fpc/$INSTSRC/source
cd /home/m/fpc/$INSTSRC/source

git -C  /home/m/fpc/svn/source --work-tree=/home/m/fpc/$INSTSRC/source 
restore .

### have a full working fpc in path to start the build

mkdir -p /home/m/fpc/$INSTPATH/
mkdir -p /home/m/fpc/$INSTPATH/def

cd /home/m/fpc/$INSTSRC/source

make clean
make all  OPT="-g- -gl -O-2  "
make install INSTALL_PREFIX=/home/m/fpc/$INSTPATH/def

mkdir -p /home/m/fpc/$INSTPATH/def/lib/fpc/etc
mkdir -p /home/m/fpc/$INSTPATH/def/etc

cd /home/m/fpc/$INSTPATH
def/bin/fpcmkcfg -d basepath=/home/m/fpc/$INSTPATH/def/lib/fpc/$INSTVERS 
 > def/lib/fpc/etc/fpc.cfg
def/bin/fpcmkcfg -d basepath=/home/m/fpc/$INSTPATH/def/lib/fpc/$INSTVERS 
 > def/etc/fpc.cfg

ln -s /home/m/fpc/$INSTPATH/def/lib/fpc/$INSTVERS/ppcx64 

## use in the IDE /home/m/fpc/$INSTPATH/def/lib/fpc/$INSTVERS/ppcx64

> And another question:
> How can I force Lazarus to show the initial configuration page, which is shown
> on the very first start after installing Lazarus and later is skipped?
lazarus --setup

In the git main version of lazarus you can also force certain checks to 
be skipped (including fppkg)
lazarus --help

                       Skip selected checks at startup.

You can put those into the
file (in the same directory as your lazarus exe // or your startlazarus 
exe, in case you use that and your lazarus is it the primary conf path)

More information about the lazarus mailing list