Blob


1 AC_INIT([template], 1.0, [op@openbsd.org])
2 AC_CONFIG_LIBOBJ_DIR(../compat)
3 AM_INIT_AUTOMAKE([foreign subdir-objects])
5 AC_ARG_VAR(HOSTCC, [The C compiler on the host.])
6 AC_ARG_VAR(HOSTCFLAGS, [CFLAGS for the host compiler])
8 # When CFLAGS isn't set at this stage and gcc is detected by the macro below,
9 # autoconf will automatically use CFLAGS="-O2 -g". Prevent that by using an
10 # empty default.
11 : ${CFLAGS=""}
13 # Save user CPPFLAGS, CFLAGS and LDFLAGS. We need to change them because
14 # AC_CHECK_HEADER doesn't give us any other way to update the include
15 # paths. But for Makefile.am we want to use AM_CPPFLAGS and friends.
16 SAVED_CFLAGS="$CFLAGS"
18 test -n "$HOSTCC" && export CC="$HOSTCC"
19 test -n "$HOSTCFLAGS" && export CFLAGS="$SAVED_CFLAGS $HOSTCFLAGS"
21 AC_PROG_CC
22 AC_PROG_YACC
24 AM_CPPFLAGS="$CFLAGS"
26 AC_REPLACE_FUNCS([ \
27 asprintf \
28 err \
29 getprogname \
30 reallocarray \
31 ])
33 AC_CHECK_DECL([TAILQ_REMOVE], [],
34 [AC_MSG_ERROR("*** sys/queue.h is missing key defines ***")],
35 [#include <sys/queue.h>])
37 AC_CONFIG_FILES([Makefile])
38 AC_OUTPUT