AUTOCONF explained

Autoconf

Autoconf is a nice set of tools which should in principle help in compiling the software by finding appropriate libraries. In many years of usage of autoconf tools I can only say that I never quite saw its appeal. Not because of autotools itself, but because there is always one piece of code that gets hardwired into the configuration files, as it proves to hard to manage using the provided autotools infrastructure. Having said that, other comparable tools (cmake, rpm, etc.) suffer from the same deficiencies, ie. it is very hard to specify configuration of your software environment (down to the last detail) in a quick and self-sustained manner which doesn't fail.

Enough lamentation. Here is how autoconf (or autotools) works.

Input files

configure.ac

Typically, configure.ac (or sometimes, configure.in) is the major setup file, where checks for dependencies are listed. configure.ac relies on set of macros (e.g. AC_LOCAL_MACRO_DIR) to set variables for makefiles.

m4 macros

A directory m4 contains definitions of macros used by configure.ac. Their language is m4, and their aim is to produce shell scripts that verify presence and set enviromental variables (LIBS, CFLAGS) of external dependencies. Macros are sometimes shipped with the code, or the creator of the bundle must provide their own.

Makefile.am

Bare sub-directory scoped makefiles relying on variables extracted by macros of configure.ac.

Binaries

aclocal

Convert local m4 files and data from configure.ac to aclocal.m4. Not necessarily performed. Since most of the definitions are in the m4 directory, it is best to run it:

#>aclocal -I m4

autoconf

Convert configure.ac to configure script using aclocal.m4 to find dependencies.

automake

Convert Makefile.am to Makefile.in using configure.ac

configure

Convert Makefile.in to Makefile (with output files like config.cache, config.log, config.status, config.h.in)

links

social