Next: , Previous: The GNU Build System, Up: Top

3 Making configure Scripts

The configuration scripts that Autoconf produces are by convention called configure. When run, configure creates several files, replacing configuration parameters in them with appropriate values. The files that configure creates are:

To create a configure script with Autoconf, you need to write an Autoconf input file (or and run autoconf on it. If you write your own feature tests to supplement those that come with Autoconf, you might also write files called aclocal.m4 and acsite.m4. If you use a C header file to contain #define directives, you might also run autoheader, and you can distribute the generated file with the package.

Here is a diagram showing how the files that can be used in configuration are produced. Programs that are executed are suffixed by ‘*’. Optional files are enclosed in square brackets (‘[]’). autoconf and autoheader also read the installed Autoconf macro files (by reading autoconf.m4).

Files used in preparing a software package for distribution, when using just Autoconf:

     your source files --> [autoscan*] --> [configure.scan] -->
                    |   .------> autoconf* -----> configure
     [aclocal.m4] --+---+
                    |   `-----> [autoheader*] --> []
     [acsite.m4] ---'

Additionally, if you use Automake, the following additional productions come into play:

     [acinclude.m4] --.
     [local macros] --+--> aclocal* --> aclocal.m4
                      | ----'
                    +--> automake* --> ---'

Files used in configuring a software package:

                            .-------------> [config.cache]
     configure* ------------+-------------> config.log
     [] -.       v            .-> [config.h] -.
                    +--> config.status* -+               +--> make* ---'                    `-> Makefile ---'