- 准备
下载如下工具或组件:autoconf,automake,m4,libtool,perl,crypt。 下载地址:http://sourceforge.net/projects/mingw/files/MSYS/ 其中autoconf,automake是主要使用工具;m4,libtool是必要工具;perl是支撑工具;crypt是支撑库。libtool和crypt以库的形式下载。
- automake组件的功能
- libtoolize: this copies/links a few support scripts, including ltmain.sh.
- aclocal: this looks up all m4 macros that your configure script will need make a local copy for easier access.
- autoheader: if you want to use config.h/AC_CONFIG_HEADERS, otherwise all the test result macros will be inlined when you call the compiler.
- autoconf: to expand all the macros used by configure.ac into the configure script.
- automake: to convert all the Makefile.am into Makefile.in templates. You probably want to invoke this with --add-missing so additional support scripts can be linked/copied to your project (such as compile, missing, depcomp, test-driver, etc).
- automake使用方法
- 运行libtoolize命令,产生ltmain.sh文件;
- 运行autoscan命令,产生configure.scan文件;
- 将configure.scan 文件重命名为configure.in,并修改configure.in文件;
- 运行aclocal命令,产生aclocal.m4文件;
- 运行autoconf命令,产生configure文件;
- 新建Makefile.am文件,新建NEWS、 README、 ChangeLog 、AUTHORS文件;
- 修改Makefile.am,并运行automake -a命令;(automake --add-missing)
- 运行./confiugre脚本。
- 至此,Makefile已生产,然后执行make编译即可。
其中configure.in的修改,Makefile.am的修改。可参考其他网上资料。
- 参考
http://www.ibm.com/developerworks/cn/linux/l-makefile/ (复杂例子)
http://tech.sina.com.cn/s/2004-10-19/1115443045.shtml (简单例子)
http://www.cnblogs.com/crazyhack/archive/2011/12/17/2291410.html