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
Note: To specify multiple include directories, repeat the -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
Note: If you want to define a macro with a string value containing spaces, you need to provide the identifier and value as a single command line parameter. For example on UNIX®: -D "VSTR=\"Version 1.32\""
The -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 options

 -p { nopp | noln | fglpp }

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.

Examples

fglcomp -E -D DEBUG -I /usr/sources/headers program.4gl
fglcomp -E -p fglpp -I /usr/sources/headers program.4gl
fglcomp -E -p nopp -I /usr/sources/headers program.4gl