[fpc-devel] fpcmkcfg invocation for two versions (linux)

Joost van der Sluis joost at cnoc.nl
Tue Oct 21 09:33:42 CEST 2014


> thank you,
> 
> but my question was more about where to put fpc.cfg so that both 
> versions can use it properly, or, if that is not possible, where to 
> stuff different fpc.cfg's for the same purpose?
> and what would be the basepath in either case?

Normally, if you install both versions at the same location, you don't need two fpc.cfg files. Inside the fpc.cfg you can use macro's so that the the compiler searches for the right units (ppu's). This is done by fpcmkcfg by default. (Or samplecfg which is a wrapper around fpcmkcfg)

Overall the proces is quite simple: install fpc version A. Rename the compiler-executable from ie. ppcx64 to ppcx64_2_6_4. Then install fpc version b. Now you can select which version you want to use by calling the compiler using different names. (ppcx64 and ppcx64_2_6_4). This works perfectly if you use an IDE like Lazarus, in which you can simply select which compiler-executable to use. If you want to use 'fpc' to call the compiler, you need some additional tricks.

But to answer your question: you can place a fpc.cfg in the same location as the executable. If you place the executables of both compiler-versions in a different directory, they can both have their own fpc.cfg. (You can use the -va compiler option to see which fpc.cfg is actually used)

My current setup is that I have fpc-trunk installed in my home-directory. (I use 'make install PREFIX=~/fpc') And I have added ~/fpc/bin/x86_64 to my path. And I have a fpc.cfg in ~/fpc/bin/x86_64.

But I also have fpc 2.6.4 installed, the version provided by my Linux-distribution. If I need the original/latest release I use the full path to the compiler, or rename ~/fpc to ~/fpc_.

In short: there are a lot of configurations possible, and everyone can decide what's the best setup for his/her needs.

Joost.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20141021/cabad869/attachment.html>


More information about the fpc-devel mailing list