[fpc-devel] One fpc.cfg per fpc version

Mark Morgan Lloyd markMLl.fpc-devel at telemetry.co.uk
Sun Feb 16 13:00:59 CET 2014


Mattias Gaertner wrote:
> Hi,
> 
> Is there a recommended or usual way to install multiple FPC versions
> and one fpc.cfg per version under Linux/Unix?
> 
> fpc 2.6.2 and 2.7.1 search fpc.cfg under Linux:
> 
> Configfile search: /home/mattias/.fpc.cfg
> Configfile search: /usr/lib/fpc/etc/fpc.cfg
> Configfile search: /etc/fpc.cfg
> 
> The second is actually
> <directory of ppcx64>/../etc/fpc.cfg
> 
> So, fpc first searches a user config, then a "flavor" config (e.g. one
> per version) and the last is the global config.
> 
> When installing multiple version of fpc you normally get
> /usr/(local/)lib/fpc/2.6.2/ppcx86
> /usr/(local/)lib/fpc/2.7.1/ppcx86
> 
> Because of the '..' in <>/../etc/fpc.cfg the version vanished in the
> search. So by default you can not have one fpc.cfg per fpc version.

I've got a very vague recollection from elsewhere that you can do this 
sort of thing using a unix-domain (named) pipe. In other words it would 
probably be something like a "config-file server" daemon listening for 
attempts to open /etc/fpc.cfg, finding out which backend fpc was 
attempting to run, and returning (the content of) the appropriate file.

In practice it would probably be easier to patch /usr/local/bin/fpc, or 
to wrap it in a script which renamed fpc.cfg on the fly.

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]



More information about the fpc-devel mailing list