21.2 How GNU Autotools uses M4

back: what does m4 do?
forward: fundamentals of m4 processing
fastback: fundamentals of m4 processing
up: m4
fastforward: writing portable bourne shell
top: autoconf, automake, and libtool
contents: table of contents
index: index
about: about this document

The GNU Autotools may all appear to use M4, but in actual fact, it all boils down to autoconf that invokes m4 to generate your `configure' script. You might be surprised to learn that the shell code in `configure' does not use m4 to generate a final `Makefile' from `Makefile.in' . Instead, it uses sed , since that is more likely to be present on an end- user 's system and thereby removes the dependency on m4 .

Automake and Libtool include a lot of M4 input files. These are macros provided with each package that you can use directly (or indirectly) from your `configure.in' . These packages don't invoke m4 themselves .

If you have already installed Autoconf on your system, you may have encountered problems due to its strict M4 requirements. Autoconf demands to use GNU M4, mostly due to it exceeding limitations present in other M4 implementations . As noted by the Autoconf manual, this is not an onerous requirement, as it only affects package maintainers who must regenerate `configure' scripts.

Autoconf's own `Makefile' will freeze some of the Autoconf `.m4' files containing macros as it builds Autoconf. When M4 freezes an input file, it produces another file which represents the internal state of the M4 processor so that the input file does not need to be parsed again. This helps to reduce the startup time for autoconf .

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

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