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

Tomas Hajny XHajT03 at hajny.biz
Sun Feb 16 13:29:42 CET 2014


On Sun, February 16, 2014 13:00, Mark Morgan Lloyd wrote:
> 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.
 .
 .
> 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.

If having different file per version is really necessary (rather than only
having differences among versions covered by #IFDEF within a single file),
combining an #IFDEF with an #INCLUDE inside the fpc.cfg may be an option.
Renaming doesn't sound nicely to me (parallel compilation using different
versions, etc.).

Tomas





More information about the fpc-devel mailing list