1)建立工作目录
mkdir hello/
cd hello/
2) 创建文件
vim hello.cpp
3) 生成configure
autoscan
mv configure.scan configure.in
编辑configure.in:
vim configure.in
a)最开始加上
AC_INIT(hello.cpp)
AC_INIT_AUTOMAKE(hello, 1.0)
b)删去config的几行
c)最后一行改为AC_OUTPUT(Makefile)
4) 执行
aclocal
autoconf
生成aclocal.m4和configure等
5) 新建Makefile.am:
vim Makefile.am
写入
AUTOMAKE_OPTIONS=foreign
bin_PROGRAMS=hello
hello_SOURSES=hello.cpp
6) 运行automake
automake --add-missing
生成Makefile.in等
7) 执行configure
./configure
生成Makefile
8) make