5.3 Variable substitution in paths

To avoid having to edit your configuration files too often, the compiler allows you to specify the following variables in the paths that you feed to the compiler:

FPCFULLVERSION
is replaced by the compiler’s version string.
FPCVERSION
is replaced by the compiler’s version string.
FPCDATE
is replaced by the compiler’s date.
FPCTARGET
is replaced by the compiler’s target (combination of CPU-OS)
FPCCPU
is replaced by the compiler’s target CPU.
FPCOS
is replaced by the compiler’s target OS.

To have these variables subsituted, just insert them with a $ prepended, as follows:

-Fu/usr/lib/fpc/$FPCVERSION/rtl/$FPCOS

This is equivalent to

-Fu/usr/lib/fpc/2.2.2/rtl/linux

if the compiler version is 2.2.2 and the target OS is linux.

These replacements are valid on the command line and also in the configuration file.

On the linux command line, you must be careful to escape the $ since otherwise the shell will attempt to expand the variable for you, which may have undesired effects.