[fpc-pascal] Search path order for fpc.cfg

Michael Van Canneyt michael at freepascal.org
Sun Apr 12 13:55:48 CEST 2020

On Sun, 12 Apr 2020, fredvs via fpc-pascal wrote:

>> committed in rev. 44697
> Yep, excellent!
>> Note that this still may cause surprises, because paramstr(0) is not 100%
> reliable.
> Hum, ok, but I assume to take the risk.
> Finally, the worst that can happen is fail to compil.

I would think this is about the biggest failure of all for a compiler ?

> Nice, FPC is nearly OOTB now.
> Only miss a very, very little patches: the "so.n" of course and the
> searchpath order.

No. Sorry. I don't intend to budge on this last one.
For backwards compatibility and simply because unix does not do this.

I also have not seen any convincing argument why it is needed. 
It's definitely not needed for your "OOTB experience".

In your zip use a directory structure
and the compiler will find the config file by itself if you place it in etc.

I agree that the .so.n can only be solved in the compiler, but this not.

And to be correct:

All your OOTB problems can be solved without a single line of code change in the
Just create a script that people should use to compile instead of directly using 
the 'fpc' command, and specify the config  file in the script, and any other 
options you want for your OOTB experience.

Inside the script you have the ability to detect whatever you want:

You can even call the script 'fpc'.

Most large projects use a script to "sanitize" the environment before starting
the actual binary. Even the firefox browser does this, android studio,
vmware player etc.. (I checked)

And given all the customization you want to do, that seems like the best option
to me, because I get the idea you will do a lot more customization still.


More information about the fpc-pascal mailing list