| Autoconf, Automake, and Libtool | ||
|---|---|---|
| <<< Previous | Next >>> | |
Autoconf is an extensible system which permits new macros to be written and shared between Autoconf users. Although it is possible to perform custom tests by placing fragments of shell code into your configure.in file, it is better practice to encapsulate that test in a macro. This encourages macro authors to make their macros more general purpose, easier to test and easier to share with other users.
This chapter presents some guidelines for designing and implementing good Autoconf macros. It will conclude with a discussion of the approaches being considered by the Autoconf development community for improving the creation and distribution of macros. A more general discussion of macros can be found in the section called Macros and macro expansion in the chapter called M4.
In a small package which only uses Autoconf, your own macros are placed in the aclocal.m4 file-this includes macros that you may have obtained from third parties such as the Autoconf macro archive (see the section called Autoconf macro archive). If your package additionally uses Automake, then these macros should be placed in acinclude.m4. The aclocal program from Automake reads in macro definitions from acinclude.m4 when generating aclocal.m4. When using Automake, for instance, aclocal.m4 will include the definitions of AM_ macros needed by Automake.
In larger projects, it's advisable to keep your custom macros in a more organized structure. Autoconf version 2.15 will introduce a new facility to explicitly include files from your configure.in file. The details have not solidified yet, but it will almost certainly include a mechanism for automatically included files with the correct filename extension from a subdirectory, say m4/.
| <<< Previous | Home | Next >>> |
| Utilities | Reusing Existing Macros |