1、 新建一个文件夹hello,进入hello文件夹,新建hello.c文件。
2、使用gcc -c hello.c
命令检查hello.c是否有语法错误。
3、安装autoscan命令,autoscan和autoheader都包含在autoconf工具中,所以只要安装autoconfig就可以了。
4、安装aclocal和automake。其中aclocal包含在automake工具中。
5、 执行autoscan,生成configure.scan.
6、修改configure.scan并重命名为configure.in。因为aclocal需要名为configure.in或configure.ac的文件。
7、运行aclocal和autoconf生成aclocal.m4和configure两个文件。
8、执行autoheader命令生成config.h.in
9、编写Makefile.am文件。
10、执行automake --add-missing
命令。
11、执行./configure
生成Makefile。
12、最后运行make
命令进行编译生成可执行文件hello并运行。
13、运行成功,大功告成!!!