21.1 What does M4 do?

back: m4
forward: how gnu autotools uses m4
fastback: m4
up: m4
fastforward: writing portable bourne shell
top: autoconf, automake, and libtool
contents: table of contents
index: index
about: about this document

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. These concepts will be elaborated on in 21.3 Fundamentals of M4 processing.

M4 includes a set of pre-defined macros that make it substantially more useful. The most important ones will be discussed in 21.4 Features of M4. These macros perform functions such as arithmetic, conditional expansion, string manipulation and running external shell commands.

This document was generated by Gary V. Vaughan on May, 24 2001 using texi2html

GNU Autoconf, Automake and Libtool
GNU Autoconf, Automake, and Libtool
ISBN: 1578701902
EAN: 2147483647
Year: 2002
Pages: 290

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net