GNU Autotools

From Wikipedia, the free encyclopedia
(Redirected from Autotools)

Template:Short description

Page Module:Infobox/styles.css has no content.

GNU Autotools
[[Programmer|Original authorTemplate:Pluralize from text]]Community
[[Programmer|DeveloperTemplate:Pluralize from text]]Free Software Foundation
Template:Infobox software/simple
Written inM4 (computer language), C
EnginePage Template:Plainlist/styles.css has no content.Template:EditAtWikidata
Operating systemCross-platform
PlatformGNU and others
Included withGNU Operating System
Available inEnglish
LicenseGNU General Public License version 2
Websitewww.gnu.org/software/software.html
RepositoryPage Template:Plainlist/styles.css has no content.

Script error: No such module "Check for conflicting parameters".

The GNU Autotools, also known as the GNU Build System, is a suite of build automation tools designed to support building source code and packaging the resulting binaries. It supports building a codebase for multiple target systems without customizing or modifying the code. It is available on many Linux distributions and Unix-like environments.

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[1][2] permitting its use with proprietary software.

Motivation

Script error: No such module "Labelled list hatnote". It can be difficult to make a software program portable. Compilers differ from system to system. Certain library functions are missing on some systems. Compiler files (such as C headers) may have different names. Shared libraries may be compiled and installed in different ways. One way to handle platform differences is to write conditionally compiled code (i.e. via #ifdef), but because of the wide variety of build environments, this approach quickly becomes unmanageable. Autotools is designed to address this problem more manageably.

Components

Autotools consists of the GNU utilities Autoconf, Automake, and Libtool.[3] Other related tools include GNU make, GNU gettext, pkg-config, and the GNU Compiler Collection (GCC).

Usage

Flow diagram of Autotools tools.

Autotools assists with sharing cross-platform software with a relatively broad user community. It facilitates sharing the source code by providing relatively robust cross-platform build support so that consumers can build the software themselves. Generally, the source code is distributed with a script, named configure, that has no dependencies other than a Bourne-compatible shell. Autotools need not be available. The consumer runs configure which generates various files including a Makefile which the consumer uses by running make.[4][5]

Autotools can be used both for building native programs on the build machine and also for cross-compiling to other architectures.[6]

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.

A consumer can re-generate the configure script which might be necessary if they amend the source code. In this case, they need to have Autotools installed.

The autoconf-generated configure script can be slow because it executes programs such as a C compiler multiple times 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 on Linux.[7]

Criticism

In his column for ACM Queue, FreeBSD developer Poul-Henning Kamp criticized the GNU Build System:[8]

Template:Quote

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:

Template:Quote

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[9] of the Autotools, 2nd Edition: A Practitioner's Guide to GNU Autoconf, Automake, and Libtool, opined:[10]

Template:Quote

See also

Lua error in mw.title.lua at line 404: bad argument #2 to 'title.new' (unrecognized namespace name 'Portal').

References

Page Template:Reflist/styles.css has no content.

  1. ^ Page Module:Citation/CS1/styles.css has no content."Savannah Git Hosting - autoconf.git/blob - COPYING.EXCEPTION". Git.savannah.gnu.org. Archived from the original on 2011-07-21. Retrieved 2016-04-01.
  2. ^ Page Module:Citation/CS1/styles.css has no content."libtool.git - GNU Libtool". Git.savannah.gnu.org. 2005-01-08. Retrieved 2016-04-01.
  3. ^ Page Module:Citation/CS1/styles.css has no content."Learning the GNU development tools". Autotoolset.sourceforge.net. Retrieved 2016-04-01.
  4. ^ Page Module:Citation/CS1/styles.css has no content."automake: GNU Build System". Gnu.org. 2014-12-31. Retrieved 2016-04-01.
  5. ^ Page Module:Citation/CS1/styles.css has no content."The GNU configure and build system - Introduction". Airs.com. 1998-07-01. Retrieved 2016-04-01.
  6. ^ Page Module:Citation/CS1/styles.css has no content."Cross Compilation with GNU Autotools". Archived from the original on October 13, 2008. Retrieved September 24, 2008.
  7. ^ Page Module:Citation/CS1/styles.css has no content."Robert Ögren - Slow shell script execution on Cygwin". Cygwin.com. Retrieved 2016-04-01.
  8. ^ Page Module:Citation/CS1/styles.css has no content.Kamp, Poul-Henning (2012). "A Generation Lost in the Bazaar". ACM Queue. 10 (8): 20–23. doi:10.1145/2346916.2349257. S2CID 11656592.
  9. ^ Page Module:Citation/CS1/styles.css has no content."Autotools, 2nd Edition by John Calcote | Penguin Random House Canada". Retrieved January 22, 2021.
  10. ^ Page Module:Citation/CS1/styles.css has no content."Re: Future plans for Autotools". Retrieved January 22, 2021.