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

    生成压缩包


  • 相关阅读:
    vagrant在windows下的使用
    eclipse包层级显示和工作空间显示
    myeclipse中解决 java heap space/gc overhead limit exceeded eclipse 的方法
    Java基础1:深入理解Java面向对象三大特性
    Java设计模式学习总结
    初探设计模式5:Spring涉及到的9种设计模式
    初探Java设计模式4:JDK中的设计模式
    初探Java设计模式3:行为型模式(策略,观察者等)
    springmvc之返回json类型的数据给前端
    spring之如何将验证错误信息显示在相应界面
  • 原文地址:https://www.cnblogs.com/lanzhi/p/6468823.html
Copyright © 2011-2022 走看看