- 2006-12-22
- programming
何回やっても覚えられないので最低限のことだけ。
ソースファイルを作る。
#include <stdio.h> #include "config.h" int main(int argc, char **argv) { printf("hello, world\n"); return 0; }(どうせ捨てるけど)Makefile も作っておく。空でいい。
autoscan を実行し、できた configure.scan を configure.ac にコピー。
configure.ac を編集。AC_INIT を直すのと、AM_INIT_AUTOMAKE を追加。
aclocal, autoconf, autoheader を実行。
# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) #AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS) AC_INIT(hello, 0.0.0, iakio@mono-space.net) AC_CONFIG_SRCDIR([hello.c]) AC_CONFIG_HEADER([config.h]) AM_INIT_AUTOMAKE # 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_CONFIG_FILES([Makefile]) AC_OUTPUTMakefile.am を作る
bin_PROGRAMS = hello hello_SOURCES = hello.cautomake --foreign --add-missing