I was about to ask: OS? But your follow up shows Linux.
Then the next question is, do you plan to have more than one FPC?
And that includes: Do you already have an FPC installation via any installer?
1) If you have an installed fpc, you likely have /etc/fpc.cfg or at least an fpc.cfg in your home folder.
And if you have that, your new fpc is gonna see this, and is going to do things you don't want it to do...
Also, if there is more than one fpc, then you don't want them in the %PATH%. If you have you can very quickly get screw ups. Especially since fpc needs to call ppc...
If you only have one, its easy (well except for the starting compiler that you need for the build).
If you have (or may in future have) more than one, then you need to be careful.
You can run the make install with an INSTALL_PREFIX. And do the install outside of %PATH%.
And there is a place somewhere in that install where you can create your fpc.cfg so that it will be found by that one fpc only (and not by any other that is in any other path).
You can always use "fpc -va someprog.pas" and scan the output for all locations that it seeks for the fpc.cfg.
I use something like....
- Not sure if you need to modify the PATH var. If you don't you may have to specify some other stuff....
- for me I temporarily point it to another existing install
- I had to edit the below, as my script has plenty of shell vars / hope I made no mistakes...
- not sure why I have 2 fpc.cfg created / one must be wrong /unused
- not sure if the ln is needed. If you always call ppx64 directly then not. Otherwise check first if your fpc finds the correct ppcx64 (finds it at all, assuming no other is in path)
FPC=/home/m/somewhere/ppcx64 export FPC
PATH=/home/m/fpc/install/3.2.2:$PATH ; export PATH
cd /home/m/fpc/git
make clean
make all OPT=" -O4 "
make install INSTALL_PREFIX=/home/m/fpc/install/3.3.1
mkdir -p /home/m/fpc/install/3.3.1/lib/fpc/etc
mkdir -p /home/m/fpc/install/3.3.1/etc
cd /home/m/fpc/install/3.3.1
./bin/fpcmkcfg -d basepath=/home/m/fpc/install/3.3.1/lib/fpc/3.3.1 > lib/fpc/etc/fpc.cfg
./bin/fpcmkcfg -d basepath=/home/m/fpc/install/3.3.1/lib/fpc/3.3.1 > etc/fpc.cfg
# ln -s /home/m/fpc/install/3.3.1/lib/fpc/3.3.1/ppcx64 /home/m/fpc/install/3.3.1/bin/ppcx64
----------------------
Lazarus is easy to have many versions. Search the wiki for multiple lazarus. It should tell you how to create a lazarus.cfg file pointing to a separate pcp. (primary config path).