GNU Autotools

The GNU Autotools, also known as the GNU Build System, is a suite of programming tools designed to assist in making source code packages portable to many Unix-like systems.
It can be difficult to make a software program portable: the C compiler differs from system to system; certain library functions are missing on some systems; header files may have different names. One way to handle this is to write conditional code, with code blocks selected by means of preprocessor directives (codice_1); but because of the wide variety of build environments this approach quickly becomes unmanageable. Autotools is designed to address this problem more manageably.
Autotools is part of the GNU toolchain and is widely used in many free software and open source packages. Its component tools are free software, licensed under the GNU General Public License with special license exceptions permitting its use with proprietary software.
The GNU Build System makes it possible to build many programs using a two-step process: "configure" followed by "make".
Components.
Autotools consists of the GNU utility programs Autoconf, Automake, and Libtool. Other related tools frequently used alongside it include GNU's make program, GNU gettext, pkg-config, and the GNU Compiler Collection, also called GCC.
GNU Autoconf.
Autoconf generates a codice_2 script based on the contents of a codice_3 file, which characterizes a particular body of source code. The codice_2 script, when run, scans the build environment and generates a subordinate codice_5 script which, in turn, converts other input files and most commonly codice_6 into output files (codice_7), which are appropriate for that build environment. Finally, the codice_8 program uses codice_7 to generate executable programs from source code.
The complexity of Autotools reflects the variety of circumstances under which a body of source code may be built.
To process files, autoconf uses the GNU implementation of the m4 macro system.
Autoconf comes with several auxiliary programs such as codice_20, which is used to help manage C header files; codice_21, which can create an initial input file for Autoconf; and codice_22, which can list C pre-processor identifiers used in the program.
GNU Automake.
Automake helps to create portable codice_7s, which are in turn processed with the make utility. It takes its input as codice_24, and turns it into codice_6, which is used by the configure script to generate the file codice_7 output. It also performs automatic dependency tracking; every time a source file is compiled, the list of dependencies (e.g., C header files) is recorded. Later, any time make is run and a dependency appears to have changed, the dependent files will be rebuilt.
GNU Libtool.
Libtool helps manage the creation of static and dynamic libraries on various Unix-like operating systems. Libtool accomplishes this by abstracting the library-creation process, hiding differences between various systems (e.g. Linux systems vs. Solaris).
Usage.
Autotools assists software developers to write cross-platform software and make it available to a much wider user community, including in its source code form to those users who wish to build the software themselves. In most cases users simply run the supplied codice_2 script (which has no dependencies other than the presence of a Bourne-compatible shell), and then a codice_8 program. They do not need to have the Autotools themselves installed on the computer.
It can be used both for building native programs on the build machine and also for cross-compiling to other architectures.
Cross-compiling software to run on a Windows host from a Linux or other Unix-like build system is also possible, using MinGW, however native compilation is often desirable on operating systems (such as the Microsoft Windows family of systems) that cannot run Bourne shell scripts on their own. This makes building such software on the Windows operating system a bit harder than on a Unix-like system which provides the Bourne shell as a standard component. One can install the Cygwin or MSYS system on top of Windows to provide a Unix-like compatibility layer, though, allowing configure scripts to run. Cygwin also provides the GNU Compiler Collection, GNU make, and other software that provides a nearly complete Unix-like system within Windows; MSYS also provides GNU make and other tools designed to work with the MinGW version of GCC.
Although the developer is expected to provide a configure script for the end-user, occasionally the user may wish to re-generate the configure script itself. Such working might be necessary if the user wishes to amend the source code itself. Such users would need to have Autotools installed, and to use components such as its "autoreconf".
The autoconf-generated codice_2 can be slow because it executes programs such as a C compiler many times in order to test whether various libraries, header files, and language features are present. This particularly affects Cygwin, which, due to its lack of a native fork system call, may execute configure scripts considerably slower than Linux.
Criticism.
In his column for "ACM Queue", FreeBSD developer Poul-Henning Kamp criticized the GNU Build System:
Kamp sketches the history of the build system in the portability problems inherent in the multitude of 1980s Unix variants, and bemoans the need for such build systems to exist:
Responses to Criticism.
Although critics of the Autotools frequently advocate for alternatives that provide greater simplicity to their users, some have argued that this is not necessarily a good thing. John Calcote, author of the "Autotools, 2nd Edition: A Practitioner's Guide to GNU Autoconf, Automake, and Libtool", opined: