最近接觸到許多linux項目,其編譯都是使用的autotools。autotools是一個自動化的編譯工具。個人理解它的最主要功能就是生成Makefile。因為直接寫Makefiel,其依賴關系還是比較復雜的。一般的我們下載的源碼包只要通過以下3條命令,就可完成編譯和安裝:./configuremakesudo make install但是autotools其本來還是非常復雜的,下面給出參考以下是命令列表:autoscan 掃描給定的目錄及其子目錄,以搜尋普通的可移植性問題,比如檢查編譯器,庫,頭文件等。 生成的configure.scan是configure.ac文件的原型。aclocal 是一個收集宏的過程。 將已經安裝的宏、用戶定義宏和acinclude.m4文件中的宏集中定義到文件aclocal.m4中。autoheader 生成宏定義的模板文件config.h.in。 宏定義模板文件被后面的命令所需要。automake 根據configure.ac和Makefile.am中定義的結構,生成Makefile.in文件。libtoolize 如果在configure.ac中定義了一些特殊的宏,比如AC_PROG_LIBTOO,automake將會調用此命令。autoconf 生成configure腳本文件。make distclean 清除所有生成的文件./configure 生成Makefile。make 編譯。make install 把程序安裝到系統目錄中去。make uninstall 卸載程序。make clean 清除生成的目標文件及過程中產生的文件。make distclean 清除所有產生的文件。make dist 將程序和相關的文檔打包為一個.tar.gz壓縮文件以供發布。autoupdate 如果更新了Autoconf工具的版本,此命令可更新configure.in。autoreconfig 如果更新了Autoconf工具的版本,此命令可更新產生的配置文件。ifname 掃描C源程序文件,在標準輸出上輸出那些出現在#if,#elif,#ifdef或#ifndef中的標識符, 每個標識符顯示為一行,其后跟一空格和所屬的文件名。command input output--------------------------------------------------autoscan [source] configure.scan autoscan.logaclocal configure.ac aclocal.m4autoheader aclocal.m4 autoconfig.h.inautomake configure.ac INSTALL makefile.am Makefile.in COPYING install-sh missing mkinstalldirs stamp-h.inlibtoolize config.guess config.sub ltmain.sh ltconfigautoconf configure.ac configure aclocal.m4 autoconfig.h.incommand input output-----------------------------------------------------------------configure configure Makefile Makefile.in config.h cofnig.h.in config.log XXXXX.pc.in config.status XXXXX-uninstalled.pc.in libtool XXXXX.pc XXXXX-uninstalled.pc stamp-h1make Makefilemake install Makefilemake uninstall Makefilemake clean Makefilemake distclean Makefilemake dist Makefile
新聞熱點
疑難解答