1. 安装工具
yum install -y automake
2. 基本项目
a. 项目参考结构├── AUTHORS├── COPYING├── ChangeLog├── Makefile.am├── NEWS├── README├── README.md├── a.out├── configure.ac├── main└── main.cb. configure.ac Makefile.am main.cconfigure.ac Makefile.amconfigure.acAC_INIT([main],[0.0.1])AC_CONFIG_SRCDIR("main.c")AC_CONFIG_AUX_DIR([build-aux])AM_INIT_AUTOMAKE([1.11 -Wall -Werror])AC_CONFIG_FILES([Makefile])AC_PROG_CCAC_OUTPUTMakefile.ambin_PROGRAMS = mainmain_SOURCES =main.cmain.c#includeint main (){ printf("%s","appdemo"); return 0;}c. 生成文档autoreconf -i 提示的错误信息如下:Makefile.am: error: required file './NEWS' not foundMakefile.am: error: required file './README' not foundMakefile.am: error: required file './ChangeLog' not foundMakefile.am: installing './COPYING' using GNU General Public License v3 fileMakefile.am: Consider adding the COPYING file to the version control systemMakefile.am: for your code, to avoid questions about which license your project usesautoreconf: automake failed with exit status: 1解决方法list="INSTALL NEWS README AUTHORS ChangeLog COPYING"touch $list重新生成之后 ./configured. make && install make install 备注:或者使用autoscan 帮助生成部分代码,也是一个不错的选择
3. 一张参考图
4. 参考资料
https://github.com/rongfengliang/autoconf-demohttps://www.gnu.org/software/autoconf/autoconf.htmlhttps://github.com/rongfengliang/autoconf-project