Steps in the Autotools toolchain

This page is still very preliminary. If you have comments or corrections, please send them to GregNoel for integration rather than editing the page yourself.

GNU Autotools is a system that attempts to ease some of the difficult of project development, while enforcing the use of the GNU coding conventions (that is, it's part of the GNU virus). This page is a synopsis of what the tools do and how they fit together.

The toolchain consists of eight steps. For the most part, they are done in the order given below.

Nifty ASCII art is based on the diagrams in the Autobook.

1. autoscan and ifnames

The starting point is to determine just which configure tests should be done. The autoscan program looks at the program's sources and tries to determine if anything might be a portibility issue. If it finds anything, it adds a test for it in the output file, which is then used as a draft for the actual configuration macros.

user input files    optional input     process          output files
================    ==============     =======          ============

                    configure.ac - - - - -.
                                          V
                                      .--------,
{project sources} ------------------->|autoscan|------> configure.scan
                                      `--------'

2. autopoint

The autopoint program provides the appropriate configuration macros for the release of gettext being used within the project.

user input files    optional input     process          output files
================    ==============     =======          ============

                                     .---------,
configure.ac ----------------------->|autopoint|------> {macro files}
                                     `---------'

3. aclocal

The aclocal program consolidates the macros used by the configure script into a single file. The apparent intent is to allow a distribution that is independent of autotools and yet still be able to regenerate the configure script if need be.

user input files   optional input     process          output files
================   ==============     =======          ============

                    acinclude.m4 - - - - -.
                                          V
                                      .-------,
configure.ac ------------------------>|aclocal|
                 {user macro files} ->|       |------> aclocal.m4
                                      `-------'

4. autoheader

Processes the configure macros to determine the #define tokens generated.

user input files    optional input     process          output files
================    ==============     =======          ============

                    aclocal.m4 - - - - - - - .
                    (acconfig.h) - - - -.    |
                                        V    V
                                     .----------,
configure.ac ----------------------->|autoheader|----> config.h.in
                                     `----------'

5. automake and libtoolize

The automake program takes a simplified, stereotyped description and generates a parameterized file that can be processed by configure to produce a Makefile that does the actual build. If the build deals with libraries, libtoolize is invoked to generate equivalent parameterized files for manipulating libraries.

user input files   optional input   processes          output files
================   ==============   =========          ============

                                     .--------,
                                     |        | - - -> COPYING
                                     |        | - - -> INSTALL
                                     |        |------> install-sh
                                     |        |------> missing
                                     |automake|------> mkinstalldirs
configure.ac ----------------------->|        |
Makefile.am  ----------------------->|        |------> Makefile.in
                                     |        |------> stamp-h.in
                                 .---+        | - - -> config.guess
                                 |   |        | - - -> config.sub
                                 |   `------+-'
                                 |          | - - - -> config.guess
                                 |libtoolize| - - - -> config.sub
                                 |          |--------> ltmain.sh
                                 |          |--------> ltconfig
                                 `----------'

6. autoconf and autoreconf

The autoconf program converts the configure macros into a shell script.

The autoreconf program is intended to update the generated files if the toolchain has been updated. It simply runs autopoint, aclocal, autoheader, automake, libtoolize, and autoconf as appropriate.

user input files   optional input   processes          output files
================   ==============   =========          ============

                   aclocal.m4 - - - - - -.
                                         V
                                     .--------,
configure.ac ----------------------->|autoconf|------> configure
                                     `--------'

7. configure

The configure tests are run and the results are inserted in the various input files.

user input files   other input      processes          output files
================   ===========      =========          ============

                                     .---------,
                   config.site - - ->|         | -----> config.status
                  config.cache - - ->|configure| - - -> config.cache
                                     |         +-,
                                     `-+-------' |
                                       |         |----> config.h
                   config.h.in ------->|config-  |----> Makefile
                   Makefile.in ------->|  .status|----> stamp-h
                                       |         +--,
                                     .-+         |  |
                                     | `------+--'  |
                   ltmain.sh ------->|ltconfig|-------> libtool
                                     |        |     |
                                     `-+------'     |
                                       |config.guess|
                                       | config.sub |
                                       `------------

8. make and libtool

The program is built.

user input files   other input      processes          output files
================   ===========      =========          ============

                                   .--------,
                   Makefile ------>|        |
                   config.h ------>|  make  |--------> {project targets}
{project sources} ---------------->|        |
                                 .-+        +--,
                                 | `--------'  |
                                 |   libtool   |
                                 |   missing   |
                                 |  install-sh |
                                 |mkinstalldirs|
                                 `-------------'

GregNoel/AutotoolSteps (last edited 2008-03-12 02:47:09 by localhost)