You can specify comments in the configuration file with the # sign.
Everything from the # on will be ignored, unless it is one of the keywords (see below).
The compiler looks for the ppc386.cfg file in the following places :
\ - Under Linux
\ \ - The current directory.
\ \ - Home directory, looks for .ppc386.cfg
\ \ - The directory specified in the environment
\ \ variable PPC\_CONFIG\_PATH, and if it's not
\ \ set under /etc.
\ - Under all other OSes:
\ \ - The current directory.
\ \ - The directory specified in the environment
\ \ variable PPC\_CONFIG\_PATH.
\ \ - The directory where the compiler binary is.
When the compiler has finished reading the configuration file, it continues
to treat the command line options.
One of the command-line options allows you to specify a second configuration
file: Specifying \@foo on the command line will use file foo instead of ppc386.cfg
and read further options from there. When the compiler has finished reading
this file, it continues to process the command line.
The configuration file allows some kind of preprocessing. It understands the
following directives, which you should place on the first column of a line :
\ #IFDEF
\ #IFNDEF
\ #ELSE
\ #ENDIF
\ #DEFINE
\ #UNDEF
\ #WRITE
\ #INCLUDE
\ #SECTION
They work the same way as their $... directive counterparts in Pascal:
Lines following #IFDEF are skipped read if the keyword "name"
following it is not defined.
They are read until the keywords #ELSE or #ENDIF are
encountered, after which normal processing is resumed.
#IFDEF VER0_99_12
-Fu/usr/lib/fpc/0.99.12/rtl
#ENDIF
In the above example, /usr/lib/fpc/0.99.12/rtl will be added to
the path if you're compiling with version 0.99.12 of the compiler.
Lines following #IFDEF are skipped read if the keyword "name"
following it is defined.
They are read until the keywords #ELSE or #ENDIF are
encountered, after which normal processing is resumed.
#IFNDEF VER0_99_12
-Fu/usr/lib/fpc/0.99.13/rtl
#ENDIF
In the above example, /usr/lib/fpc/0.99.13/rtl will be added to
the path if you're NOT compiling with version 0.99.12 of the compiler.
#ELSE can be specified after a #IFDEF or #IFNDEF
directive as an alternative.
Lines following #ELSE are skipped read if the preceding #IFDEF
#IFNDEF was accepted.
They are skipped until the keyword #ENDIF is
encountered, after which normal processing is resumed.
#IFDEF VER0_99_12
-Fu/usr/lib/fpc/0.99.12/rtl
#ELSE
-Fu/usr/lib/fpc/0.99.13/rtl
#ENDIF
In the above example, /usr/lib/fpc/0.99.12/rtl will be added to
the path if you're compiling with version 0.99.12 of the compiler,
otherwise /usr/lib/fpc/0.99.13/rtl will be added to the path.
#ENDIF marks the end of a block that started with #IF(N)DEF,
possibly with an #ELSE between it.
#UNDEF un-defines a keyword if it existed.
This has the same effect as a "-uname" command-line option.
#WRITE writes "Message Text" to the screen.
This can be useful to display warnings if certain options are set.
#IFDEF DEBUG
#WRITE Setting debugging ON...
-g
#ENDIF
if "DEBUG is defined, this will produce a line
Setting debugging ON...
and will then switch on debugging information in the compiler.
#INCLUDE instructs the compiler to read the contents of
"filename" before continuing to process options in the current file.
This can be useful if you want to have a particular configuration file
for a project (or, under Linux, in your home directory), but still want to
have the global options that are set in a global configuration file.
#IFDEF LINUX
#INCLUDE /etc/ppc386.cfg
#ELSE
#IFDEF GO32V2
#INCLUDE c:\\pp\\bin\\ppc386.cfg
#ENDIF
#ENDIF
This will include /etc/ppc386.cfg if you're on a linux machine,
and will include c:\\pp\\bin\\ppc386.cfg on a dos machine.
The #SECTION directive acts as a #IFDEF directive, only
it doesn't require an #ENDIF directive. the special name COMMON
always exists, i.e. lines following #SECTION COMMON are always read.