![]() |
|
|---|---|
| Developer(s) | The GNU Project |
| Stable release | 2.65 / November 21, 2009 |
| Operating system | Cross-platform |
| Type | Programming tool |
| License | GNU GPL |
| Website | http://www.gnu.org/software/autoconf/ |
GNU Autoconf is a tool for producing configure scripts for C, C++, Fortran 77, Fortran, Erlang, Objective C software on Unix-like computer systems. Configure scripts inspect a user's computer system and configure the software package prior to it being installed. After running a series of automated tests, a configure script generates customised header files and a makefile from pre-written templates. These customised files adapt the software and its installation process to suit the user's system. Together with Automake and Libtool, Autoconf forms the GNU build system. It comprises several other tools, notably Autoheader.
Contents |
The developer specifies the desired behaviour of the configure script by writing a list of instructions in the GNU m4 language in a file called "configure.ac". A library of pre-defined m4 macros is available to describe common configure script instructions. Autoconf transforms the instructions in "configure.ac" into a portable configure script.
The GNU Autoconf manual suggests the following format for the configure.ac file:
Autoconf was begun in the summer of 1991 by David Mackenzie to support his work at the Free Software Foundation. In the subsequent years it grew to include enhancements from a variety of authors and became the most widely used build configuration system for writing portable free or open-source software.
Autoconf is similar to the Metaconfig package used by Perl. The imake system formerly used by the X Window System (up to X11R6.9) is closely related, but has a different philosophy.
The Autoconf approach to portability is to test for features, not for versions. For example, the native C compiler on SunOS 4 did not support ISO C. However, it is possible for the user or administrator to have installed an ISO C-compliant compiler. A pure version-based approach would not detect the presence of the ISO C compiler, but a feature-testing approach would be able to discover the ISO C compiler the user had installed. The rationale of this approach is to gain the following advantages:
Autoconf is an old and mature product that, when properly used, provides a very simple interface even in complex cross-compilation scenarios. However there is some criticism that states that Autoconf uses dated technologies, has a lot of legacy restrictions, and complicates simple scenarios unnecessarily for the author of configure.ac scripts. In particular, often cited weak points of Autoconf are:
Due to these limitations, some projects that used GNU Build System started to switch to other build systems:
|
|||||||||||||||||||
|
|