I am not sure if this will help, but I place this script as "setup" in any
fpc directory:

#!/bin/bash

if [ -z ${OLDPATH+x} ]; then
  OLDPATH=$PATH
else
  PATH=$OLDPATH
fi

BASE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export PPC_CONFIG_PATH=$BASE/bin
rm $PPC_CONFIG_PATH/fpc.cfg > /dev/null 2>&1
$PPC_CONFIG_PATH/fpcmkcfg -d basepath=$BASE/lib/fpc/\$FPCVERSION -o
$PPC_CONFIG_PATH/fpc.cfg
export PATH=$PPC_CONFIG_PATH:$OLDPATH

Then when I want to change compilers, I go to the fpc folder with the
version I want to use and execute:

. ./setup

This sources the script setup, and changes the fpc version. Example:

user@debian: fpc
*bash: fpc: command not found*
user@debian: cd $HOME/Development/FreePascal/fpc-trunk
user@debian: . ./setup
user@debian: fpc -iV
*3.1.1*
user@debian: cd $HOME/Development/FreePascal/fpc-3.0.0
user@debian: . ./setup
user@debian: fpc -iV
*3.0.0*

What this script does is save the old path, put the bin folder of fpc in
the path, set the PPC_CONFIG_PATH variable, and generate a new bin/fpc.cfg.
You can then have as many fpc compiler versions as will fit on disk, and
change compilers easily.

So in summary, copy my script above to each fpc folder, name it setup,
chmod +x setup, and . ./setup to change to a specific compiler.
-- 
_______________________________________________
Lazarus mailing list
[email protected]
https://lists.lazarus-ide.org/listinfo/lazarus

Reply via email to