Android系統開發(4)——Autotools

來源:互聯網
上載者:User

標籤:autotools   makefile   gcc   

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 = hellohello_SOURCES = hello.c
安裝軟體
執行make命令和sudo make install
去/usr/local/bin下面執行我們的可執行檔hello
產生壓縮包

Android系統開發(4)——Autotools

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.