Android系统开发(4)——Autotools
Autotools工具的构成
1、autoscan
autoscan是用来扫描源码文件夹生成configure.san文件的,configure.san包括了系统配置的基本选项。里面都是一些宏定义,我们须要将它的名字改为configure.in
2、aclocal
aclocal是一个perl脚本程序。aclocal依据configure.in文件内容自己主动生成aclocal.m4文件,生成的aclocal.m4文件是宏展开文件。
3、autoconf
autoconf是用来产生configure文件的。configure.in文件的内容是一些宏,这些宏经过autoconf处理后会变成检查系统特性、环境变量、软件必须的參数的shell脚本。
4、autohead
自己主动生成config.h.in
5、automake
使用automake-add-missing来产生Makefile.in.
Document address:https://www.gnu.org/software/autoconf/manual/autoconf.html
Files used in preparing a software package for distribution, when using just Autoconf:
your source files --> [autoscan*] --> [configure.scan] --> configure.ac
configure.ac --.
| .------> autoconf* -----> configure
[aclocal.m4] --+---+
| `-----> [autoheader*] --> [config.h.in]
[acsite.m4] ---'
Makefile.in
Additionally, if you use Automake, the following additional productions come into play:
[acinclude.m4] --.
|
[local macros] --+--> aclocal* --> aclocal.m4
|
configure.ac ----'
configure.ac --.
+--> automake* --> Makefile.in
Makefile.am ---'
Files used in configuring a software package:
.-------------> [config.cache]
configure* ------------+-------------> config.log
|
[config.h.in] -. v .-> [config.h] -.
+--> config.status* -+ +--> make*
Makefile.in ---' `-> Makefile ---'Autotools过程演示
1、autoscan
改动configure.san文件名称为configure.ac或者configure.in,打开配置我们生成makefile的信息。
2、aclocal
运行autoconf命令来生成configure可运行文件。并新建一个Makefile.am来编辑内容
bin_PROGRAMS = hello hello_SOURCES = hello.c
安装软件
运行make命令和sudo make install
去/usr/local/bin以下运行我们的可运行文件hello
生成压缩包
浙公网安备 33010602011771号