autoconf: Making configure Scripts

1 
1 3 Making `configure' Scripts
1 ****************************
1 
1 The configuration scripts that Autoconf produces are by convention
1 called `configure'.  When run, `configure' creates several files,
1 replacing configuration parameters in them with appropriate values.
1 The files that `configure' creates are:
1 
1    - one or more `Makefile' files, usually one in each subdirectory of
1      the package (⇒Makefile Substitutions);
1 
1    - optionally, a C header file, the name of which is configurable,
1      containing `#define' directives (⇒Configuration Headers);
1 
1    - a shell script called `config.status' that, when run, recreates
1      the files listed above (⇒config.status Invocation);
1 
1    - an optional shell script normally called `config.cache' (created
1      when using `configure --config-cache') that saves the results of
1      running many of the tests (⇒Cache Files);
1 
1    - a file called `config.log' containing any messages produced by
1      compilers, to help debugging if `configure' makes a mistake.
1 
1    To create a `configure' script with Autoconf, you need to write an
1 Autoconf input file `configure.ac' (or `configure.in') and run
1 `autoconf' on it.  If you write your own feature tests to supplement
1 those that come with Autoconf, you might also write files called
1 `aclocal.m4' and `acsite.m4'.  If you use a C header file to contain
1 `#define' directives, you might also run `autoheader', and you can
1 distribute the generated file `config.h.in' with the package.
1 
1    Here is a diagram showing how the files that can be used in
1 configuration are produced.  Programs that are executed are suffixed by
1 `*'.  Optional files are enclosed in square brackets (`[]').
1 `autoconf' and `autoheader' also read the installed Autoconf macro
1 files (by reading `autoconf.m4').
1 
1 Files used in preparing a software package for distribution, when using
1 just Autoconf:
1      your source files --> [autoscan*] --> [configure.scan] --> configure.ac
1 
1      configure.ac --.
1                     |   .------> autoconf* -----> configure
1      [aclocal.m4] --+---+
1                     |   `-----> [autoheader*] --> [config.h.in]
1      [acsite.m4] ---'
1 
1      Makefile.in
1 
1 Additionally, if you use Automake, the following additional productions
1 come into play:
1 
1      [acinclude.m4] --.
1                       |
1      [local macros] --+--> aclocal* --> aclocal.m4
1                       |
1      configure.ac ----'
1 
1      configure.ac --.
1                     +--> automake* --> Makefile.in
1      Makefile.am ---'
1 
1 Files used in configuring a software package:
1                             .-------------> [config.cache]
1      configure* ------------+-------------> config.log
1                             |
1      [config.h.in] -.       v            .-> [config.h] -.
1                     +--> config.status* -+               +--> make*
1      Makefile.in ---'                    `-> Makefile ---'
1 

Menu