QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 5733|回复: 8

图解aclocal、autoconf、automake、autoheader、configure

[复制链接]
发表于 2009-2-3 11:22:47 | 显示全部楼层 |阅读模式
原文地址:http://hi.baidu.com/yzkuang/blog ... 3d8136c9955908.html
  1. 1.autoscan (autoconf): 扫描源代码以搜寻普通的可移植性问题,比如检查编译器,库,头文件等,生成文件configure.scan,它是configure.ac的一个雏形。

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

  3. 2.aclocal (automake):根据已经安装的宏,用户定义宏和acinclude.m4文件中的宏将configure.ac文件所需要的宏集中定义到文件 aclocal.m4中。aclocal是一个perl 脚本程序,它的定义是:“aclocal - create aclocal.m4 by scanning configure.ac”

  4. user input files   optional input     process          output files
  5. ================   ==============     =======          ============

  6.                     acinclude.m4 - - - - -.
  7.                                           V
  8.                                       .-------,
  9. configure.ac ------------------------>|aclocal|
  10.                  {user macro files} ->|       |------> aclocal.m4
  11.                                       `-------'
  12. 3.autoheader(autoconf): 根据configure.ac中的某些宏,比如cpp宏定义,运行m4,声称config.h.in

  13. user input files    optional input     process          output files
  14. ================    ==============     =======          ============

  15.                     aclocal.m4 - - - - - - - .
  16.                                              |
  17.                                              V
  18.                                      .----------,
  19. configure.ac ----------------------->|autoheader|----> autoconfig.h.in
  20.                                      `----------'

  21. 4.automake: automake将Makefile.am中定义的结构建立Makefile.in,然后configure脚本将生成的Makefile.in文件转换为Makefile。如果在configure.ac中定义了一些特殊的宏,比如AC_PROG_LIBTOOL,它会调用libtoolize,否则它会自己产生config.guess和config.sub

  22. user input files   optional input   processes          output files
  23. ================   ==============   =========          ============

  24.                                      .--------,
  25.                                      |        | - - -> COPYING
  26.                                      |        | - - -> INSTALL
  27.                                      |        |------> install-sh
  28.                                      |        |------> missing
  29.                                      |automake|------> mkinstalldirs
  30. configure.ac ----------------------->|        |
  31. Makefile.am  ----------------------->|        |------> Makefile.in
  32.                                      |        |------> stamp-h.in
  33.                                  .---+        | - - -> config.guess
  34.                                  |   |        | - - -> config.sub
  35.                                  |   `------+-'
  36.                                  |          | - - - -> config.guess
  37.                                  |libtoolize| - - - -> config.sub
  38.                                  |          |--------> ltmain.sh
  39.                                  |          |--------> ltconfig
  40.                                  `----------'

  41. 5.autoconf:将configure.ac中的宏展开,生成configure脚本。这个过程可能要用到aclocal.m4中定义的宏。

  42. user input files   optional input   processes          output files
  43. ================   ==============   =========          ============

  44. aclocal.m4 ,autoconfig.h.in - - - - - - -.
  45.                                          V
  46.                                      .--------,
  47. configure.ac ----------------------->|autoconf|------> configure



  48. 6. ./configure的过程


  49.                                            .-------------> [config.cache]
  50.      configure* --------------------------+-------------> config.log
  51.                                           |
  52.               [config.h.in] -.            v            .--> [autoconfig.h]
  53.                              +-------> config.status* -+                  
  54.               Makefile.in ---'                         `-->   Makefile



  55. 7. make过程



  56. [autoconfig.h] -.
  57.                      +--> make* --->  程序
  58.         Makefile   ---'



  59. .---------,
  60.                    config.site - - ->|         |
  61.                   config.cache - - ->|configure| - - -> config.cache
  62.                                      |         +-,
  63.                                      `-+-------' |
  64.                                        |         |----> config.status
  65.                    config.h.in ------->|config-  |----> config.h
  66.                    Makefile.in ------->|  .status|----> Makefile
  67.                                        |         |----> stamp-h
  68.                                        |         +--,
  69.                                      .-+         |  |
  70.                                      | `------+--'  |
  71.                    ltmain.sh ------->|ltconfig|-------> libtool
  72.                                      |        |     |
  73.                                      `-+------'     |
  74.                                        |config.guess|
  75.                                        | config.sub |
  76.                                        `------------'

  77. .--------,
  78.                    Makefile ------>|        |
  79.                    config.h ------>|  make  |
  80. {project sources} ---------------->|        |--------> {project targets}
  81.                                  .-+        +--,
  82.                                  | `--------'  |
  83.                                  |   libtool   |
  84.                                  |   missing   |
  85.                                  |  install-sh |
  86.                                  |mkinstalldirs|
  87.                                  `-------------'


复制代码
发表于 2009-2-3 17:03:49 | 显示全部楼层
图很乱,后果很严重……
回复

使用道具 举报

 楼主| 发表于 2009-2-3 17:14:38 | 显示全部楼层
大哥
这个就不要太强求了
文本排版挺不容易的
回复

使用道具 举报

发表于 2009-2-3 19:13:41 | 显示全部楼层
貌似 code 标签有一个用途就是排版。

  1.         |     |
  2.         |     |
  3.         \-----/
复制代码
回复

使用道具 举报

 楼主| 发表于 2009-2-3 19:32:08 | 显示全部楼层
搞定
回复

使用道具 举报

发表于 2009-2-3 19:45:43 | 显示全部楼层
继续 BS ,竟然整版全都用 code ……
回复

使用道具 举报

 楼主| 发表于 2009-2-3 20:28:48 | 显示全部楼层
回复

使用道具 举报

发表于 2009-2-3 23:04:10 | 显示全部楼层

楼上反应不要太明显了啊……
回复

使用道具 举报

 楼主| 发表于 2009-2-4 02:23:07 | 显示全部楼层
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-4-20 04:14 , Processed in 0.066987 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表