Autotools

Wikipedia,自由的百科全书

电子天平 (http://www.tianping.net)电子分析天平and (http://www.tianping.net)电子秤 (http://www.zhonghaihc.com)电子精密天平 (http://www.zhonghaihc.com) The structure is different sensors, electronic scales to complex, which also caused the accuracy of electronic balance is higher than that of the electronic scale. In general the accuracy of the electronic scale of 1 / 3000, which means the entire process of 3000 g, can achieve accuracy of 1 g; some of the manufacturers do not regulate the whole of 3000 g, show tune-precision 0.1 g, but did not dare to write on the certificate is 0.1 g, Or write 1 g, Meiqimingyue "balance", the poor stability of such a product, we do not have. In addition, low-cost electronic scale, lighter, cheaper, and to re-balance the weight of some more durable. 网通传奇私服 (http://www.asfman.cn) 265啦上网导航 (http://www.265.la) @c -*-texinfo-*- @ignore @c %**start of menu

  • Introduction::
  • History::

@c %**end of menu @end ignore

@node Introduction @chapter 介绍 优秀网站介绍 xajhlqc 剪板机 (http://www.ldch.cn/) 卷板机 (http://www.ldch.cn/) 弯管机 (http://www.ldch.cn/) 折边机 (http://www.ldch.cn/) 铣边机 (http://www.ldch.cn/) 无线上网卡 (http://www.wangka99.com/) 北京印刷 (http://www.daliprinting.com/) 四合院 (http://shy.xinbaisheng.com/) 北京四合院 (http://shy.xinbaisheng.com/) 翻译公司 (http://www.pulunfanyi.com/) 线号机 (http://www.biovin.com.cn/) 液晶监视器 (http://www.fm9001.com/chuangxin/) Autoconf, Automake 和 Libtool 是一类让你的软件变得可移植并且易于编译的工具, 这种编译的过程往往是发生在其他的系统上面的。在现代的软件工程中,软件的可移植性 性和高效的编译是非常重要的。如果一个软件项目只能在一种平台上运行,那么这个软件 就不大可能被开发。硬件的限制会改变平台的选择,新的因为系统不同平台而产生的用户 将会出现,你的卖主也许会由于新版的操作系统而对你的软件做不兼容的修改。另外, 那些使得编译软件更容易和更少错误的工具也是很有价值的。

Autoconf, Automake and Libtool are packages for making your software more portable and to simplify building it---usually on someone else's system. Software portability and effective build systems are crucial aspects of modern software engineering practice. It is unlikely that a software project would be started today with the expectation that the software would run on only one platform. Hardware constraints may change the choice of platform, new customers with different kinds of systems may emerge or your vendor might introduce incompatible changes in newer versions of their operating system. In addition, tools that make building software easier and less error prone are valuable.

Autoconf是一个使得你的软件更容易移植的工具。它可以在软件编译之前通过 一些测试来发现系统的特性,从而你的源码可以得到修改从而适合该系统。

奥运获得入场券公司 翻译公司 (http://www.zstrans.com/) 北京翻译公司 (http://www.zstrans.com/) 英语翻译 (http://www.zstrans.com/) 神墓 (http://www.17dushu8.com.cn/HTML/63/index.htm) 神墓最新章节 (http://www.17dushu8.com.cn/HTML/63/index.htm) 神墓小说 (http://www.17dushu8.com.cn/HTML/63/index.htm) 翻译公司 (http://www.pulunfanyi.com/) 坏蛋是怎样炼成的全文阅读 (http://www.17dushu8.com.cn/HTML/66/index.htm) 坏蛋是怎样炼成的 (http://www.17dushu8.com.cn/HTML/66/index.htm) 小说 (http://www.17dushu8.com.cn/) 翻译公司 (http://www.pulunfanyi.com/) 分水器 (http://www.fm9001.com/fen/) 包装盒 (http://www.luyixuelai.net/) 塑料袋 (http://www.luyixuelai.net/) 纸袋 (http://www.luyixuelai.net/)


超声波探伤仪 (http://www.bjsdsf.cn/index.asp) 涂层测厚仪 (http://www.bjsdsf.cn/index.asp) 粗糙度仪 (http://www.bjsdsf.cn/index.asp) 超声波测厚仪 (http://www.bjsdsf.cn/index.asp) 红外线测温仪 (http://www.bjsdsf.cn/index.asp) 涂层测厚仪 (http://www.bjsdsf.cn/productlist69.html) 粗糙度仪 (http://www.bjsdsf.cn/productlist71.html) 超声波测厚仪 (http://www.bjsdsf.cn/productlist70.html) 红外线测温仪 (http://www.bjsdsf.cn/productlist66.html) 超声波探伤仪 (http://www.bjsdsf.cn/productlist73.html) 分水器 (http://www.fm9001.com/fen/) Autoconf is a tool that makes your packages more portable by performing tests to discover system characteristics before the package is compiled. Your source code can then adapt to these differences.

Automake是一个工具用来产生@file{Makefile}——描述了编译什么——它遵循了一些标准。 Automake充分的简化了软件包的组织结构的描述过程,并且做了一些诸如依赖关系跟踪的工作。

Automake is a tool for generating @file{Makefile}s---descriptions of what to build---that conform to a number of standards. Automake substantially simplifies the process of describing the organization of a package and performs additional functions such as dependency tracking between source files.

Libtool是一个基于命令行的接口,通过该接口可以和编译器和链接器打交道, 从而可以很容易的可移植性的编译出静态或者共享库,无论它在什么平台下面运行。

Libtool is a command line interface to the compiler and linker that makes it easy to portably generate static and shared libraries, regardless of the platform it is running on.

@menu

  • What this book is::
  • What the book is not::
  • Who should read this book::
  • How this book is organized::

@end menu

@node What this book is @section What this book is

这份文档是作为一个Autoconf, Automake和Libtool的教程,这三个工具往往被认为 是一个工具集。@sc{gnu}手册里面每个工具都有详尽的文档。但是到现在为止,还 没有一份文档来告诉人们怎么让这三种工具@emph{一起}工作。

This book is a tutorial for Autoconf, Automake and Libtool, hereafter referred to as the COLLECTIVE. The @sc{gnu} manuals that accompany each tools adequately document each tool in isolation. Until now, there has not been a guide that has described how these tools work @emph{together}.

尽管这些工具已经发展了好多年,设计的结果也已经被懂得这些关联问题的人明白的理解, 但是关于为什么和怎么样使用这些工具的文档还几乎没有。举个例子,也许有人会想不明白 为什么Autoconf利用类似shell的结构:

As these tools have evolved over the years, design decisions have been made by contributors who clearly understand the associated problems, but little documentation exists that captures why things are the way they are. By way of example, one might wonder why some Autoconf macros use shell constructs like:

@smallexample if test "x$var" = xbar; then

 echo yes 1>&5

fi @end smallexample

而不是使用更简单的:

instead of the simpler:

奥运不能正常营业公司 不干胶印刷 (http://www.daliprinting.com/buganjiao.asp) 手提袋印刷 (http://www.daliprinting.com/shoutidai.asp) 画册印刷 (http://www.daliprinting.com/huace.asp) 伸缩门 (http://www.365ufo.com/) 伸缩门 (http://www.fm3000.com/ddssm.htm) 伸缩门 (http://www.bjlanbo.com/default.asp) 伸缩门 (http://www.fm3m.com) 伸缩门 (http://www.ufo114.com/web/lbmc1/c24843/w10119045.asp) 伸缩门 (http://www.xinlanbo.com/c15677/c15744/default.asp) 伸缩门 (http://www.fm3m.com/web/lbmc2/c24897/w10119257.asp) 伸缩门 (http://www.doorbj.com/c17353/w64506.asp) 伸缩门 (http://www.bjlanbo.com/c28651/default.asp) 伸缩门 (http://www.lengate.com/products/folding_gate.html) 伸缩门 (http://www.hwtl.com/c15781/c15832/default.asp)


卷帘门 (http://www.hwtl.com/c15781/c15827/default.asp) 卷帘门 (http://www.ufo114.com/) 卷帘门 (http://www.fm3000.com/jlm.htm) 卷帘门 (http://www.doorbj.com/c17353/w64500.asp) 车库门 (http://www.xinlanbo.com/c15677/c15752/default.asp) 车库门 (http://www.ufo114.com/web/lbmc1/c24843/w10119036.asp) 旋转门 (http://www.fm3000.com/zdm.htm) 旋转门 (http://www.bjlanbo.com/c6344/default.asp) 旋转门 (http://www.ufo114.com/web/lbmc1/c24843/w10119043.asp) 旋转门 (http://www.hwtl.com/c15781/c15825/default.asp) 自动门 (http://www.ufo114.com/) 卷帘门 (http://www.xinlanbo.com/c15677/c15748/default.asp) 卷帘门 (http://www.lengate.com/products/roller3.html) 卷帘门 (http://www.fm3m.com/web/lbmc2/c24897/w10119247.asp) 卷帘门 (http://www.bjlanbo.com/c700.asp)

自动门 (http://www.xinlanbo.com/) 自动门 (http://www.fm3000.com/zdm.htm) 车库门 (http://www.365ufo.com/c24977/w10121169.asp) 车库门 (http://www.hwtl.com/c15781/c15834/default.asp) 车库门 (http://www.doorbj.com/) 车库门 (http://www.fm3m.com/) 自动门 (http://www.lengate.com/) 电动门 (http://www.hwtl.com/c15781/c15832/default.asp) 车库门 (http://www.bjlanbo.com/) 车库门 (http://www.doorbj.com/c17353/w64504.asp) 车库门 (http://www.fm3000.com/ckm.htm) @smallexample if [ $var = bar ]; then

 echo yes 1>&5

fi @end smallexample

更多的类似的原因可以在本书中找到。

Much of this reasoning is recorded in this book.

@node What the book is not @section What the book is not

这份文档不是Autoconf,Automake或者Libtool的权威性的文档。 譬如你无法在这份文档里面找到关于Autoconf的所有的预定义的宏。 相反,这份文档将会尝试让你理解你遇到的任意宏,以及影响你怎样 做到软件的可移植性和软件包的编译。@sc{gnu}手册里面的各个工具 将被作为一个参考。

This book is not a definitive reference to Autoconf, Automake or Libtool. Attempting to do so would fill this book with information that is doomed to obsolescence. For instance, you will not find a description of every predefined macro provided by Autoconf. Instead, the book will attempt to help you understand any macro you encounter and, instead, influence how you approach software portability and package building. The @sc{gnu} manual for each tool should be consulted as a reference.

这份文档将会简短的介绍相关概念。你会找到关于如何写@file{Makefile} 和Bourne shell脚本,但是你应该查找其他的参考资料来熟悉它们。

This book briefly introduces pertinent concepts, but does not attempt to teach them comprehensively. You will find an introduction to writing @file{Makefile}s and Bourne shell scripts, but you should consult other references to become familiar with these broader topics.

@node Who should read this book @section Who should read this book

对于软件开发者,系统管理员和技术经理而言,揭开工具的神秘面纱是一件很有趣的事情。

Revealing the mystery around the COLLECTIVE is likely to raise the interest of a wide audience of software developers, system administrators and technical managers.

软开发者,特别是那些和自由软件项目相关的人会发现懂得如何使用这些工具是很有价值的。 这些工具集在自由软件社区变得越来越受欢迎。即使是在家里开发软件的人也可以从中收到 同样的好处。

Software developers, especially those involved with free software projects, will find it valuable to understand how to use these tools. The COLLECTIVE are enjoying growing popularity in the free software community. Developers of in-house projects can reap the same benefits by using these tools.

系统管理员也可以通过对这些知识有所了解而得到好处——一个系统管理员的 常见的任务就是编译安装软件,而这些软件往往是在这些工具的框架下面构建的。 有时候,一个特性的测试会得到一个不对的结果,从而导致编译错误或者错误的程序。 一些hack工作往往足够使得软件可以编译,但是知道正确的方法来修复这个问题 可以帮助软件包管理者。

System administrators can benefit from a working knowledge of these tools -- a common task for system administrators is to compile and install packages which commonly use the COLLECTIVE framework. Occasionally, a feature test may produce a false result, leading to a compilation error or a misbehaving program. Some hacking is usually sufficient to get the package to compile, but knowing the correct way to fix the problem can assist the package maintainer.

最后,技术经理也许可以发现这些讨论里面保护了软件可移植性的复杂本质 以及编译一个大的项目的过程。

Finally, technical managers may find the discussion to be an insight into the complex nature of software portability and the process of building a large project.

@node How this book is organized @section How this book is organized

象任何好的教程一样,这份文档从解释简单的概念和和编译这些基本的代码开始 慢慢进入高级的话题。

Like any good tutorial, this book starts with an explanation of simple concepts and builds on these fundamentals to progress to advanced topics.

第一部分描写了这些工具发展的历史以及为什么它们还存在的原因。

Part I of the book provides a history of the development of these tools and why they exist.

第二部分包含了这份文档的大部分内容,开始部分介绍了@file{Makefile} 和关于配置的基本概念。接下去的章节介绍了各个工具以及怎样在不同规模的 项目中使用这些工具使得它们保持移植。用C和C++写的程序如果写的不够小心, 就会变得无法移植。14,15章分别对怎样用C和C++写可以移植的程序做出了指导。

Part II contains most of the book's content, starting with an introduction to concepts such as @file{Makefile}s and configuration triplets. Later chapters introduce each tool and how to manage projects of varying sizes using the tools in concert. Programs written in C and C++ can be non-portable if written carelessly. Chapters 14 and 15 offer guidelines for writing portable programs in C and C++, respectively.

第三部分的内容你不大可能在其他文档里面找到。这些内容基于丰富的使用这些工具的经验。 内容包括一些高级的,仍旧至关重要的理念,譬如@command{m4}宏处理器以及怎样写可移植 的Bourne shell脚本。23章讲述了怎样把现有的软件包导入到我们的工具框架内,这也许是 很多程序员感兴趣的。其中一个最神秘的使用这些工具集的方面就是在交叉编译方面, 我们将在第25章揭开它的神秘面纱。

Part III provides information that you are unlikely to find in any other documentation, that is based on extensive experience with the tools. It embodies chapters that treat some advanced, yet essential, concepts such as the @command{m4} macro processor and how to write portable Bourne shell scripts. Chapter 23 outlines how to migrate an existing package to the COLLECTIVE framework and will be of interest to many developers. One of the most mystifying aspects of using the COLLECTIVE for building packages in a cross-compilation environment. This is de-mystified in Chapter 25.

@node History @chapter History

在这一章,我们对本文档里面描述工具的历史做一个简短的回顾。你想用这些 工具可以不了解这些历史。但是这些工具被如何开发的历史解释了为什么这些 工具在今天是这样的。在象这样的一本书里面,告诉读者整个事件的原委,对 原作者们的荣誉和写这些工具灵感之源都是公正的,同时也解释了为什么他们 会写这些工具。

In this chapter we provide a brief history of the tools described in this book. You don't need to know this history in order to use the tools. However, the history of how the tools developed over time helps explain why the tools act the way that they do today. Also, in a book like this, it's only fair for us to credit the original authors and sources of inspiration, and to explain what they did.

@menu

  • Unix Diversity::
  • First Configure Programs::
  • Configure Development::
  • Automake Development::
  • Libtool Development::
  • Microsoft Windows Development::

@end menu

@node Unix Diversity @section The Diversity of Unix Systems

对于要在本文档要讨论的工具中,最先被开发的是Autoconf。它的开发是由于 Unix的历史决定的。

Of the programs discussed in this book, the first to be developed was Autoconf. Its development was determined by the history of the Unix operating system.

第一个版本的Unix是1969年由当时在Bell实验室的Dennis Ritchie和Ken Thompson 开发的。在20世纪70年代,Bell实验室未被允许商业化销售Unix,但是确实以相对 较低的价格在各个大学发布。在Berkeley的California大学在Unix源码添加了加强 Unix的代码;其结果就是大家后来知道的@acronym{BSD}系列的Unix。

The first version of Unix was written by Dennis Ritchie and Ken Thompson at Bell Labs in 1969. During the 1970s, Bell Labs was not permitted to sell Unix commercially, but did distribute Unix to universities at relatively low cost. The University of California at Berkeley added their own improvements to the Unix sources; the result was known as the @acronym{BSD} version of Unix.

在20世纪80年代,@acronym{AT&T}同意商业化销售Unix。第一个@acronym{AT&T}版本 就是System III。

In the early 1980s, @acronym{AT&T} signed an agreement permitting them to sell Unix commercially. The first @acronym{AT&T} version of Unix was known as System III.

当20世纪80年代Unix流行的时候,一些其他的公司修改了Unix的代码创建了 他们的Unix变种。其中包括Sun Microsystems的SunOS, Digital Equipment Corporation的Ultrix以及Hewlett Packard的@sc{hp-ux}。

As the popularity of Unix increased during the 1980s, several other companies modified the Unix sources to create their own variants. Examples include SunOS from Sun Microsystems, Ultrix from Digital Equipment Corporation, and @sc{hp-ux} from Hewlett Packard.

尽管所有的Unix变种都是基本相似的,他们之间还是有各种差别。他们的头文件 有些轻微的不同,系统库函数也有轻微不同,更显著的不同在譬如终端处理和 作业控制方面。

Although all of the Unix variants were fundamentally similar, there were various differences between them. They had slightly different sets of header files and slightly different lists of functions in the system libraries, as well as more significant differences in areas such as terminal handling and job control.

@sc{posix}标准的出现在一定程度上消除了这些差别。然而,在某些方面@sc{posix} 引进了新的特性导致了更多的差异。同时,不同的系统在不同的时间采用了 @sc{posix}标准,导致了更多的不一致。

The emerging @sc{posix} standards helped to eliminate some of these differences. However, in some areas @sc{posix} introduced new features, leading to more variants. Also, different systems adopted the @sc{posix} standard at different times, leading to further disparities.

所有的这些差异使得用源码发布的程序遇到了麻烦。甚至一个简明的函数@code{memcpy} 也不是到处有效的;@acronym{BSD}系统库提供了类似功能的@code{bcopy}来替代该函数, 但是参数的顺序和它相反。

All of these variations caused problems for programs distributed as source code. Even a function as straightforward as @code{memcpy} was not available everywhere; the @acronym{BSD} system library provided the similar function @code{bcopy} instead, but the order of arguments was reversed.

想让他们的程序在不同的Unix上运行的作者不得不熟悉这些Unix的各种差别。 而且他们不得不担心当版本变化的时候这些Unix的差别的变化,即使当这些变化最后 都聚合到@sc{posix}标准,其他的新特性的加入又引起了这些差别。

Program authors who wanted their programs to run on a wide variety of Unix variants had to be familiar with the detailed differences between the variants. They also had to worry about the ways in which the variants changed from one version to another, as variants on the one hand converged on the @sc{posix} standard and on the other continued to introduce new and different features.

即使在通常的时候用@code{#ifdef}来区别不同的系统和版本,了解什么样的版本 有什么样的特性还是日趋困难。于是应该用一种组织方式来解决这个问题的需求 变得很明显了。

While it was generally possible to use @code{#ifdef} to identify particular systems and versions, it became increasingly difficult to know which versions had which features. It became clear that some more organized approach was needed to handle the differences between Unix variants.

@node First Configure Programs @section The First Configure Programs

到1992年,四种不同的系统已经被开发用来完成代码的可移植:

By 1992, four different systems had been developed to help with source code portability: @itemize @bullet @item Metaconfig,由Larry Wall, Harlan Stenn和Raphael Manfredi编写。

The Metaconfig program, by Larry Wall, Harlan Stenn, and Raphael Manfredi. @item Cyguns @file{configure}脚本,由K. Richard Pixley, 和原始的@sc{gcc} @file{configure}脚本,由Richard Stallman完成。 这些工具非常的类似,而且开发者常常交流。 @sc{gcc}是the @sc{gnu} Compiler Collection的缩写, 最早是the @sc{gnu} C compiler的意思。

The Cygnus @file{configure} script, by K. Richard Pixley, and the original @sc{gcc} @file{configure} script, by Richard Stallman. These are quite similar, and the developers communicated regularly. @sc{gcc} is the @sc{gnu} Compiler Collection, formerly the @sc{gnu} C compiler. @item @sc{gnu} Autoconf软件包,由David MacKenzie编写。

The @sc{gnu} Autoconf package, by David MacKenzie. @item Imake,X Window系统的部分。

Imake, part of the X Window system. @end itemize

这些系统都把编译一个程序分为两步:一步是配置,一步是编译。对所有的 系统,编译用标准的Unix @command{make}程序。命令@command{make}从文件 @file{Makefile}里面读取一组规则,然后用这些规则来编译一个系统。配置 这一步用来产生@file{Makefile},有时还有些其他在编译过程中要用到的文件。

These systems all split building a program into two steps: a configuration step, and a build step. For all the systems, the build step used the standard Unix @command{make} program. The @command{make} program reads a set of rules in a @file{Makefile}, and uses them to build a program. The configuration step would generate @file{Makefile}s, and perhaps other files, which would then be used during the build step.

Metaconfig和Autoconf都用特征测试的办法来判断系统是否可用。 它们用BASH脚本(各种Unix都以各种方式支持BASH)来测试系统是否支持。

Metaconfig and Autoconf both use feature tests to determine the capabilities of the system. They use Bourne shell scripts (all variants of Unix support the Bourne shell in one form or another) to run various tests to see what the system can support.

Cygnus@file{configure}脚本和原始的@sc{gcc} @file{configure}脚本也都是 BASH脚本。它们依赖于不同系统的少量的配置文件,包括头文件和@file{Makefile}片断。 在比较早的版本,用户在编译程序的时候必须告诉程序应该为什么类型的系统编译, 后来Per Bothner写了个加强版的shell脚本,用到了标准的unix程序@command{uname}, 才结束了这段尴尬的历史。

The Cygnus @file{configure} script and the original @sc{gcc} @file{configure} script are also Bourne shell scripts. They rely on little configuration files for each system variant, both header files and @file{Makefile} fragments. In early versions, the user compiling the program had to tell the script which type of system the program should be built for; they were later enhanced with a shell script written by Per Bothner which determines the system type based on the standard Unix @command{uname} program and other information.

Imake是一个可移植的C程序。Imake可以为各种系统定制,并且能作为 编译的程序的部分运行。然而更常见的Imake是作为一个软件发行的, 包括了各种需要支持的系统的配置信息。

Imake is a portable C program. Imake can be customized for a particular system, and run as part of building a package. However, it is more normally distributed with a package, including all the configuration information needed for supported systems.

Metaconfig和Autoconf被程序的作者使用,它们生成了一个随带程序源码 发现的shell脚本。一个用户在安装编译平台的系统上面运行这个脚本来产生 配置代码使得适合该系统。

Metaconfig and Autoconf are programs used by program authors. They produce a shell script which is distributed with the program's source code. A user who wants to build the program runs the shell script in order to configure the source code for the particular system on which it is to be built.

Cygnus和and @sc{gcc} @file{configure}脚本和@command{imake}没有这写类似的 明显差异。

The Cygnus and @sc{gcc} @file{configure} scripts, and @command{imake}, do not have this clear distinction between use by the developer and use by the user.

Cygnus和and @sc{gcc} @file{configure}脚本和@command{imake}有一些特性 使得其支持跨平台交叉开发,包括支持交叉编译,这种方式在本机编译,而运行在 另外的系统,还包括支持用一个交叉编译器来编译程序。

The Cygnus and @sc{gcc} @file{configure} scripts included features to support cross development, both to support building a cross-compiler which compiles code to be run on another system, and to support building a program using a cross-compiler.

Autoconf, Metaconfig和Imake没有这样的特性(它们后来被添加到Autoconf); 它们仅仅在它们自己运行的平台上编译一个本地的程序。

Autoconf, Metaconfig and Imake did not have these features (they were later added to Autoconf); they only worked for building a program on the system on which it was to run.

由Metaconfig产生的脚本默认是交互式的:它们在运行的时候问用户一些问题。 这使得脚本可以确定一些很难测试或者无法测试的系统特性,譬如setuid的程序 的行为。

The scripts generated by Metaconfig are interactive by default: they ask questions of the user as they go along. This permits them to determine certain characteristics of the system which it is difficult or impossible to test, such as the behavior of setuid programs.

Cygnus和@sc{gcc} @file{configure}脚本和由@command{autoconf}产生的脚本, 和@command{imake}程序都不是交互式的:它们自己判断任何事情。使用Autoconf时, 软件包开发者通过写脚本来通过命令行传入一些无法测试的系统特性,有时候 需要用户在运行完@file{configure}后修改头文件。

The Cygnus and @sc{gcc} @file{configure} scripts, and the scripts generated by @command{autoconf}, and the @command{imake} program, are not interactive: they determine everything themselves. When using Autoconf, the package developer normally writes the script to accept command line options for features which can not be tested for, or sometimes requires the user to edit a header file after the @file{configure} script has run.

@node Configure Development @section Configure Development

Cygnus @file{configure}脚本和原来的@sc{gcc} @file{configure}必须为新的Unix变种 修改。这就是说当有新的Unix变种出来的时候,这些软件包就过时了。 对于开发者来说修改该软件包添加支持新的Unix变化并不是很困难的事情; 然而对一个软件包的使用者来说就未必是一件容易的事情了。

The Cygnus @file{configure} script and the original @sc{gcc} @file{configure} script both had to be updated for each new Unix variant they supported. This meant that packages which used them were continually out of date as new Unix variants appeared. It was not hard for the developer to add support for a new system variant; however, it was not something which package users could easily do themselves.

同样的问题也存在在Imake这软件上。当它支持一种特定的系统的时候, 它就没有办法做一般的的事情。事实上,象X window系统用Imake用了 大量的不同Unix变种的配置文件。

The same was true of Imake as it was commonly used. While it was possible for a user to build and configure Imake for a particular system, it was not commonly done. In practice, packages such as the X window system which use Imake are shipped with configuration information detailed for specific Unix variants.

由于Metaconfig和Autoconf需要特性测试,它们产生的脚本往往能够不需修改就 在新的系统上使用。这使得它们更具弹性和容易使用并且使得Autoconf被大量产用。

Because Metaconfig and Autoconf used feature tests, the scripts they generated were often able to work correctly on new Unix variants without modification. This made them more flexible and easier to work with over time, and led to the wide adoption of Autoconf.

1994年David MacKenzie把Cygnus @file{configure}和原来的@sc{gcc} @file{configure}的功能都融合进了Autoconf。这包括支持使用系统指定的 头文件和makefile片断,以及支持交叉编译。

In 1994, David MacKenzie extended Autoconf to incorporate the features of the Cygnus @file{configure} script and the original @sc{gcc} @file{configure} script. This included support for using system specified header file and makefile fragments, and support for cross-compilation.

@sc{gcc}的功能被保护在Autoconf,消除了使用@sc{gcc} @file{configure}脚本。 大多数的用Cygnus @file{configure}也可以用Autoconf替代,所以再也没有新的程序 使用Cygnus @file{configure}脚本了。

@sc{gcc} has since been converted to use Autoconf, eliminating the @sc{gcc} @file{configure} script. Most programs which use the Cygnus @file{configure} script have also been converted, and no new programs are being written to use the Cygnus @file{configure} script.

@command{metaconfig}现在仍旧在被使用来配置Perl和一些其他程序。@command{imake} 人就被使用来配置X window系统。然而,这些工具一般已经不再被用于开发新的软件包了。

The @command{metaconfig} program is still used today to configure Perl and a few other programs. @command{imake} is still used to configure the X window system. However, these tools are not generally used for new packages.

@node Automake Development @section Automake Development

到1994年的时候Autoconf时作为一个解决各个Unix差异的实体框架。然而程序开发者 还是必须写很大的@file{Makefile.in}才能使用它。由@command{autoconf}产生的 @file{configure}脚本会把@file{Makefile.in}变成可以交付给 @command{make}的@file{Makefile}。

By 1994, Autoconf was a solid framework for handling the differences between Unix variants. However, program developers still had to write large @file{Makefile.in} files in order to use it. The @file{configure} script generated by @command{autoconf} would transform the @file{Makefile.in} file into a @file{Makefile} used by the @command{make} program.

文件@file{Makefile.in}必须描述怎样编译一个程序。在Imake里面和@file{Makefile.in}等同 的就是@file{Imakefile},它只要描述那些源文件要参与编译就可以了。 当Imake产生一个@file{Imakefile},它会自动添加怎样编译程序的规则。 后来的@acronym{BSD} @command{make}程序也包括了编译一个程序的规则。

A @file{Makefile.in} file has to describe how to build the program. In the Imake equivalent of a @file{Makefile.in}, known as an @file{Imakefile}, it is only necessary to describe which source files are used to build the program. When Imake generates a @file{Makefile}, it adds the rules for how to build the program itself. Later versions of the @acronym{BSD} @command{make} program also include rules for building a program.

由于大部分的程序以相同的方式编译,所以在@file{Makefile.in}里面由大量的重复。 @sc{gnu}项目也为@file{Makefile}开发了适当复杂的一系列标准,这也容易引起一些细节错误。

Since most programs are built in much the same way, there was a great deal of duplication in @file{Makefile.in} files. Also, the @sc{gnu} project developed a reasonably complex set of standards for @file{Makefile}s, and it was easy to get some of the details wrong.

这些因素导致了Automake的开发。@command{automake},类似@command{autoconf}, 是一个开发者运行的程序。开发者写好文件名为@file{Makefile.am}的文件;这个 用比@file{Makefile}简单的语法。@command{automake}读取@file{Makefile.am} 并且产生@file{Makefile.in}。这个想法来源于@command{autoconf}包含了转化 @file{Makefile.in}为@file{Makefile}的过程。

These factors led to the development of Automake. @command{automake}, like @command{autoconf}, is a program run by a developer. The developer writes files named @file{Makefile.am}; these use a simpler syntax than ordinary @file{Makefile}s. @command{automake} reads the @file{Makefile.am} files and produces @file{Makefile.in} files. The idea is that a script generated by @command{autoconf} converts these @file{Makefile.in} files into @file{Makefile}s.

如果用Imake和BSD@command{make},@file{Makefile.am}里面只要描述 要编译的系统需要的文件就可以了。@command{automake}会在生成@file{Makefile.in} 的时候自动添加必要的规则。@command{automake}也会添加任何在 @sc{gnu} @file{Makefile}标准里面需要的规则。

As with Imake and BSD @command{make}, the @file{Makefile.am} file need only describe the files used to build a program. @command{automake} automatically adds the necessary rules when it generates the @file{Makefile.in} file. @command{automake} also adds any rules required by the @sc{gnu} @file{Makefile} standards.

第一个版本的Automake是由David MacKenzie在1994年写的, 由Tom Tromey在1995年彻底重写。

The first version of Automake was written by David MacKenzie in 1994. It was completely rewritten in 1995 by Tom Tromey.

@node Libtool Development @section Libtool Development

随着时间的过去,Unix开始支持共享库。

Over time, Unix systems added support for shared libraries.

传统的库,或者静态库被链接到一个程序镜像。这表示每个程序如果用到 静态库的话,它就包含了部分或者全部的库到程序二进制文件里面。

Conventional libraries, or static libraries, are linked into a program image. This means that each program which uses a static library includes some or all of the library in the program binary on disk.

共享库,在另一方面,是一个分开的文件。一个程序如果用一个共享库,那么 它并不拥有这个库的一份拷贝;它仅仅包含这个库的名字。很多程序可以使用 一个单独的共享库。

Shared libraries, on the other hand, are a separate file. A program which uses a shared library does not include a copy of the library; it only includes the name of the library. Many programs can use a single shared library.

用一个共享库可以节约硬盘空间。由于系统可以对多个程序之运行一个单独的 共享库的实例,它也可以节省在运行时候的交换空间。另外一个好处是可以通过 更新共享库来修复bug,而不必重新编译所有用到该库的程序。

Using a shared library reduces disk space requirements. Since the system can generally share a single executable instance of the shared library among many programs, it also reduces swap space requirements at run time. Another advantage is that it is possible to fix a bug by updating the single shared library file on disk, without requiring all the programs which use the library to be rebuilt.

第一个Unix共享库是在@acronym{AT&T}的System V release 3上实现的。 这个主意马上被各个Unix厂商产用,出现在SunOS, @sc{hp-ux}, @sc{aix}, 和Digital Unix 等等系统上。不幸的是,每个版本的实现在创建和使用共享库以及特殊的特性支持上面 都有差异。

The first Unix shared library implementation was in System V release 3 from @acronym{AT&T}. The idea was rapidly adopted by other Unix vendors, appearing in SunOS, @sc{hp-ux}, @sc{aix}, and Digital Unix among others. Unfortunately, each implementation differed in the creation and use of shared libraries and in the specific features which were supported.

自然的,以源代码发布的软件包作者希望能够编译它们自己的共享库。在Autoconf/Automake 框架里面包括几种不同的实现。

Naturally, packages distributed as source code which included libraries wanted to be able to build their own shared libraries. Several different implementations were written in the Autoconf/Automake framework.

1996年,Gordon Matzigkeit开始开发Libtool。Libtool是一些shell脚本的集合, 它处理了不同系统的不同共享库带来的问题。今天Libtool可以单独使用,但是 它事实上紧密的和Automake结合在了一起使用。

In 1996, Gordon Matzigkeit began work on a package known as Libtool. Libtool is a collection of shell scripts which handle the differences between shared library generation and use on different systems. It is closely tied to Automake, although it is possible to use it independently.

随着时间的过去,Libtool被修改加强并且能够支持更多的Unix变种,而且提供了 和标准共享库的接口。

Over time, Libtool has been enhanced to support more Unix variants and to provide an interface for standardizing shared library features.

@node Microsoft Windows Development @section Microsoft Windows

1995年,微软发布了Windows 95,之后它成了世界上最被广泛使用的操作系统。 Autoconf和Libtool当时被用来支持不同Unix变种之间的可移植性,但是它同时 也提供了一个对Windows的可移植的框架。因此,这使得写一份代码可以在Unix 和Windows都可以使用变得可能。

In 1995, Microsoft released Windows 95, which soon became the most widely-used operating system in the world. Autoconf and Libtool were written to support portability across Unix variants, but they provided a framework to support portability to Windows as well. This made it possible for a program to support both Unix and Windows from a single source code base.

Autoconf和Libtool的关键是需要Unix的shell,@sc{gnu}Bash已经作为Cygwin项目 的一部分被移植到了Windows(Cygwin最初由Steve Chamberlain编写)。Cygwin 项目完成了Windows平台下面的基本的Unix @sc{api},这使得把Unix程序 直接移植到Windows变得可能。

The key requirement of both Autoconf and Libtool was the Unix shell. The @sc{gnu} bash shell was ported to Windows as part of the Cygwin project, which was originally written by Steve Chamberlain. The Cygwin project implements the basic Unix @sc{api} in Windows, making it possible to port Unix programs directly.

一旦shell和Unix @command{make}程序(也是Cygwin能提供的)都存在,那就 使得Autoconf和Libtool直接支持Windows变得可能,用Cygwin接口或者微软的 Visual C++工具都可以做到。这包括解决一些细节,譬如不同系统的文件扩展, 另外一个系列的共享库等等问题。解决这个问题的第一个版本是1998年由Lance Taylor 完成的。Automake也已经被移植到了Windows。 它需要Perl的支持才能工作(@pxref{Prerequisite tools})。

Once the shell and the Unix @command{make} program (also provided by Cygwin) were available, it was possible to make Autoconf and Libtool support Windows directly, using either the Cygwin interface or the Visual C++ tools from Microsoft. This involved handling details like the different file extensions used by the different systems, as well as yet another set of shared library features. This first version of this work was by Ian Lance Taylor in 1998. Automake has also been ported to Windows. It requires Perl to be installed (@pxref{Prerequisite tools}).

Personal tools