1 dnl Process this file with autoconf to produce a configure script.
3 dnl This configure.in is only for building a standalone argp library.
5 AC_INIT([argp], [standalone-1.1])
6 AC_CONFIG_SRCDIR([argp-ba.c])
8 AM_CONFIG_HEADER([config.h])
10 # GNU libc defaults to supplying the ISO C library functions only. The
11 # _GNU_SOURCE define enables these extensions, in particular we want
12 # errno.h to declare program_invocation_name. Enable it on all
13 # systems; no problems have been reported with it so far.
15 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
17 dnl Checks for programs.
23 if test "x$am_cv_prog_cc_stdc" = xno ; then
24 AC_ERROR([the C compiler doesn't handle ANSI-C])
27 dnl Checks for libraries.
29 dnl Checks for header files.
31 AC_CHECK_HEADERS(limits.h malloc.h unistd.h)
33 dnl Checks for typedefs, structures, and compiler characteristics.
38 dnl Checks for library functions.
41 AC_CHECK_FUNCS(strerror)
43 AC_REPLACE_FUNCS(mempcpy strndup strchrnul)
44 AC_CHECK_FUNCS(flockfile putc_unlocked)
45 AC_CHECK_FUNCS(fputs_unlocked fwrite_unlocked)
47 dnl Used only by argp-test.c, so don't use AC_REPLACE_FUNCS.
48 AC_CHECK_FUNCS(strdup asprintf)
50 AH_TEMPLATE([HAVE_PROGRAM_INVOCATION_NAME],
51 [Define if the variable exists (usually provided by the linker).])
52 AH_TEMPLATE([HAVE_PROGRAM_INVOCATION_SHORT_NAME],
53 [Define if the variable exists (usually provided by the linker).])
55 ARGP_CHECK_VAR(program_invocation_name, [#include <errno.h>])
56 ARGP_CHECK_VAR(program_invocation_short_name, [#include <errno.h>])
58 # Set these flags *last*, or else the test programs won't compile
59 if test x$GCC = xyes ; then
60 # Using -ggdb3 makes (some versions of) Redhat's gcc-2.96 dump core
61 if "$CC" --version | grep '^2\.96$' 1>/dev/null 2>&1; then
64 CFLAGS="$CFLAGS -ggdb3"
66 CFLAGS="$CFLAGS -Wall -W \
67 -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes \
69 -Wpointer-arith -Wbad-function-cast -Wnested-externs"
72 CPPFLAGS="$CPPFLAGS -I$srcdir"