圖解autoscan、aclocal、autoheader、automake、autoconf、configure、make

來源:互聯網
上載者:User

1.autoscan (autoconf): 掃描原始碼以搜尋普通的可移植性問題,比如檢查編譯器,庫,標頭檔等,組建檔案configure.scan,它是configure.ac的一個雛形。

    your source files --> [autoscan*] --> [configure.scan] --> configure.ac

2.aclocal (automake):根據已經安裝的宏,使用者定義宏和acinclude.m4檔案中的宏將configure.ac檔案所需要的宏集中定義到檔案 aclocal.m4中。aclocal是一個perl 指令碼程式,它的定義是:“aclocal - create aclocal.m4 by scanning configure.ac”

user input files   optional input     process          output files================   ==============     =======          ============                    acinclude.m4 - - - - -.                                          V                                      .-------,configure.ac ------------------------>|aclocal|                 {user macro files} ->|       |------> aclocal.m4                                      `-------'3.autoheader(autoconf): 根據configure.ac中的某些宏,比如cpp宏定義,運行m4,聲稱config.h.inuser input files    optional input     process          output files================    ==============     =======          ============                    aclocal.m4 - - - - - - - .                                             |                                             V                                     .----------,configure.ac ----------------------->|autoheader|----> autoconfig.h.in                                     `----------'

4.automake: automake將Makefile.am中定義的結構建立Makefile.in,然後configure指令碼將產生的Makefile.in檔案轉換為Makefile。如果在configure.ac中定義了一些特殊的宏,比如AC_PROG_LIBTOOL,它會調用libtoolize,否則它會自己產生config.guess和config.sub

user input files   optional input   processes          output files================   ==============   =========          ============                                     .--------,                                     |        | - - -> COPYING                                     |        | - - -> INSTALL                                     |        |------> install-sh                                     |        |------> missing                                     |automake|------> mkinstalldirsconfigure.ac ----------------------->|        |Makefile.am  ----------------------->|        |------> Makefile.in                                     |        |------> stamp-h.in                                 .---+        | - - -> config.guess                                 |   |        | - - -> config.sub                                 |   `------+-'                                 |          | - - - -> config.guess                                 |libtoolize| - - - -> config.sub                                 |          |--------> ltmain.sh                                 |          |--------> ltconfig                                 `----------'

5.autoconf:將configure.ac中的宏展開,產生configure指令碼。這個過程可能要用到aclocal.m4中定義的宏。

user input files   optional input   processes          output files================   ==============   =========          ============aclocal.m4 ,autoconfig.h.in - - - - - - -.                                         V                                     .--------,configure.ac ----------------------->|autoconf|------> configure
 
6. ./configure的過程
                                           .-------------> [config.cache]     configure* --------------------------+-------------> config.log                                          |              [config.h.in] -.            v            .--> [autoconfig.h]                             +-------> config.status* -+                                 Makefile.in ---'                         `-->   Makefile
 
7. make過程
 
     [autoconfig.h] -.                     +--> make* --->  程式       Makefile   ---'
 
                                     .---------,                   config.site - - ->|         |                  config.cache - - ->|         | - - -> config.cache                                     |         +-,                                     `-+-------' |                                       |         |----> config.status                   config.h.in ------->|config-  |----> config.h                   Makefile.in ------->|  .status|----> Makefile                                       |         |----> stamp-h                                       |         +--,                                     .-+         |  |                                     | `------+--'  |                   ltmain.sh ------->|ltconfig|-------> libtool                                     |        |     |                                     `-+------'     |                                       |config.guess|                                       | config.sub |                                       `------------'

                                   .--------,                   Makefile ------>|        |                   config.h ------>|        |{project sources} ---------------->|        |--------> {project targets}                                 .-+        +--,                                 | `--------'  |                                 |   libtool   |                                 |   missing   |                                 |  install-sh |                                 |mkinstalldirs|                                 `-------------'

轉載地址:http://hi.baidu.com/yzkuang/blog/item/557e4f24423d8136c9955908.html

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.