2017.04.05
GNU autotools安装
要安装autotools需要如下几个文件
automake,autoconf,M4
安装顺序是M4 -> autoconf -> automake (重要)
安装需要的命令:
tar zxvf **
./configure
make
make install
mac下:
brew install autoconf
brew install automake
(没有装上M4也正常使用了)
autotools使用
源码目录如下
main.cpp
inc/test.h
src/test.cpp
1.手工编写Makefile.am这个文件
#Makefile.am
UTOMAKE_OPTIONS = foreign
bin_PROGRAMS = main
main_SOURCES = main.cpp inc/test.h src/test.cpp
mian_CPPFLAGS = -I include/
2.在源代码目录树的最高层运行autoscan。然后手动修改configure.scan文件,重命名为configure.ac
并修改内容:
AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS)
修改为:AC_INIT(main,0.0.1,abc@qq.com)
在AC_INIT(main,0.0.1,abc@qq.com)下一行添加
AM_INIT_AUTOMAKE(main