代码清单 bogusapp.c
#include <stdio.h>
#include
<stdlib.h>
#ifdef HAVE_RESOLV_H
#include <resolv.h>
#endif
/* HAVE_RESOLV_H */
#include "config.h"
int main(void)
{
int
reval;
#ifdef HAVE_MMAP
fprintf(stdout, "have
mmap()\n");
#else
fprintf(stderr, "no
mmap()\n");
#endif
if(HAVE_UTIME_NULL)
fprintf(stdout, "utime()
allows NULL\n");
else
fprintf(stderr, "utime doesn't allow
NULL\n");
if(SYS_SIGLIST_DECLARED)
fprintf(stdout, "sys_siglist()
declared\n");
else
fprinf(stderr, "sys_siglist() not
declared\n");
#ifdef HAVE_NCURSES_H
fprintf(stdout, "ncurses.h
found\n");
#else
fprintf(stderr, "ncurses.h not
found\n);
if(HAVE_FCNTL_H)
fprintf(stdout, "fcntl.h
found\n");
else
fprintf(stderr, "fcntl.h not
found\n");
if(HAVE_SYS_FCNTL_H)
fprintf(stdout, "sys/fcntl.h
found\n");
else
fprintf(stderr, "sys/fcntl.h not
found\n");
#ifdef NLIST_NAME_UNION
fprintf(stdout, "nlist.n_un
member found\n");
#else
fprintf(stdout, "nlist.n_un member not
found\n");
#endif
if(HAVE_VOID_POINTER)
fprintf(stdout, "Yep, we
have a usable void pointer type\n");
else
fprintf(stderr, "Nope, no
usable void pointer
type\n");
exit(EXIT_SUCCESS);
}
.Makefiel.in--用于创建真正的makefile文件的模板
.acconfig.h--与特定系统相关的宏的集合,它随autoconf软件一起提供
.bogusapp.c--bogusapp的源代码,这是个示例程序
.config.h--包含bogusapp.c中用到的所有宏的头文件
.configure.in--创建最终的configure脚本的模板
.install.sh--安装脚本,用在不带兼容BSD的install程序的系统上
在目录下运行autoscan产生的configure.scan如下:
$autoscan
$cat
configure.scan
dnl Process this file with autoconf to produce a configure
script.
AC_INIT(acconfig.h)
dnl Checks for programs.
dnl Checks for
libraries.
dnl Checks for header files.
AC_HEADER_STDC
dnl Checks for
typedefs, structures, and compiler characteristics.
dnl Checks for library
functions.
AC_OUTPUT(Makefile)
ifnames的输出如下:
HAVE_MMAP
bogusapp.c
HAVE_NCURSES_H bogusapp.c
HAVE_RESOLV_H
bogusapp.c
HAVE_NAME_UNION bogusapp.c