GNU Autoconf, Automake, and Libtool
by Gary V. Vaughan, Ben Elliston, Tom Tromey, Ian Lance Taylor
20.1. What Does M4 Do?
m4 is a general-purpose tool suitable for all kinds of text processing applications—not unlike the C preprocessor, cpp, with which you are probably familiar. Its obvious application is as a front end for a compiler—m4 is in many ways superior to cpp.
Briefly, m4 reads text from the input and writes processed text to the output. Symbolic macros may be defined which have replacement text. As macro invocations are encountered in the input, they are replaced ("expanded") with the macro's definition. Macros may be defined with a set of parameters and the definition can specify where the actual parameters will appear in the expansion. Section 20.3, "Fundamentals of M4 Processing," expands on these concepts.
M4 includes a ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access