1.autoscan (autoconf): 扫描源代码以搜寻普通的可移植性问题,比如检查编译器,库,头文件等,生成文件configure.scan,它是configure.ac的一个雏形。
your source files --> [autoscan*] --> [configure.scan] --> configure.ac
2.aclocal (automake):根据已经安装的宏,用户定义宏和acinclude.m4文件中的宏将configure.ac文件所需要的宏集中定义到文件 aclocal.m4中。aclocal是一个perl 脚本程序,它的定义是:“aclocal - create aclocal.m4 by scanning configure.ac”
user input files optional input process output files
================ ============== ======= ============
acinclude.m4 - - - - -.
V
.-------,
configure.ac ------------------------>|aclocal|
{user macro files} ->| |------> aclocal.m4
`-------'
3.autoheader(autoconf): 根据configure.ac中的某些宏,比如cpp宏定义,运行m4,声称config.h.in
user input files optional input process output files
================ ============== ======= ============
aclocal.m4 - - - - - - - .
|
V
.----------,
configure.ac ----------------------->|autoheader|----> autoconfig.h.in
`----------'
4.automake: automake将Makefile.am中定义的结构建立Makefile.in,然后configure脚本将生成的Makefile.in文件转换 为Makefile。如果在configure.ac中定义了一些特殊的宏,比如AC_PROG_LIBTOOL,它会调用libtoolize,否则它 会自己产生config.guess和config.sub
user input files optional input processes output files
================ ============== ========= ============
.--------,
| | - - -> COPYING
| | - - -> INSTALL
| |------> install-sh
| |------> missing
|automake|------> mkinstalldirs
configure.ac ----------------------->| |
Makefile.am ----------------------->| |------> Makefile.in
| |------> stamp-h.in
.---+ | - - -> config.guess
| | | - - -> config.sub
| `------+-'
| | - - - -> config.guess
|libtoolize| - - - -> config.sub
| |--------> ltmain.sh
| |--------> ltconfig
`----------'
5.autoconf:将configure.ac中的宏展开,生成configure脚本。这个过程可能要用到aclocal.m4中定义的宏。
user input files optional input processes output files
================ ============== ========= ============
aclocal.m4 ,autoconfig.h.in - - - - - - -.
V
.--------,
configure.ac ----------------------->|autoconf|------> configure
6. ./configure的过程
.-------------> [config.cache]
configure* --------------------------+-------------> config.log
|
[config.h.in] -. v .--> [autoconfig.h]
+-------> config.status* -+
Makefile.in ---' `--> Makefile
7. make过程
[autoconfig.h] -.
+--> make* ---> 程序
Makefile ---'
.---------,
config.site - - ->| |
config.cache - - ->|configure| - - -> config.cache
| +-,
`-+-------' |
| |----> config.status
config.h.in ------->|config- |----> config.h
Makefile.in ------->| .status|----> Makefile
| |----> stamp-h
| +--,
.-+ | |
| `------+--' |
ltmain.sh ------->|ltconfig|-------> libtool
| | |
`-+------' |
|config.guess|
| config.sub |
`------------'
.--------,
Makefile ------>| |
config.h ------>| make |
{project sources} ---------------->| |--------> {project targets}
.-+ +--,
| `--------' |
| libtool |
| missing |
| install-sh |
|mkinstalldirs|
`-------------'
分享到:
相关推荐
具体来看,autoscan命令会检查指定目录下的源代码,寻找常见的移植性问题,并生成configure.scan文件,这个文件包含了autoconf需要的信息。接着,开发者需要手动将configure.scan文件重命名和修改为configure.in,...
这一步骤通常还需要运行 `aclocal` 和 `autoheader` 来生成辅助文件。 ```bash aclocal autoheader automake --add-missing autoconf ``` 5. **完成配置**:最后,运行 `./configure` 命令来生成最终的 `...
autotools使用说明文档、配套的hello源码操作指南。 linux 下c/c++使用autotools工具自动生成makefile 操作说明。...指令:autoscan、aclocal、autoheader、autoconf、automake 创建:makefile.am等
### 使用AutoMake轻松生成Makefile #### 知识点概览 1. **Makefile的基础概念** 2. **AutoMake的简介与优势** 3. **系统环境准备** 4. **AutoMake工作流程详解** - **步骤1:使用autoscan生成configure.scan文件*...
Autotools是一组用于生成makefile的工具,它们包括autoscan、autoconf、autoheader、aclocal、automake和configure等。使用Autotools可以帮助开发者自动化生成配置和编译文件的过程。以下是使用Autotools制作...
在确保已经生成了 `aclocal.m4` 和 `configure.in` 文件之后,运行 `autoheader` 命令生成 `config.h.in` 文件。这是一个配置文件,用于存放编译时的定义和宏。 4. **autoconf命令生成 configure 文件** 使用 `...
3. **运行`aclocal`**:这个命令会生成aclocal.m4文件,包含所有使用的宏定义,供configure.ac使用。 4. **运行`autoconf`**:根据configure.ac生成configure脚本。这个脚本将在用户机器上运行,以生成Makefile.in...
调用autoscan工具,生成configure.scan文件,然后将其重命名为configure.ac文件。 ⑵. 修改configure.ac文件,利用autoconf提供的各种M4宏,配置项目需要的各种自动化探测项目。 ⑶. 编写自定义宏(*.m4),建议...
2. **生成 configure 文件**:使用 `autoscan` 命令生成 `configure.scan` 文件,再使用 `aclocal` 和 `autoconf` 命令生成 `configure` 脚本。 3. **编辑 Makefile.am 文件**:手动编辑 `Makefile.am` 文件,定义...
autoheader automake --add-missing ``` 此时,你会看到一个名为`Makefile.in`的文件被创建。这是一个模板文件,它包含了Makefile的基本结构。最后,执行`./configure`命令来生成最终的Makefile。 ```bash ./...
Autotools系列工具,包括aclocal、autoscan、autoconf、autoheader和automake等,提供了一种自动化生成Makefile的方法。这些工具的出现,极大地简化了在不同平台间移植软件的工作。 首先,我们要了解Makefile的基本...
这就是autotools的用武之地,它是一系列工具的集合,包括aclocal、autoconf、autoheader和automake,用于自动生成Makefile和其他构建系统所需的文件。 `autotools`的使用流程如下: 1. **aclocal**:这个工具主要...
AutoTools是Linux下用于构建C语言项目的工具集合,主要包括autoconf、automake、libtool、aclocal等组件。这些工具帮助开发者创建出跨平台、可移植的配置脚本和Makefile,使得源代码能适应不同的操作系统和编译环境...
`autotools`包括了多个工具,如`aclocal`、`autoscan`、`autoconf`、`autoheader`和`automake`,它们共同作用于项目,生成适应多种平台的配置脚本和Makefile。 首先,我们来看第一步,`autoscan`的使用。这个工具会...
它包括 `autoscan`、`aclocal`、`autoconf`、`autoheader` 和 `automake` 等工具。通过这些工具可以自动化生成配置脚本和 Makefile 文件,从而简化跨平台的编译过程。 #### 二、Autotools组件介绍 1. **`autoscan`*...
此时,目录下应该有以下文件:`aclocal.m4`, `autom4te.cache`, `autoscan.log`, `configure`, `configure.ac`, `helloworld.c`。 ##### 4. 新建Makefile.am文件 在`helloworld`目录下创建`Makefile.am`文件,并...
首先,我们需要了解生成`Makefile`的基本流程,这个过程通常涉及到了一系列的自动化工具,包括`autoscan`、`autoconf`、`autoheader`和`automake`等。以下是一个典型的步骤: 1. **运行`autoscan`命令**:这个命令...
在项目根目录下,运行`autoscan`命令,这将生成一个名为`configure.scan`的文件,之后将其重命名为`configure.in`。 ##### 第三步:编辑`configure.in` 此文件用于配置项目的各种属性。以下是一个示例配置文件的...
3. 使用autoheader命令,基于configure.ac生成config.h.in文件,这个文件包含了宏定义,可以被configure脚本用来生成最终的config.h头文件。 4. 编写Makefile.am文件,为项目中的每个目录提供一个Makefile.am文件,...