Contents | < Browse | Browse >
Invoking `m4'
*************
The format of the `m4' command is:
`m4' [OPTIONS] [MACRO-DEFINITIONS] [INPUT-FILES]
All options begin with `-', or if long option names are used, with a
`--'. A long option name need not be written completely, and
unambigous prefix is sufficient. `m4' understands the following
options:
`-V'
`--version'
Print the version number of the program. To see only the version
number, use the command `m4 -V /dev/null'.
`-G'
`--no-gnu-extensions'
Suppress all the extensions made in this implementation, compared
to the System V version. For a list of these, Compatibility.
`-dFLAGS'
`--debug FLAGS'
Set the debug-level according to the flags FLAGS. The debug-level
controls the format and amount of information presented by the
debugging functions. Debug Levels, for more details on the
format and meaning of FLAGS.
`-lNUM'
`--arglength NUM'
Restrict the size of the output generated by macro tracing.
Debug Levels for more details.
`-oFILE'
`--erroroutput FILE'
Redirect debug and trace output to the named file. Error messages
are still printed on the standard error output.
Debug Output for more details.
`-IDIR'
`--include DIR'
Make `m4' search DIR for included files that are not found in the
current working directory. Search Path for more details.
`-e'
`--interactive'
Makes this invocation of `m4' interactive. This means that all
output will be unbuffered, and interrupts will be ignored.
`-s'
`--synclines'
Generate synchronisation lines, for use by the C preprocessor or
other similar tools. This is useful, for example, when `m4' is
used as a front end to a compiler. Source file name and line
number information is conveyed by lines of the form `#line LINENUM
"FILENAME"', which are inserted as needed into the middle of the
input (but always on complete lines per themselves). Such lines
mean that the following line originated or was expanded from the
contents of input file FILENAME at line LINENUM. The `"FILENAME"'
part is often omitted when the file name did not change from the
previous synchronisation line.
`-HN'
`--hashsize N'
Make the internal hash table for symbol lookup be N entries big.
The number should be prime. The default is 509 entries. It
should not be necessary to increase this value, unless you define
an excessive number of macros.
`-NN'
`--diversions N'
Allow for up to N diversions to be used at the same time. The
default is 10 diversions.
`-Q'
`--quiet'
`--silent'
Suppress warnings about missing or superflous arguments in macro
calls.
`-B'
`-S'
`-T'
These options are present for compatibility with System V `m4', but
do nothing in this implementation.
Macro definitions and deletions can be made on the command line, by
using the `-D' and `-U' options. They have the following format:
`-DNAME'
`-DNAME=VALUE'
`--define NAME'
`--define NAME=VALUE'
This enters NAME into the symbol table, before any input files are
read. If `=VALUE' is missing, the value is taken to be the empty
string. The VALUE can be any string, and the macro can be defined
to take arguments, just as if it was defined from within the input.
`-UNAME'
`--undefine NAME'
This deletes any predefined meaning NAME might have. Obviously,
only predefined macros can be deleted in this way.
`-tNAME'
`--trace NAME'
This enters NAME into the symbol table, as undefined but traced.
The macro will consequently be traced from the point it is defined.
The remaining arguments on the command line are taken to be input
file names. If no names are present, the standard input is read. A
file name of `-' is taken to mean the standard input.
The input files are read in the sequence given. The standard input
can only be read once, so the filename `-' should only appear once on
the command line.