[fpc-pascal] Search path order for fpc.cfg
Michael Van Canneyt
michael at freepascal.org
Sun Apr 12 12:16:20 CEST 2020
On Sun, 12 Apr 2020, Bo Berglund via fpc-pascal wrote:
> On Fri, 10 Apr 2020 13:44:17 -0700 (MST), fredvs via fpc-pascal
> <fpc-pascal at lists.freepascal.org> wrote:
>> 2) Your home directory, it looks for .fpc.cfg.
> This is something I have been wondering about for a while..
> When I install FPC from sources I have to create a config file by
> using this command:
> /home/user/lib/fpc/$FPCVER/samplecfg "/home/user/lib/fpc/$FPCVER"
> (replace "user" with the actual username such as pi or whatever)
> The problem with this is that the generated file is named fpc.cfg so I
> have to do a rename afterwards and this is not always remembered (like
You can hardly blame us for you not remembering things... :-)
> Why does fpc look for .fpc.cfg in the user home dir when it is
> otherwise looking for fpc.cfg?
Because the naming convention on unixes is like that for config files in
your home directory. This is not fpc specific.
This convention predates the systems used by desktop environments which nowadays puts
everything in ~/.config or ~/.share or some other convention. But it is
still in use today.
So, rather than adapting to the flavour of the day config system, we stick to
what - after all these years - is still common practice on unix, and which
we have been consistently using since day 1.
If you don't like this name, fine: you can set an environment variable to
point the compiler to where it is.
You only need to do this once.
So it's not like we don't offer you a myriad of ways to specify a config
More information about the fpc-pascal