Blame


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