久久国产成人av_抖音国产毛片_a片网站免费观看_A片无码播放手机在线观看,色五月在线观看,亚洲精品m在线观看,女人自慰的免费网址,悠悠在线观看精品视频,一级日本片免费的,亚洲精品久,国产精品成人久久久久久久

分享

automake 安裝及使用

 erran 2015-11-12

http://blog.csdn.net/lusehu/article/details/6415213

autotools是個(gè)系列工具,,首先確認(rèn)你的Ubuntu系統(tǒng)是否安裝了以下工具(可以通過(guò)which命令查看):

    aclocal
    autoscan
    autoconf
    autoheader
    automake

  安裝方法:
       root@ubuntu:~# sudo apt-get install autoconf (
我只執(zhí)行了這一條安裝指令  下面的使用中沒(méi)有出錯(cuò)

  顯示如下:
         正在讀取軟件包列表... 完成
         正在分析軟件包的依賴關(guān)系樹(shù)       
         正在讀取狀態(tài)信息... 完成       
         E: 無(wú)法找到軟件包 autoscan
        將會(huì)安裝下列額外的軟件包:
         automake autotools-dev m4
        建議安裝的軟件包:
        autoconf2.13 autobook autoconf-archive gnu-standards autoconf-doc libtool
        gettext
        下列【新】軟件包將被安裝:
         autoconf automake autotools-dev m4
        共升級(jí)了 0 個(gè)軟件包,,新安裝了 4 個(gè)軟件包,,要卸載 0 個(gè)軟件包,,有 28 個(gè)軟件未被升級(jí),。
         需要下載 1315kB 的軟件包,。
         解壓縮后會(huì)消耗掉 4366kB 的額外空間。
         您希望繼續(xù)執(zhí)行嗎,?[Y/n] 
        輸入y,,安裝

 

最好一起安裝它建議安裝的軟件包,否則autotools工具使用可能出錯(cuò),。

root@ubuntu:~# sudo apt-get install autotools-dev m4 autoconf2.13 autobook autoconf-archive gnu-standards autoconf-doc libtool



使用:

官方文檔http://www./software/automake/manual/index.html

流程

第一部份:執(zhí)行autoscan  修改configure.scan  成   configure.in

  1. #                                               -*- Autoconf -*-  
  2. # Process this file with autoconf to produce a configure script.  
  3.   
  4. AC_PREREQ(2.68)  
  5. AC_INIT(hello,1.0)  
  6. AM_INIT_AUTOMAKE(hello,1.0)  
  7. AC_CONFIG_SRCDIR([hello.c])  
  8. AC_CONFIG_HEADERS([config.h])  
  9.   
  10. # Checks for programs.  
  11. AC_PROG_CC  
  12.   
  13. # Checks for libraries.  
  14.   
  15. # Checks for header files.  
  16.   
  17. # Checks for typedefs, structures, and compiler characteristics.  
  18.   
  19. # Checks for library functions.  
  20. AC_CONFIG_FILES([makefile])  
  21. AC_OUTPUT  

第二部份:執(zhí)行aclocal   執(zhí)行autoconf

第三部份: 執(zhí)行autoheader

第四部份: 新建makefile.am  執(zhí)行automake  -a

  1. AUTOMAKE_OPTIONS=foreign  
  2. bin_PROGRAMS= hello  
  3. hello_SOURCES= hello.c  


 最后:

,。/configure   make    make install   make clean



教程:

                             http://public0821./blog/665786

這片文章不錯(cuò) : http://www.cnblogs.com/276815076/archive/2010/09/30/1839589.html

                          http://www./article-22327-1.html

文庫(kù)教程: http://wenku.baidu.com/view/bcb0074669eae009581becbb.html


實(shí)例:(應(yīng)注意觀察每一步的執(zhí)行結(jié)果是否正確,是否生成了想要的文件


實(shí)例1:精簡(jiǎn)實(shí)例很不錯(cuò)

(我測(cè)試過(guò)沒(méi)問(wèn)題 只是中間有個(gè)單詞寫(xiě)錯(cuò)了

vim Makefile.am

文件內(nèi)容為:

AUTOMAKE——OPTIONS=foreign

bin_PROGRAMS=hello

hello_SUORCES=hello.c  此處應(yīng)為 hello_SOURCES=hello.c 

)

 http://www.cnblogs.com/276815076/archive/2010/09/30/1839589.html



實(shí)例2:(未測(cè)試,,但流程正確)

http://blog.163.com/adam_mhl/blog/static/64278267200710291130488/

   建立目錄:mkdir include src
    編寫(xiě)程序:include/str.h
        #include <stdio.h>
        int str(char *string);


    編寫(xiě)程序:src/str.c
       #include "str.h"
//print string
int str(char *string){
       printf("\n----PRINT STRING----\n\"%s\"\n",string);
       return 0;
}

//interface of this program
int main(int argc , char **argv){
       char str_read[1024];
       printf("Please INPUT something end by [ENTER]\n");
       scanf("%s",str_read);
       return str(str_read );
}


第一部份:(執(zhí)行一條命令+修改一個(gè)文件)
3,、生成configure.in
include   src
[root@localhost str]#autoscan
autom4te: configure.ac: no such file or directory
autoscan: /usr/bin/autom4te failed with exit status: 1
[root@localhost str]# ls
autoscan.log   configure.scan(上面的命令生成此文件)   include   src
[root@localhost str]# cp configure.scan configure.ac
修改 configure.scan 成 condigure.in:
1,修改AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS)為
AC_INIT(str,0.0.1, [[email protected]])   
(注解:FULL-PACKAGE-NAME 為程序名稱,,VERSION為當(dāng)前版本,, BUG-REPORT-ADDRESS為bug匯報(bào)地址)

2,添加AM_INIT_AUTOMAKE 
3,,添加AC_CONFIG_FILES([Makefile])

修改后文件為:
#                                               -*- 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_INIT(str, 0.0.1, [[email protected]])
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([include/str.h])
AC_CONFIG_HEADER([config.h])


# 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_CONFIG_FILES([Makefile])
AC_OUTPUT


第二部份:(執(zhí)行兩條命令)
執(zhí)行aclocal
[root@localhost str]# aclocal
/usr/share/aclocal/libfame.m4:6: warning: underquoted definition of AM_PATH_LIBFAME
   run info '(automake)Extending aclocal'
   or see http://sources./automake/automake.html#Extending-aclocal

執(zhí)行autoconf
[root@localhost str]# autoconf
[root@localhost str]# ls
aclocal.m4    autoscan.log   config.h.in configure.scan   include     Makefile.am   NEWS
AUTHORS       ChangeLog     configure     COPYING       INSTALL     Makefile.in   README
autom4te.cache   compile    configure.ac   depcomp       install-sh   missing    src


第三部份(執(zhí)行一條命令)

5,、autoheader

root@localhost str]# autoheader



第四部份(新建文件+執(zhí)行automake)
6、創(chuàng)建Makefile.am
[root@localhost str]# cat Makefile.am
#Makefile.am
bin_PROGRAMS = str
str_SOURCES     = include/str.h src/str.c
str_CPPFLAGS = -I include/

7,、automake必須文件(可略過(guò)此步):
*   install-sh
* missing
* INSTALL
* NEWS
* README
* AUTHORS
* ChangeLog
* COPYING
* depcomp
其中
* install-sh
* missing
* INSTALL
* COPYING
* depcomp
可以通過(guò)automake -a選項(xiàng)自動(dòng)生成,,所以這里只需要建立如下文件
[root@localhost str]# touch NEWS README AUTHORS ChangeLog(也可不加這一步)
8、執(zhí)行automake -a
[root@localhost str]# automake -a
configure.ac: installing `./install-sh'
configure.ac: installing `./missing'
Makefile.am: installing `./INSTALL'
Makefile.am: installing `./COPYING'
Makefile.am: installing `./compile'
Makefile.am: installing `./depcomp'


最后一步:

10,、執(zhí)行測(cè)試:
執(zhí)行./configure
執(zhí)行 make   此時(shí)應(yīng)該已經(jīng)生成可執(zhí)行文件,,ls看一下
執(zhí)行 make install
11、測(cè)試程序:#可執(zhí)行文件

make clean   清除編譯過(guò)程生成的文件

make uninstall   卸載


輔助知識(shí)
12. 添加測(cè)試包:make dist-gzip
13.添加一個(gè)支持子目錄,、靜態(tài)庫(kù),、自定義configure選項(xiàng)的包
支持子目錄Makefile.am 選項(xiàng) SUBDIR =
#Automake interface 
SUBDIRS = src

支持靜態(tài)庫(kù)Makefile.am
EXTRA_DIST   用于添加除源碼外的文件到dist包
#Automake interface
bin_PROGRAMS = hello
hello_SOURCES = hello.c lib/sbase.h
hello_CPPFLAGS = -I lib
hello_LDFLAGS = -static lib/libsbase.a
EXTRA_DIST = lib/libsbase.a

configure.ac:
AC_PREREQ(2.59)
#AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS)
AC_INIT(hello, 0.0.1, [[email protected]])
#AM 聲明
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([src/hello.c])
AC_CONFIG_HEADER([config.h])

# Checks for programs.
AC_PROG_CC

# Checks for libraries.

# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([stdint.h stdlib.h sys/socket.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T

#用于自定義configure 選項(xiàng),見(jiàn)acinclude.am
AC_CHECK_EXTRA_OPTIONS
# Checks for library functions.

AC_CONFIG_FILES([Makefile
                src/Makefile])
AC_OUTPUT

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,,所有內(nèi)容均由用戶發(fā)布,,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式,、誘導(dǎo)購(gòu)買(mǎi)等信息,,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,,請(qǐng)點(diǎn)擊一鍵舉報(bào),。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多