<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh">
	<id>https://arolstar52-zhtest.hf.space/index.php?action=history&amp;feed=atom&amp;title=Autoconf</id>
	<title>Autoconf - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://arolstar52-zhtest.hf.space/index.php?action=history&amp;feed=atom&amp;title=Autoconf"/>
	<link rel="alternate" type="text/html" href="https://arolstar52-zhtest.hf.space/index.php?title=Autoconf&amp;action=history"/>
	<updated>2026-06-29T07:54:29Z</updated>
	<subtitle>在这个wiki上该页的修订历史</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://arolstar52-zhtest.hf.space/index.php?title=Autoconf&amp;diff=593069&amp;oldid=prev</id>
		<title>imported&gt;AromaTake：​/* 工作原理 */ + /* 参见 */ 調整內部連結</title>
		<link rel="alternate" type="text/html" href="https://arolstar52-zhtest.hf.space/index.php?title=Autoconf&amp;diff=593069&amp;oldid=prev"/>
		<updated>2025-08-18T07:05:37Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;工作原理：​&lt;/span&gt; + &lt;span class=&quot;autocomment&quot;&gt;参见：​&lt;/span&gt; 調整內部連結&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{NoteTA|G1=IT|G2=FL}}&lt;br /&gt;
{{Infobox software&lt;br /&gt;
| name = Autoconf&lt;br /&gt;
| logo = Heckert GNU white.svg&lt;br /&gt;
| logo size = 100px&lt;br /&gt;
| developer = [[GNU]]&lt;br /&gt;
| operating system = [[跨平台]]&lt;br /&gt;
| genre = [[编程工具]]&lt;br /&gt;
| license = [[GPL]]&lt;br /&gt;
| website = http://www.gnu.org/software/autoconf/&lt;br /&gt;
}}&lt;br /&gt;
[[File:Autoconf-automake-process.svg|thumb|400px| autoconf和[[automake]]的工作流程图。请注意&amp;quot;configure.ac&amp;quot;在Autoconf早期版本中名为&amp;quot;configure.in&amp;quot; ]]&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;GNU Autoconf&amp;#039;&amp;#039;&amp;#039;是一个在[[Bourne shell]]下制作供编译、安装和打包软件的{{link-en|配置脚本|Configure script (computing)}}的工具&amp;lt;ref&amp;gt;{{cite web|title=Autoconf - GNU Project - Free Software Foundation (FSF)|url=http://www.gnu.org/software/autoconf/#TOCintroduction|publisher=GNU Project|accessdate=2010-12-16|archive-date=2010-12-23|archive-url=https://web.archive.org/web/20101223013817/http://www.gnu.org/software/autoconf/#TOCintroduction|dead-url=no}}&amp;lt;/ref&amp;gt;。Autoconf并不受程式语言限制，常用于[[C语言|C]]、[[C++]]、[[Erlang]]和[[Objective-C]]。配置脚本控制了一个软件包在特定系统上的安装。在进行一系列测试后，配置脚本从模板中生成[[makefile]]与[[头文件]]进而调整软件包，使之适应某一种系统。Autoconf与[[Automake]]、[[Libtool]]等软件组成了[[GNU构建系统]]&amp;lt;ref&amp;gt;{{cite web|title=The GNU Build System - Autoconf|url=http://www.gnu.org/software/autoconf/manual/html_node/The-GNU-Build-System.html#The-GNU-Build-System|publisher=GNU Project|accessdate=2010-12-16|archive-date=2010-12-25|archive-url=https://web.archive.org/web/20101225073720/http://www.gnu.org/software/autoconf/manual/html_node/The-GNU-Build-System.html#The-GNU-Build-System|dead-url=no}}&amp;lt;/ref&amp;gt;。Autoconf由{{link-en|戴维·麦肯思|David Mackenzie}}于1991年夏天编写用于支持他在[[自由软件基金会]]的编程工作&amp;lt;ref&amp;gt;{{cite web|author=David Mackenzie|title=Genesis - Autoconf|url=http://www.gnu.org/software/autoconf/manual/html_node/Genesis.html#Genesis|publisher=GNU Project|accessdate=2010-12-16|archive-date=2010-12-25|archive-url=https://web.archive.org/web/20101225075904/http://www.gnu.org/software/autoconf/manual/html_node/Genesis.html#Genesis|dead-url=no}}&amp;lt;/ref&amp;gt;。此后，Autoconf包含了多人编写的改进代码并成为了使用最广泛的自由编译配置软件。&amp;lt;ref&amp;gt;{{cite web|author=David Mackenzie|title=Leviticus - Autoconf|url=http://www.gnu.org/software/autoconf/manual/html_node/Leviticus.html#Leviticus|publisher=GNU Project|accessdate=2010-12-16|archive-date=2010-12-25|archive-url=https://web.archive.org/web/20101225075913/http://www.gnu.org/software/autoconf/manual/html_node/Leviticus.html#Leviticus|dead-url=no}}&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;{{cite web|author=David Mackenzie|title=Numbers - Autoconf|url=http://www.gnu.org/software/autoconf/manual/html_node/Numbers.html#Numbers|publisher=GNU Project|accessdate=2010-12-16|archive-date=2010-12-25|archive-url=https://web.archive.org/web/20101225075917/http://www.gnu.org/software/autoconf/manual/html_node/Numbers.html#Numbers|dead-url=no}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 使用概要 ==&lt;br /&gt;
软件开发者通过使用[[GNU m4]]语言在&amp;#039;&amp;#039;configure.ac&amp;#039;&amp;#039;中写出限定配置脚本行为的列表。Autoconf将&amp;#039;&amp;#039;configure.ac&amp;#039;&amp;#039;中的命令转化为对应特定平台的配置脚本。Autoconf本身并不具备编译能力，它仅仅用于产生通常附带在软件包中的配置脚本。&lt;br /&gt;
&lt;br /&gt;
=== configure.ac格式===&lt;br /&gt;
The GNU Autoconf手册建议configure.ac file使用如下格式：&lt;br /&gt;
; Autoconf requirements&lt;br /&gt;
: The AC_PREREQ（&amp;#039;&amp;#039;version&amp;#039;&amp;#039;）macro can be used to ensure that a recent enough version of the autoconf program is available to process the configure.ac file&lt;br /&gt;
; AC_INIT（&amp;#039;&amp;#039;package&amp;#039;&amp;#039;, &amp;#039;&amp;#039;version&amp;#039;&amp;#039;, &amp;#039;&amp;#039;bug-report-address&amp;#039;&amp;#039;）&lt;br /&gt;
: This macro is required in every configure.ac file.  It specifies the name and version of the software package for which to generate a configure script and the email address of the developer.&lt;br /&gt;
; information on the package&lt;br /&gt;
; checks for programs&lt;br /&gt;
; checks for libraries&lt;br /&gt;
; checks for header files&lt;br /&gt;
; checks for types&lt;br /&gt;
; checks for structures&lt;br /&gt;
; checks for compiler characteristics&lt;br /&gt;
; checks for library functions&lt;br /&gt;
; checks for system services&lt;br /&gt;
; AC_CONFIG_FILES（[file...]）&lt;br /&gt;
; AC_OUTPUT&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
An example file is as follows:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
AC_PREREQ（[2.63]）&lt;br /&gt;
AC_INIT（[hello], [1.0], [developer@example.com]）&lt;br /&gt;
&amp;lt;/source&amp;gt; --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==工作原理==&lt;br /&gt;
autoconf类似于perl使用的metaconfig包。先前[[X Window系统]]所使用的imake系统与autoconf是密切相关，但有不同的理念。&lt;br /&gt;
&lt;br /&gt;
autoconf通过检查特性而不是软件版本来确保可移植性。例如Sun OS 4的原生C编译器不支持ISO C，但是用户或管理员可以自行安装支持ISO C的编译器。基于软件特性的检查方法可以发现仅检查软件版本的方法检测不到的支持ISO C的编译器。因此配置脚本可以在未知的或者较新的系统中得到合理的结果，同样允许管理员按照他们的系统来配置脚本。&lt;br /&gt;
&lt;br /&gt;
==批评==&lt;br /&gt;
autoconf是一个古老和成熟的产品，如果使用得当，可以使用一个非常简单的接口进行复杂的交叉编译。但是有一些批评指出autoconf使用了过时的技术，因而遗留了很多限制。autoconf无法为[[Xcode]]与[[Visual Studio]]制作项目文件，其脚本通常大且复杂，因此增加了Debug的难度。Autoconf所使用的M4对于一些开发者来说是陌生的，因此他们需要专门学习&amp;lt;ref name=&amp;quot;stop-insanity&amp;quot;&amp;gt;{{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|accessdate = 2010-12-14|archive-date = 2010-12-27|archive-url = https://web.archive.org/web/20101227013518/http://freshmeat.net/articles/stop-the-autoconf-insanity-why-we-need-a-new-build-system|dead-url = no}}&amp;lt;/ref&amp;gt;。一些开发者并不遵循配置脚本的一些习惯约定&amp;lt;ref name=&amp;quot;gnu-coding&amp;quot;&amp;gt;{{cite web|title = GNU Coding Standards|url = http://www.gnu.org/prep/standards/standards.html|accessdate = 2010-12-14|archive-date = 2010-12-23|archive-url = https://web.archive.org/web/20101223010425/http://www.gnu.org/prep/standards/standards.html|dead-url = no}}&amp;lt;/ref&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
因此一些自由软件开发者开始使用其他软件代替autoconf，[[KDE]]于KDE 4起开始使用[[CMake]]&amp;lt;ref name=&amp;quot;kde&amp;quot;&amp;gt;{{cite web|title = Why the KDE project switched to CMake -- and how|first = Alexander|last = Neundorf|date = 2006-06-21|url = http://lwn.net/Articles/188693/|accessdate = 2010-12-14|archive-date = 2011-05-07|archive-url = https://web.archive.org/web/20110507043418/http://lwn.net/Articles/188693/|dead-url = no}}&amp;lt;/ref&amp;gt;，[[Scribus]]同样开始使用CMake&amp;lt;ref name=&amp;quot;kde&amp;quot;/&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
==参见==&lt;br /&gt;
{{Portal|Free software}}&lt;br /&gt;
* [[CMake]] &lt;br /&gt;
* [[GNU构建系统]]&lt;br /&gt;
* [[pkg-config]]&lt;br /&gt;
&lt;br /&gt;
==脚注==&lt;br /&gt;
{{Reflist}}&lt;br /&gt;
&lt;br /&gt;
==外部链接==&lt;br /&gt;
*[http://www.gnu.org/software/autoconf/ GNU Autoconf home page]{{Wayback|url=http://www.gnu.org/software/autoconf/ |date=20101223013817 }}&lt;br /&gt;
*[http://www.gnu.org/software/ac-archive/ GNU Autoconf macro archive]{{Wayback|url=http://www.gnu.org/software/ac-archive/ |date=20050204094917 }}&lt;br /&gt;
*[http://sources.redhat.com/autobook/ &amp;#039;&amp;#039;The Goat Book&amp;#039;&amp;#039; homepage (aka the Autobook)]{{Wayback|url=http://sources.redhat.com/autobook/ |date=20101220095404 }}&lt;br /&gt;
*Murray Cumming（of [[gtkmm]] fame）produced these succinct Autotool info pages:[https://web.archive.org/web/20060110134958/http://www.openismus.com/documents/linux/automake/automake.shtml *one] [https://web.archive.org/web/20130514201100/http://www.openismus.com/documents/linux/using_libraries/using_libraries.shtml *two].&lt;br /&gt;
*[http://autotoolset.sourceforge.net/ Autotoolset home page]{{Wayback|url=http://autotoolset.sourceforge.net/ |date=20030416234012 }}&lt;br /&gt;
*https://web.archive.org/web/20140816060326/http://www.freesoftwaremagazine.com/books/autotools_a_guide_to_autoconf_automake_libtool&lt;br /&gt;
&lt;br /&gt;
===教程===&lt;br /&gt;
* https://web.archive.org/web/20100627142047/http://mi.eng.cam.ac.uk/~er258/code/autoconf/&lt;br /&gt;
* [https://web.archive.org/web/20060321205403/http://www.amath.washington.edu/~lf/tutorials/autoconf/ Learning Autoconf and Automake]&amp;quot; by Eleftherios Gkioulekas&lt;br /&gt;
*[http://autotoolset.sourceforge.net/tutorial.html &amp;#039;&amp;#039;Learning the GNU development tools&amp;#039;&amp;#039; @sourceforge]{{Wayback|url=http://autotoolset.sourceforge.net/tutorial.html |date=20101201015903 }}&lt;br /&gt;
*[http://www.lrde.epita.fr/~adl/autotools.html Autotools Tutorial]{{Wayback|url=http://www.lrde.epita.fr/~adl/autotools.html |date=20101227173311 }} by Alexandre Duret-Lutz introduces Autoconf, [[Automake]], [[Libtool]],和[[Gettext]]&lt;br /&gt;
*[http://www.seul.org/docs/autotut/ Using GNU auto{conf,make,header}]{{Wayback|url=http://www.seul.org/docs/autotut/ |date=20101225231302 }} by Felipe Bergo&lt;br /&gt;
&lt;br /&gt;
{{GNU}}&lt;br /&gt;
&lt;br /&gt;
[[Category:GNU计划软件]]&lt;br /&gt;
[[Category:自由發展元件與函式庫]]&lt;br /&gt;
[[Category:自由跨平台軟體]]&lt;br /&gt;
[[Category:自动化构建]]&lt;br /&gt;
[[Category:配置腳本]]&lt;br /&gt;
&lt;br /&gt;
[[de:GNU Build System#GNU Autoconf]]&lt;/div&gt;</summary>
		<author><name>imported&gt;AromaTake</name></author>
	</entry>
</feed>