zoukankan      html  css  js  c++  java
  • 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

    生成压缩包


  • 相关阅读:
    react-native-code-push进阶及实践小结
    Redux 基础
    iOS启动图异常修复方案 -(baidu)
    pod init
    Texture的异步渲染和布局引擎
    iOS 12.1 Tabbar 跳动Bug
    基本绘图的几种方式
    OC 小代码块
    OC基础--类的本质
    OC基础--构造方法 id类型
  • 原文地址:https://www.cnblogs.com/mfmdaoyou/p/6826184.html
Copyright © 2011-2022 走看看