5.1.4 Preprocessor

Before actual parsing, the configuration file is preprocessed. The built-in preprocessor handles only file inclusion and #line statements (see section Pragmatic Comments), while the rest of traditional preprocessing facilities, such as macro expansion, is supported via m4, which serves as external preprocessor.

The detailed description of m4 facilities lies far beyond the scope of this document. You will find a complete user manual in http://www.gnu.org/software/m4/manual. For the rest of this subsection we assume the reader is sufficiently acquainted with m4 macro processor.

The external preprocessor is invoked with ‘-s’ flag, which instructs it to include line synchronization information in its output. This information is then used by the parser to display meaningful diagnostic.

An initial set of macro definitions is supplied by the ‘pp-setup’ file, located in ‘$prefix/share/slb/version/include’ directory (where version means the version of SLB).

The default ‘pp-setup’ file renames all m4 built-in macro names so they all start with the prefix ‘m4_’. This is similar to GNU m4 ‘--prefix-builtin’ options, but has an advantage that it works with non-GNU m4 implementations as well.

Additional control over the preprocessor is provided via the following command line options:

--define=name[=value]
-Dname[=value]

Define the preprocessor symbol name as having value, or empty.

--include-directory=dir
-Idir

Add dir to the list of directories searched for preprocessor include files.

--no-preprocessor

Disable preprocessor.

--preprocessor=command

Use command instead of the default preprocessor.