FPC User's guide is unclear (misleading) about location of fpc.cfg
Original Reporter info from Mantis: zoran
-
Reporter name: Zoran Vučenović
Original Reporter info from Mantis: zoran
- Reporter name: Zoran Vučenović
Description:
The Users'guide says (see http://www.freepascal.org/docs-html/user/usersu10.html):
the compiler will look for a configuration file fpc.cfg in the following places:
Under unix (such as linux)
1. The current directory.
2. Your home directory, it looks for .fpc.cfg.
3. The directory specified in the environment variable PPC_CONFIG_PATH, and if it is not set, it will look in the etc directory above the compiler directory. (For instance, if the compiler is in /usr/local/bin, it will look in /usr/local/etc)
4. The directory /etc.
The third point says (...) it will look in the etc directory above the compiler directory. (For instance, if the compiler is in /usr/local/bin, it will look in /usr/local/etc)
But if during the installation the compiler path is for example /home/my_fpc_path/bin, then if I put fpc.cfg in /home/my_fpc_path/etc/fpc.cfg, the compiler cannot find it.
The reason is (as Jonas explained - http://forum.lazarus.freepascal.org/index.php/topic,30259.msg192446.html#msg192446) that there are only symbolic links with names ppc386, ppcx64,... in the "bin" directory that contains the "fpc" binary, which point to the compiler binary of the last installed version (in ../lib/fpc/$fpcversion/).
By following the documentation, the ordinary fpc user expects that compiler searches for ../etc/fpc.cfg relative to bin directory, he can hardly discover all about these symbolic links.
Additional information:
Please see http://forum.lazarus.freepascal.org/index.php/topic,30259.0.html
Perhaps something like this should be added to the end of point 3. (mostly quoted what Jonas says in forum post:
...
Note that "fpc" is not the compiler, but the compiler driver. The actual compiler is named ppc386, ppcx64 etc. There are only symbolic links with those names in the "bin" directory that contains the "fpc" binary, which point to the compiler binary of the last installed version (in ../lib/fpc/$fpcversion/).
Therefore, the path should actually not be ../etc/fpc.cfg, but ../lib/fpc/etc/fpc.cfg relative to bin directory. The actual search path can be seen in the output of the "fpc -va".
Mantis conversion info:
- Mantis ID: 28957
- OS: Linux
- Fixed in version: 3.0.0
- Fixed in revision: 1246 (#b0e10c1b)
- Target version: 3.0.0