m4: Preprocessor features
1
1 2.2 Command line options for preprocessor features
1 ==================================================
1
1 Several options allow 'm4' to behave more like a preprocessor. Macro
1 definitions and deletions can be made on the command line, the search
1 path can be altered, and the output file can track where the input came
1 from. These features occur with the following options:
1
1 '-D NAME[=VALUE]'
1 '--define=NAME[=VALUE]'
1 This enters NAME into the symbol table. If '=VALUE' is missing,
1 the value is taken to be the empty string. The VALUE can be any
1 string, and the macro can be defined to take arguments, just as if
1 it was defined from within the input. This option may be given
1 more than once; order with respect to file names is significant,
1 and redefining the same NAME loses the previous value.
1
1 '-I DIRECTORY'
1 '--include=DIRECTORY'
1 Make 'm4' search DIRECTORY for included files that are not found in
1 the current working directory. ⇒Search Path, for more
1 details. This option may be given more than once.
1
1 '-s'
1 '--synclines'
1 Generate synchronization lines, for use by the C preprocessor or
1 other similar tools. Order is significant with respect to file
1 names. This option is useful, for example, when 'm4' is used as a
1 front end to a compiler. Source file name and line number
1 information is conveyed by directives of the form '#line LINENUM
1 "FILE"', which are inserted as needed into the middle of the
1 output. Such directives mean that the following line originated or
1 was expanded from the contents of input file FILE at line LINENUM.
1 The '"FILE"' part is often omitted when the file name did not
1 change from the previous directive.
1
1 Synchronization directives are always given on complete lines by
1 themselves. When a synchronization discrepancy occurs in the
1 middle of an output line, the associated synchronization directive
1 is delayed until the next newline that does not occur in the middle
1 of a quoted string or comment.
1
1 define(`twoline', `1
1 2')
1 =>#line 2 "stdin"
1 =>
1 changecom(`/*', `*/')
1 =>
1 define(`comment', `/*1
1 2*/')
1 =>#line 5
1 =>
1 dnl no line
1 hello
1 =>#line 7
1 =>hello
1 twoline
1 =>1
1 =>#line 8
1 =>2
1 comment
1 =>/*1
1 =>2*/
1 one comment `two
1 three'
1 =>#line 10
1 =>one /*1
1 =>2*/ two
1 =>three
1 goodbye
1 =>#line 12
1 =>goodbye
1
1 '-U NAME'
1 '--undefine=NAME'
1 This deletes any predefined meaning NAME might have. Obviously,
1 only predefined macros can be deleted in this way. This option may
1 be given more than once; undefining a NAME that does not have a
1 definition is silently ignored. Order is significant with respect
1 to file names.
1