20.2. How GNU Autotools Uses M4

The GNU Autotools may all appear to use M4, but in actual fact, it all boils down to autoconf, which 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, because 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 resulting ...

Get GNU Autoconf, Automake, and Libtool now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.