请输入您要查询的百科知识:

 

词条 Autoconf
释义

  1. Usage overview

  2. History

  3. Approach

  4. Criticism

  5. See also

  6. References

  7. External links

{{Distinguish|Autoconfig}}{{Infobox software
| name = Autoconf
| title =
| logo = Heckert GNU white.svg
| logo size = 100px
| screenshot =
| caption =
| collapsible =
| author = David Mackenzie
| developer = The GNU Project
| released = 1991
| discontinued =
| latest release version = 2.69
| latest release date = {{Start date and age|2012|04|24|df=yes/no}}
| latest preview version =
| latest preview date =
| programming language =
| operating system = Cross-platform
| platform =
| size =
| language =
| status =
| genre = Programming tool
| license = GNU GPL
| website = {{URL|https://www.gnu.org/software/autoconf/}}
}}

GNU Autoconf is a tool for producing configure scripts for building, installing and packaging software on computer systems where a Bourne shell is available.

Autoconf is agnostic about the programming languages used, but it is often used for projects using C, C++, Fortran, Fortran 77, Erlang or Objective-C.

A configure script configures a software package for installation on a particular target system. After running a series of tests on the target system, the configure script generates header files and a makefile from templates, thus customizing the software package for the target system. Together with Automake and Libtool, Autoconf forms the GNU Build System, which comprises several other tools, notably Autoheader.

Usage overview

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 system that will be doing the building need not have autoconf installed: autoconf is needed only to build the configure script, that is usually shipped with the software.

History

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.

Approach

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:

  • the configure script can get reasonable results on newer or unknown systems
  • it allows administrators to customize their machines and have the configure script take advantage of the customizations
  • there is no need to keep track of minute details of versions, patch numbers, etc., to figure out whether a particular feature is supported or not

Criticism

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:

  • General complexity of used architecture, most projects use multiple repetitions.[1][2]
  • Generated 'configure' is written in Bourne shell and thus Makefile generation is slow.
  • Some people think that 'configure' scripts generated by autoconf provide only manual-driven command-line interface without any standardization.[3] While it is true that some developers do not respect common conventions, such conventions do exist and are widely used.[3]
  • M4 is unusual and unknown to many developers. Developers will need to learn it to extend autoconf with non-standard checks.[4][5]
  • Weak backward and forward compatibility requires a wrapper script.[6]
  • Autoconf-generated scripts are usually large and rather complex. Although they produce extensive logging, debugging them can still be difficult.

Due to these limitations, several projects that used GNU Build System switched to different build systems, such as CMake and SCons.[1][7]

See also

{{Portal|Free and open-source software}}
  • CMake – Alternative build system
  • Meson Another build system
  • Configure script
  • GNU build system
  • pkg-config – Detecting package dependencies

References

1. ^{{cite web|title = Why the KDE project switched to CMake -- and how|first = Alexander|last = Neundorf|date = 2006-06-21|url = https://lwn.net/Articles/188693/}}
2. ^{{cite journal|url=https://queue.acm.org/detail.cfm?id=2349257|first=Poul-Henning|last=Kamp|date=2012-08-15|journal=ACM Queue|volume=10|issue=8|title=A Generation Lost in the Bazaar}}
3. ^{{cite web|title = GNU Coding Standards|url = https://www.gnu.org/prep/standards/standards.html}}
4. ^{{cite web|first = Andrew|last = McCall|title = Stop the autoconf insanity! Why we need a new build system|url = http://freshmeat.net/articles/stop-the-autoconf-insanity-why-we-need-a-new-build-system|date = 2003-06-21}}
5. ^{{cite web |title = Did you call them autocrap tools? |first = Poul-Henning |last = Kamp |date = 2010-04-20 |url = https://varnish-cache.org/docs/5.0/phk/autocrap.html |access-date = 2017-08-16 |archive-url = https://web.archive.org/web/20170911030645/http://varnish-cache.org/docs/5.0/phk/autocrap.html |archive-date = 2017-09-11 |dead-url = yes |df = }}
6. ^{{cite web|first = Thomas |last = Dickey |title = why i still use autoconf 2.13|url = http://invisible-island.net/autoconf/autoconf.html}}
7. ^{{Cite web |url=http://www.blender.org/development/release-logs/blender-233/build-systems/ |title=Archived copy |access-date=2009-06-10 |archive-url=https://web.archive.org/web/20081202083359/http://www.blender.org/development/release-logs/blender-233/build-systems/ |archive-date=2008-12-02 |dead-url=yes |df= }}

External links

  • {{official website}}
  • [https://www.gnu.org/software/ac-archive/ GNU Autoconf macro archive]
  • The Goat Book homepage (aka the Autobook)
  • [https://web.archive.org/web/20041013190022/http://www.openismus.com/documents/linux/automake/automake.shtml Using Automake and Autoconf with C++]
  • [https://web.archive.org/web/20060413182543/http://www.openismus.com/documents/linux/using_libraries/using_libraries.shtml Using C/C++ libraries with Automake and Autoconf].
  • Autotoolset home page
  • Autotools: A practitioner's guide to Autoconf, Automake and Libtool
  • [https://autotools.io/ Autotools Mythbuster]
{{GNU}}GNU Build System#GNU Autoconf

5 : Computer configuration|GNU Project software|Free computer libraries|Cross-platform free software|Build automation

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/9/21 17:47:51