source: mod_gnutls/configure.ac @ a08b25e

debian/masterdebian/stretch-backportsjessie-backportsupstream
Last change on this file since a08b25e was a08b25e, checked in by Thomas Klute <thomas2.klute@…>, 4 years ago

Test suite: Listen on IPv6 and IPv4 loopback by default

Distributions handle host names for loopback addresses and their
resolution differently, which caused trouble with the previous
defaults of TEST_HOST=localhost and TEST_IP=[::1]. While they work
fine on Debian, tests on Ubuntu failed apparently randomly because
connections to localhost sometimes used 127.0.0.1, and setting
TEST_IP=127.0.0.1 would sometimes be hit by the opposite effect.

The best solution seems to be to let the test servers listen on both
IPv4 and IPv6 loopback addresses (127.0.0.1 and [::1]): "localhost"
should always resolve to at least one of them, so we don't have to
care about the details. Apache handles the transport layer anyway, so
this change will not hide bugs in mod_gnutls itself.

Listening on both addresses is achieved by treating TEST_IP as a list
of addresses to listen on, changing the default to "[::1] 127.0.0.1",
and building a config file containing "Listen" directives for the test
servers from that. With this change there is no need to export TEST_IP
to the test environment any more.

Users who want to set their own TEST_IP can do so as before, but
should note that IPv6 addresses must be enclosed in square brackets.

  • Property mode set to 100644
File size: 4.6 KB
Line 
1dnl
2AC_INIT(mod_gnutls, 0.7.2)
3OOO_CONFIG_NICE(config.nice)
4MOD_GNUTLS_VERSION=AC_PACKAGE_VERSION
5AC_PREREQ(2.53)
6AC_CONFIG_SRCDIR([src/mod_gnutls.c])
7AC_CONFIG_AUX_DIR(config)
8
9OOO_MAINTAIN_MODE
10AM_MAINTAINER_MODE
11AC_CANONICAL_TARGET
12# mod_gnutls test suite requires GNU make
13AM_INIT_AUTOMAKE([-Wno-portability])
14AM_CONFIG_HEADER(include/mod_gnutls_config.h:config.in)
15
16AC_SUBST(MOD_GNUTLS_VERSION)
17
18AC_PROG_CC
19AC_PROG_CC_C99
20AC_PROG_LD
21AC_PROG_INSTALL
22AC_PROG_LIBTOOL
23
24AC_CONFIG_MACRO_DIR([m4])
25
26AP_VERSION=2.2.0
27CHECK_APACHE(,$AP_VERSION,
28    :,:,
29    AC_MSG_ERROR([*** Apache version $AP_VERSION not found!])
30)
31
32PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 3.1.4])
33
34LIBGNUTLS_VERSION=`pkg-config --modversion gnutls`
35
36AC_ARG_ENABLE(srp,
37       AS_HELP_STRING([--disable-srp],
38               [unconditionally disable the SRP functionality]),
39       use_srp=$enableval, use_srp=yes)
40
41# check if the available GnuTLS library supports SRP
42AC_SEARCH_LIBS([gnutls_srp_server_get_username], [gnutls], [], [use_srp="no"])
43
44SRP_CFLAGS=""
45if test "$use_srp" != "no"; then
46        SRP_CFLAGS="-DENABLE_SRP=1"
47fi
48
49AC_ARG_ENABLE(strict,
50       AS_HELP_STRING([--disable-strict],
51               [Avoid strict compiler warnings and errors]),
52       use_strict=$enableval, use_strict=yes)
53
54STRICT_CFLAGS=""
55if test "$use_strict" != "no"; then
56        STRICT_CFLAGS="-Wall -Werror -Wextra"
57fi
58
59AC_MSG_CHECKING([whether to enable SRP functionality])
60AC_MSG_RESULT($use_srp)
61
62AC_ARG_ENABLE(msva,
63       AS_HELP_STRING([--enable-msva],
64               [enable Monkeysphere client certificate verification]),
65       use_msva=$enableval, use_msva=no)
66AM_CONDITIONAL([USE_MSVA], [test "$use_msva" != "no"])
67
68MSVA_CFLAGS=""
69if test "$use_msva" != "no"; then
70        AC_CHECK_HEADERS([msv/msv.h], [],
71                         [AC_MSG_ERROR([*** No libmsv headers found!])])
72        AC_SEARCH_LIBS([msv_query_agent], [msv], [],
73                         [AC_MSG_ERROR([*** No libmsv found with msv_query_agent!])])
74        MSVA_CFLAGS="-DENABLE_MSVA=1"
75fi
76
77AC_MSG_CHECKING([whether to enable MSVA functionality])
78AC_MSG_RESULT($use_msva)
79
80have_apr_memcache=0
81CHECK_APR_MEMCACHE([have_apr_memcache=1], [have_apr_memcache=0])
82AC_SUBST(have_apr_memcache)
83
84# Building documentation requires pandoc, which in turn needs pdflatex
85# to build PDF output.
86build_doc=no
87AC_PATH_PROG([PANDOC], [pandoc], [no])
88if test "$PANDOC" != "no"; then
89        AC_PATH_PROG([PDFLATEX], [pdflatex], [no])
90        if test "$PDFLATEX" != "no"; then
91                build_doc=yes
92        else
93                build_doc="html only"
94        fi
95else
96        AC_PATH_PROG([MARKDOWN], [markdown], [no])
97        if test "$MARKDOWN" != "no"; then
98                build_doc="html stub"
99        fi
100fi
101AM_CONDITIONAL([USE_PANDOC], [test "$PANDOC" != "no"])
102AM_CONDITIONAL([USE_PDFLATEX], [test "$PANDOC" != "no" && \
103                               test "$PDFLATEX" != "no"])
104AM_CONDITIONAL([USE_MARKDOWN], [test -n "$MARKDOWN" && \
105                               test "$MARKDOWN" != "no"])
106
107# Check for Apache binary
108AC_PATH_PROGS([APACHE2], [apache2 httpd], [no], [$PATH:/usr/sbin])
109if test "${APACHE2}" = "no"; then
110        AC_MSG_WARN([Neither apache2 nor httpd found in \
111                     PATH. Test suite will fail.])
112fi
113
114MODULE_CFLAGS="${LIBGNUTLS_CFLAGS} ${SRP_CFLAGS} ${MSVA_CFLAGS} ${APR_MEMCACHE_CFLAGS} ${APXS_CFLAGS} ${AP_INCLUDES} ${APR_INCLUDES} ${APU_INCLUDES} ${STRICT_CFLAGS}"
115MODULE_LIBS="${APR_MEMCACHE_LIBS} ${LIBGNUTLS_LIBS}"
116
117AC_SUBST(MODULE_CFLAGS)
118AC_SUBST(MODULE_LIBS)
119
120# assign default values to TEST_HOST and TEST_IP if necessary
121: ${TEST_HOST:="localhost"}
122: ${TEST_IP:="[[::1]] 127.0.0.1"}
123AC_ARG_VAR([TEST_HOST], [Host name to use for server instances started by \
124                        "make check", must resolve to addresses in TEST_IP. \
125                        The default is "localhost".])
126AC_ARG_VAR([TEST_IP], [List of IP addresses to use for server instances \
127                      started by "make check". The default is \
128                      "[::1] 127.0.0.1". Note that IPv6 addresses must be \
129                      enclosed in square brackets.])
130AM_SUBST_NOTMAKE(TEST_IP)
131
132dnl Build list of "Listen" statements for Apache
133LISTEN_LIST="# Listen addresses for the test servers"
134for i in ${TEST_IP}; do
135        LISTEN_LIST="${LISTEN_LIST}
136Listen ${i}:\${TEST_PORT}"
137done
138AC_SUBST(LISTEN_LIST)
139AM_SUBST_NOTMAKE(LISTEN_LIST)
140
141AC_CONFIG_FILES([Makefile src/Makefile test/Makefile test/tests/Makefile \
142                          doc/Makefile include/mod_gnutls.h test/listen.conf])
143AC_OUTPUT
144
145echo "---"
146echo "Configuration summary for mod_gnutls:"
147echo ""
148echo "   * mod_gnutls version:  ${MOD_GNUTLS_VERSION}"
149echo "   * Apache Modules directory:    ${AP_LIBEXECDIR}"
150echo "   * GnuTLS Library version:      ${LIBGNUTLS_VERSION}"
151echo "   * SRP Authentication:  ${use_srp}"
152echo "   * MSVA Client Verification:    ${use_msva}"
153echo "   * Build documentation: ${build_doc}"
154echo ""
155echo "---"
Note: See TracBrowser for help on using the repository browser.