青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

posts - 297,  comments - 15,  trackbacks - 0
  

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.in

user 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|------> mkinstalldirs
configure.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 - - ->|configure| - - -> 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 ------>| make |
{project sources} ---------------->| |--------> {project targets}
.-+ +--,
| `--------' |
| libtool |
| missing |
| install-sh |
|mkinstalldirs|
`-------------'
實例
在/hello/目錄下創建一個hello.c文件,并編譯運行它:

#cd /hello/

(1) 編寫源文件hello.c:

#include<stdio.h> 
int main(int argc, char** argv)
{
printf("Hello, GNU!n");
return 0;
}

[litao@vm0000131 hello]$ ll
total 4
-rw-rw-r-- 1 litao litao 68 Aug 12 12:02 hello.c

一、autoscan

[litao@vm0000131 hello]$ autoscan
autom4te: configure.ac: no such file or directory
autoscan: /usr/bin/autom4te failed with exit status: 1
[litao@vm0000131 hello]$ ll
total 8
-rw-rw-r-- 1 litao litao   0 Aug 12 12:03 autoscan.log
-rw-rw-r-- 1 litao litao 457 Aug 12 12:03 configure.scan
-rw-rw-r-- 1 litao litao  68 Aug 12 12:02 hello.c

已經生成了configure.scan,autoscan.log文件

將configure.scan 修改為 configure.in,最后修改的內容如下:

[litao@vm0000131 hello]$ mv configure.scan configure.in    
[litao@vm0000131 hello]$ vim configure.in 

#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.59)
AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS)
AC_CONFIG_SRCDIR([hello.c])
#AC_CONFIG_HEADER([config.h])
AM_INIT_AUTOMAKE(hello, 1.0)
# Checks for programs.
AC_PROG_CC

# Checks for libraries.

# Checks for header files.

# Checks for typedefs, structures, and compiler characteristics.

# Checks for library functions.
AC_OUTPUT(Makefile)

二、acloacl

[litao@vm0000131 hello]$ aclocal 

生成 aclocal.m4 和 autom4te.cache (生成aclocal.m4的過程中涉及到configure.in)

[litao@vm0000131 hello]$ ll
total 44
-rw-rw-r-- 1 litao litao 31120 Aug 12 12:08 aclocal.m4
drwxr-xr-x 2 litao litao  4096 Aug 12 12:08 autom4te.cache
-rw-rw-r-- 1 litao litao     0 Aug 12 12:03 autoscan.log
-rw-rw-r-- 1 litao litao   496 Aug 12 12:08 configure.in
-rw-rw-r-- 1 litao litao    68 Aug 12 12:02 hello.c

三、antoconf

[litao@vm0000131 hello]$ autoconf
生成 configure (根據 configure.in, 和 aclocal.m4)

[litao@vm0000131 hello]$ ll
total 168
-rw-rw-r-- 1 litao litao  31120 Aug 12 12:08 aclocal.m4
drwxr-xr-x 2 litao litao   4096 Aug 12 12:11 autom4te.cache
-rw-rw-r-- 1 litao litao      0 Aug 12 12:03 autoscan.log
-rwxrwxr-x 1 litao litao 122297 Aug 12 12:11 configure
-rw-rw-r-- 1 litao litao    496 Aug 12 12:08 configure.in
-rw-rw-r-- 1 litao litao     68 Aug 12 12:02 hello.c

四、編寫Makefile.am:

AUTOMAKE_OPTIONS= foreign
bin_PROGRAMS= hello
hello_SOURCES= hello.c

五、automake

生成 Makefile.in, depcomp, install-sh, 和 missing (根據 Makefile.am, 和 aclocal.m4)

[litao@vm0000131 hello]$ automake
configure.in: required file `./install-sh' not found
configure.in: required file `./missing' not found
Makefile.am: required file `./depcomp' not found
[litao@vm0000131 hello]$ automake --add-missing
configure.in: installing `./install-sh'
configure.in: installing `./missing'
Makefile.am: installing `./depcomp'
[litao@vm0000131 hello]$ ll
total 192
-rw-rw-r-- 1 litao litao  31120 Aug 12 12:08 aclocal.m4
drwxr-xr-x 2 litao litao   4096 Aug 12 12:14 autom4te.cache
-rw-rw-r-- 1 litao litao      0 Aug 12 12:03 autoscan.log
-rwxrwxr-x 1 litao litao 122297 Aug 12 12:11 configure
-rw-rw-r-- 1 litao litao    496 Aug 12 12:08 configure.in
lrwxrwxrwx 1 litao litao     31 Aug 12 12:16 depcomp -> /usr/share/automake-1.9/depcomp
-rw-rw-r-- 1 litao litao     68 Aug 12 12:02 hello.c
lrwxrwxrwx 1 litao litao     34 Aug 12 12:16 install-sh -> /usr/share/automake-1.9/install-sh
-rw-rw-r-- 1 litao litao     69 Aug 12 12:15 Makefile.am
-rw-rw-r-- 1 litao litao  16561 Aug 12 12:16 Makefile.in
lrwxrwxrwx 1 litao litao     31 Aug 12 12:16 missing -> /usr/share/automake-1.9/missing

六、configure
生成 Makefile, config.log, 和 config.status

生成makefile整個過程

configure.in :
configure.in文件內容是一系列GNU m4 的宏,這些宏經autoconf處理后會變成檢查系統特性的shell scripts。 configure.in 內宏的順序并沒有特別的規定,但是每一個configure.in 文件必須在所有宏前加入 AC_INIT 宏,然后在所有宏的最后加上 AC_OUTPUT宏。可先用 autoscan 掃描原始文件以產生一個 configure.scan 文件,再對 configure.scan 做些修改成 configure.in 文件。在范例中所用到的宏如下:

dnl 
這個宏后面的字不會被處理,可以視為注釋 
AC_INIT(FILE) 
該宏用來檢查源代碼所在路徑,autoscan 會自動產生,一般無須修改它。 
AM_INIT_AUTOMAKE(PACKAGE,VERSION) 
這個是使用 Automake 所
必備的宏,PACKAGE 是所要產生軟件套件的名稱,VERSION 是版本編號。 
AC_PROG_CC 
檢查系統可用的C編譯器,若源代碼是用C寫的就需要這個宏。 
AC_OUTPUT(FILE) 
設置 configure 所要產生的文件,若是
Makefile ,configure 便會把它檢查出來的結果帶入  Makefile.in 文件后產生合適的 Makefile。 
實際上,這里使用 Automake 時,還需要一些其他的宏,這些額外的宏我們用 aclocal來幫助產生。執行 aclocal會產生aclocal.m4 文件,如果無特別的用途,可以不需要修改它,用 aclocal 所產生的宏會告訴 Automake如何動作。 

有了 configure.in 及 aclocal.m4兩個文件以后,便可以執行 autoconf來產生 configure 文件了。

Makefile.am
         Automake 會根據 configure.in 中的宏把Makefile.am 轉成 Makefile.in 文件。 Makefile.am 文件定義所要產生的目標: 

AUTOMAKE_OPTIONS 
設置 automake 的選項。
Automake 主要是幫助開發 GNU 軟件的人員來維護軟件,所以在執行 automake 時,會檢查目錄下是否存在標準 GNU 軟件中應具備的文件,例如 'NEWS'、'AUTHOR'、'ChangeLog' 等文件。
設置 foreign 時,automake 會改用一般軟件的標準來檢查。 
bin_PROGRAMS 
定義要產生的執行文件名。如果要產生多個執行文件,每個文件名用空白符隔開。 
hello_SOURCES 
定義 
'hello' 這個執行程序所需要的原始文件。如果 'hello'這個程序是由多個原始文件所產生,必須把它所用到的所有原始文件都列出來,以空白符隔開。假設 'hello' 還需要 'hello.c'、'main.c'、'hello.h' 三個文件的話,則定義 
hello_SOURCES= hello.c main.c hello.h 
如果定義多個執行文件,則對每個執行程序都要定義相對的filename_SOURCES。 

編輯好 Makefile.am 文件,就可以用
 automake --add-missing來產生 Makefile.in。加上 --add-missing 選項來告訴 automake順便假如包裝一個軟件所必須的文件。Automake產生生出來的 Makefile.in 文件是完全符合 GNU Makefile 的慣例,只要執行 configure這個shell script 便可以產生合適的 Makefile 文件了。 


轉自:
http://blog.chinaunix.net/u2/76292/showart.php?id=2099939

posted on 2009-11-21 18:33 chatler 閱讀(1639) 評論(0)  編輯 收藏 引用 所屬分類: makefile
<2025年9月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

常用鏈接

留言簿(10)

隨筆分類(307)

隨筆檔案(297)

algorithm

Books_Free_Online

C++

database

Linux

Linux shell

linux socket

misce

  • cloudward
  • 感覺這個博客還是不錯,雖然做的東西和我不大相關,覺得看看還是有好處的

network

OSS

  • Google Android
  • Android is a software stack for mobile devices that includes an operating system, middleware and key applications. This early look at the Android SDK provides the tools and APIs necessary to begin developing applications on the Android platform using the Java programming language.
  • os161 file list

overall

搜索

  •  

最新評論

閱讀排行榜

評論排行榜

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            一二三四社区欧美黄| 在线看片日韩| 玖玖精品视频| 久久―日本道色综合久久| 欧美伊人久久久久久久久影院 | 日韩一区二区电影网| 99在线精品观看| 亚洲性xxxx| 久久伊人一区二区| 欧美日韩在线三级| 国产亚洲a∨片在线观看| 激情亚洲一区二区三区四区| 91久久精品一区二区别| 亚洲一区二区精品在线观看| 久久人人爽爽爽人久久久| 亚洲国产小视频在线观看| 91久久国产综合久久蜜月精品 | 一区二区三区国产| 久久高清一区| 欧美日韩免费看| 黄色日韩网站| 亚洲制服丝袜在线| 亚洲韩日在线| 久久超碰97人人做人人爱| 欧美另类亚洲| 在线播放豆国产99亚洲| 亚洲欧美日韩久久精品| 美女脱光内衣内裤视频久久影院 | 久久网站热最新地址| 欧美视频中文在线看 | 亚洲电影免费观看高清| 亚洲欧美国产一区二区三区| 欧美国产日韩一二三区| 亚洲欧美另类综合偷拍| 欧美精品v日韩精品v国产精品| 国产伦精品一区二区三区高清| 亚洲黄网站黄| 玖玖综合伊人| 亚洲欧美在线播放| 欧美亚洲第一区| 亚洲人www| 久久人人97超碰国产公开结果 | 午夜久久久久久| 欧美国产日韩一区二区| 亚洲影视九九影院在线观看| 欧美成人精品不卡视频在线观看| 国产欧美精品| 亚洲欧美色一区| 日韩网站在线观看| 欧美国产丝袜视频| 最新中文字幕一区二区三区| 免费黄网站欧美| 久久久久国产精品麻豆ai换脸| 国产欧美日韩精品a在线观看| 亚洲性线免费观看视频成熟| 亚洲乱码国产乱码精品精天堂| 欧美高清视频一区| 亚洲美女在线视频| 亚洲精品一区二区三区樱花| 欧美片在线观看| 亚洲午夜精品国产| 这里只有精品视频在线| 国产精品视频99| 久久精品最新地址| 久久久国产精品一区二区三区| 国产亚洲欧美中文| 麻豆精品视频在线| 欧美成年人视频网站欧美| 99re热这里只有精品视频| 91久久精品国产91性色| 欧美视频免费在线| 欧美亚洲一区| 久久福利资源站| 亚洲国产日韩一级| 亚洲精品中文字幕在线观看| 欧美午夜精品电影| 久久精品最新地址| 免费不卡中文字幕视频| 夜夜夜精品看看| 亚洲一区日韩在线| 一区福利视频| 日韩视频在线免费| 国产午夜精品在线观看| 欧美超级免费视 在线| 欧美精品在线极品| 欧美专区日韩视频| 玖玖玖国产精品| 亚洲淫片在线视频| 久久电影一区| 一本色道久久综合亚洲精品婷婷 | 久久一区亚洲| 在线一区亚洲| 欧美在线观看网站| 亚洲精选视频免费看| 一区二区毛片| 在线观看国产欧美| 亚洲天堂成人在线观看| 激情自拍一区| 一区二区免费在线播放| 在线播放国产一区中文字幕剧情欧美| 亚洲黄色影院| 好吊妞**欧美| 亚洲线精品一区二区三区八戒| 先锋影院在线亚洲| 亚洲国产经典视频| 国产精品色婷婷| 亚洲日本va午夜在线电影| 国产视频一区在线观看| 91久久国产综合久久91精品网站| 国产一区二区久久| 制服丝袜亚洲播放| 亚洲每日更新| 老司机午夜精品| 久久国产免费| 国产精品久久久久久久久免费樱桃 | 久久精品一级爱片| 欧美午夜三级| 亚洲精品久久久久久久久久久久久| 伊人成人在线视频| 欧美一区二区女人| 欧美一级一区| 国产精品乱子乱xxxx| 亚洲精品视频免费观看| 亚洲精品久久久久久下一站 | 香蕉久久久久久久av网站| 一区二区三区日韩精品视频| 欧美jjzz| 亚洲国产精品第一区二区| 永久555www成人免费| 久久黄金**| 久久综合狠狠| 尹人成人综合网| 久久精品免费观看| 久热精品视频在线免费观看| 狠狠色狠狠色综合| 久久久久综合网| 欧美大片在线观看| 亚洲精品乱码久久久久久| 欧美高清视频一区| 日韩一区二区免费看| 亚洲激情偷拍| 欧美成人午夜| 欧美成人69av| 久久精品国产综合精品| 久久久午夜视频| 很黄很黄激情成人| 久久精品99国产精品| 久久嫩草精品久久久久| 国产亚洲一级| 久久久国产91| 亚洲黄色av一区| 亚洲一区三区视频在线观看| 国产精品毛片a∨一区二区三区| 亚洲在线观看视频| 美日韩丰满少妇在线观看| 亚洲国产精品久久久久秋霞蜜臀 | 玖玖玖国产精品| 国产欧美日韩一区| 欧美日韩小视频| 亚洲欧美日韩天堂| 欧美一区二区三区久久精品茉莉花| 国产精品视频yy9099| 久久av资源网站| 亚洲国产精品一区二区www在线| 亚洲看片免费| 国产精品制服诱惑| 麻豆精品91| 一本不卡影院| 久久先锋影音av| 一本色道久久综合亚洲精品按摩| 国产精品区一区二区三| 久热爱精品视频线路一| aa亚洲婷婷| 欧美ed2k| 欧美亚洲系列| 亚洲欧美高清| 欧美性大战久久久久久久| 亚洲成人自拍视频| 亚洲在线日韩| 亚洲国产精品va| 国产精品白丝av嫩草影院| 久久久久久久97| 一区二区黄色| 欧美激情中文不卡| 欧美中文字幕| 亚洲香蕉在线观看| 在线播放豆国产99亚洲| 国产精品亚发布| 欧美日韩少妇| 免费观看成人网| 久久经典综合| 欧美亚洲日本一区| 在线中文字幕一区| 亚洲大胆人体在线| 久久免费视频在线观看| 欧美一区二区三区四区在线| 宅男噜噜噜66一区二区| 亚洲精品日日夜夜| 亚洲欧洲综合另类在线| 亚洲电影免费观看高清完整版在线观看 |