C/C++构建系统 GNU autotool

时间:2021-07-23 14:34:59

我们在网上经常可以看到c/c++开源的项目,其中很多都是使用GNU的构建系统进行配置和编译的,如果按照规范构造这些的步骤,有一定的门槛和复杂度,下文把关于auotools系列的工具和概要的流程简要汇总一下,这样我们就知道整个的构建系统是咋回事了。

Autotools

If you’re writing open source software that targets Unix or Linux systems, you should absolutely be using the GNU Autotools, and even if you’re writing proprietary software for Unix or Linux systems, you’ll still benefit significantly from using them. The Autotools provide you with a build environment that will allow your project to build successfully on future versions or distributions with virtually no changes to the build scripts. This is useful even if you only intend to target a single Linux distribution, because—let’s be honest—you really can’t know in advance whether or not your company will want your software to run on other platforms in the future.

GNU Coding Standards (GCS)  http://www.gnu.org/prep/standards/

Filesystem Hierarchy Standard (FHS) http://www.pathname.com/fhs/

The GNU Autotools framework includes three main packages: Autoconf, Automake, and Libtool.

Autoconf

C/C++构建系统 GNU autotool

Automake

Ø automake

Ø aclocal

C/C++构建系统 GNU autotool

Libtool

C/C++构建系统 GNU autotool

Configure / Make

C/C++构建系统 GNU autotool

C/C++构建系统 GNU autotool

以上可建,使用这个构建系统还是有些复杂,不过在当时GNU的初始阶段还是起到很到的作用的。

如果想用更简单的工具,还有cmake等,后文再讲。