假如我目錄下有 hello.c a.c兩個檔案
執行步驟:
1.#autoscan 產生 configure.scan
2.修改 configure.scan
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.64])
AC_INIT(hello, 0.1, ecken@ecken.com)
AM_INIT_AUTOMAKE(hello,0.1)
AC_CONFIG_SRCDIR([hello.c])
#AC_CONFIG_HEADERS([config.h])
# Checks for programs.
AC_PROG_CC
# Checks for libraries.
# Checks for header files.
# Checks for typedefs, structures, and compiler characteristics.
# Checks for library functions.
AC_OUTPUT(Makefile)
3.更改configure.scan檔名
#mv configure.scan configure.in
4.執行 aclocal
# aclocal
5.執行 autoconf
#autoconf
6.自行編輯Makefile.am
#vi Makefile.am
AUTOMAKE_OPTIONS=foreign
bin_PROGRAMS=hello
hello_SOURCES=hello.c a.c
7.執行automake 產生Makefile.in
# automake -a
這樣就可以執行./configure 產生Makefile
所以整個需要須改手動更改新增的檔案有configure.in, Makefile.am
參考資料:
邱小新の工作筆記
陳雍穆(armor)
zjsxycli的空間