Compilers command line options
Preprocessor options can be used with fglcomp and fglform compilers.
File inclusion path
The -I
option defines a single path used to search files included by
the &include
directives:
-I path
-I
path
option:fglcomp -I /usr/app1/src/common -I /usr/app1/src/stock ...
Macro definition
The -D
option defines a macro with a default value of 1, so that it
can be used in conditional directives like &ifdef
:
-D identifier
The -D
option can also define a macro with a value:
-D identifier=value
-D "VSTR=\"Version 1.32\""
-U
option undefines a macro. The macro will not be defined, even
if it is defined with the -D
option later in the command line, or when it is
defined in the code with a &define
directive: -U identifier
However, predefined macros such as __LINE__
cannot be undefined with
the -U
option.
Preprocessing only
-E
By using the -E
option, only the preprocessing phase is done by the compilers.
Result is dumped in standard output.
Preprocessing style option
-p { nopp | noln | fglpp | auto }
When using option -p nopp
, it disables the preprocessor phase.
By using option -p noln
with the -E
preprocessing-only option,
you can remove line number information and unnecessary empty lines.
By default, the preprocessor expects an ampersand '&
' as preprocessor symbol
for macros. The option -p fglpp
enables the old syntax, using the hash
'#
' as preprocessor symbol. The hash '#
' syntax is not compatible
with single-line comments.
When using -p auto
, the compiler detects automatically the
'&
' ampersand or '#
' hash usage for preprocessor commands in
the source code. The first preprocessor instruction found in the source will define the
preprocessing style.
Examples
fglcomp -D DEBUG -I /usr/sources/headers program.4gl
fglcomp -p fglpp program.4gl
fglcomp -p auto module.4gl