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

生成压缩包


转载于:https://www.cnblogs.com/lanzhi/p/6468823.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值