source: mod_gnutls/configure.ac @ e819f13

asyncioproxy-ticket
Last change on this file since e819f13 was e819f13, checked in by Fiona Klute <fiona.klute@…>, 12 months ago

Unconditionally enable early SNI parsing

All supported GnuTLS versions provide gnutls_ext_raw_parse(), so
there's no more need to provide a fallback for older versions.

  • Property mode set to 100644
File size: 9.7 KB
Line 
1AC_INIT(mod_gnutls, 0.9.1)
2OOO_CONFIG_NICE(config.nice)
3MOD_GNUTLS_VERSION=AC_PACKAGE_VERSION
4AC_PREREQ(2.53)
5AC_CONFIG_SRCDIR([src/mod_gnutls.c])
6AC_CONFIG_AUX_DIR(config)
7
8OOO_MAINTAIN_MODE
9AM_MAINTAINER_MODE
10AC_CANONICAL_TARGET
11# mod_gnutls test suite requires GNU make
12AM_INIT_AUTOMAKE([-Wno-portability])
13AM_CONFIG_HEADER(include/mod_gnutls_config.h:config.in)
14
15LT_INIT([disable-static])
16
17AC_SUBST(MOD_GNUTLS_VERSION)
18
19AC_PROG_CC
20AC_PROG_CC_C99
21AC_PROG_LD
22AC_PROG_INSTALL
23AC_PROG_LIBTOOL
24
25AC_CONFIG_MACRO_DIR([m4])
26
27AP_VERSION=2.4.17
28CHECK_APACHE(,$AP_VERSION,
29    :,:,
30    AC_MSG_ERROR([*** Apache version $AP_VERSION not found!])
31)
32
33dnl Maybe use the binaries for tests, too?
34AC_ARG_WITH([gnutls-dev],
35        AS_HELP_STRING([--with-gnutls-dev=DIR],
36                [Use GnuTLS libraries from a development (git) tree. Use \
37                this if you want to test mod_gnutls with the latest \
38                GnuTLS code.]),
39        [
40                AS_IF([test -d "${with_gnutls_dev}" ],
41                [
42                        LIBGNUTLS_CFLAGS="-I${with_gnutls_dev}/lib/includes"
43                        LIBGNUTLS_LIBS="-lgnutls -L${with_gnutls_dev}/lib/.libs -R${with_gnutls_dev}/lib/.libs"
44                ],
45                [AC_MSG_ERROR([--with-gnutls-dev=DIR requires a directory!])])
46        ], [])
47
48PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 3.6.3])
49
50LIBGNUTLS_VERSION=`pkg-config --modversion gnutls`
51
52AC_ARG_ENABLE(vpath-install,
53       AS_HELP_STRING([--enable-vpath-install],
54               [Modify the Apache module directory provided by apxs to \
55               follow --prefix, if necessary. Most users will not want this, \
56               but it is required for VPATH builds including "make \
57               distcheck".]),
58       vpath_install=$enableval, vpath_install=no)
59AM_CONDITIONAL([ENABLE_VPATH_INSTALL], [test "$vpath_install" = "yes"])
60
61AC_ARG_ENABLE(srp,
62       AS_HELP_STRING([--disable-srp],
63               [unconditionally disable the SRP functionality]),
64       use_srp=$enableval, use_srp=yes)
65
66# check if the available GnuTLS library supports SRP
67AC_SEARCH_LIBS([gnutls_srp_server_get_username], [gnutls], [], [use_srp="no"])
68
69GNUTLS_FEAT_CFLAGS=""
70if test "$use_srp" != "no"; then
71        GNUTLS_FEAT_CFLAGS="-DENABLE_SRP=1"
72fi
73
74AC_ARG_ENABLE(strict,
75       AS_HELP_STRING([--disable-strict],
76               [Avoid strict compiler warnings and errors]),
77       use_strict=$enableval, use_strict=yes)
78
79STRICT_CFLAGS=""
80if test "$use_strict" != "no"; then
81        STRICT_CFLAGS="-Wall -Werror -Wextra -Wno-error=deprecated-declarations"
82fi
83
84AC_MSG_CHECKING([whether to enable SRP functionality])
85AC_MSG_RESULT($use_srp)
86
87AM_PATH_PYTHON([3])
88AX_PYTHON_MODULE([yaml], [fatal])
89
90dnl Optionally disable flock
91AC_ARG_ENABLE(flock,
92        AS_HELP_STRING([--disable-flock], [Disable use of flock during tests \
93        (some exotic architectures don't support it)]),
94        [use_flock=$enableval], [use_flock=yes])
95# Check if flock is available and supports --timeout
96AC_PATH_PROG([FLOCK], [flock], [no])
97AS_IF([test "${FLOCK}" != "no"],
98      [
99        AC_MSG_CHECKING([whether ${FLOCK} supports --timeout])
100        lockfile="$(mktemp)"
101        AS_IF([${FLOCK} --timeout 1 ${lockfile} true >&AS_MESSAGE_LOG_FD 2>&1],
102              [flock_works="yes"], [flock_works="no"])
103        AC_MSG_RESULT([$flock_works])
104        # Old versions of flock do not support --verbose. They fail
105        # without executing the command but still return 0. Check for
106        # this behavior by testing if the rm command was executed.
107        AC_MSG_CHECKING([whether ${FLOCK} supports --verbose])
108        testfile="$(mktemp)"
109        AS_IF([${FLOCK} --verbose --timeout 1 ${lockfile} rm "${testfile}" \
110                        >&AS_MESSAGE_LOG_FD 2>&1; test ! -e "${testfile}"],
111              [flock_verbose="yes"; FLOCK="${FLOCK} --verbose"],
112              [flock_verbose="no"; rm "${testfile}"])
113        AC_MSG_RESULT([$flock_verbose])
114        rm "${lockfile}"
115      ],
116      [flock_works="no"])
117# disable flock if requested by user or it doesn't support timeout
118AM_CONDITIONAL([DISABLE_FLOCK],
119               [test "$enable_flock" = "no" || test "$flock_works" = "no"])
120
121# openssl is needed as the responder for OCSP tests
122AC_PATH_PROG([OPENSSL], [openssl], [no])
123AM_CONDITIONAL([ENABLE_OCSP_TEST], [test "${OPENSSL}" != "no"])
124
125dnl Enable test namespaces? Default is "yes".
126AC_ARG_ENABLE(test-namespaces,
127        AS_HELP_STRING([--disable-test-namespaces], [Disable use of \
128        namespaces for tests (limits parallelization)]),
129        [use_netns=$enableval], [use_netns=yes])
130
131# Check if "unshare" is available and has permission to create
132# network, IPC, and user namespaces
133AC_PATH_PROG([UNSHARE], [unshare], [no])
134AS_IF([test "${UNSHARE}" != "no"],
135      [
136        AC_MSG_CHECKING([for permission to use namespaces])
137        AS_IF([${UNSHARE} --net --ipc -r /bin/sh -c \
138                "ip link set up lo && ip addr show" >&AS_MESSAGE_LOG_FD 2>&1],
139              [unshare_works="yes"], [unshare_works="no"])
140        AC_MSG_RESULT([$unshare_works])
141      ],
142      [unshare_works="no"])
143# decide whether to enable network namespaces
144AS_IF([test "$enable_test_namespaces" != "no" \
145            && test "$unshare_works" = "yes"],
146      [use_netns="yes"], [use_netns="no"])
147AM_CONDITIONAL([ENABLE_NETNS], [test "$use_netns" != "no"])
148# Adjust Apache configuration for tests accordingly: Use pthread mutex
149# and test specific PID files if using namespaces, defaults otherwise.
150AS_IF([test "$use_netns" = "yes"],
151      [MUTEX_CONF="Mutex pthread default"; PID_AFFIX="-\${TEST_NAME}"],
152      [MUTEX_CONF=""; PID_AFFIX=""])
153AC_SUBST(MUTEX_CONF)
154AC_SUBST(PID_AFFIX)
155AM_SUBST_NOTMAKE(MUTEX_CONF)
156AM_SUBST_NOTMAKE(PID_AFFIX)
157
158AC_ARG_ENABLE(msva,
159       AS_HELP_STRING([--enable-msva],
160               [enable Monkeysphere client certificate verification]),
161       use_msva=$enableval, use_msva=no)
162AM_CONDITIONAL([USE_MSVA], [test "$use_msva" != "no"])
163
164MSVA_CFLAGS=""
165if test "$use_msva" != "no"; then
166        AC_CHECK_HEADERS([msv/msv.h], [],
167                         [AC_MSG_ERROR([*** No libmsv headers found!])])
168        AC_SEARCH_LIBS([msv_query_agent], [msv], [],
169                         [AC_MSG_ERROR([*** No libmsv found with msv_query_agent!])])
170        MSVA_CFLAGS="-DENABLE_MSVA=1"
171fi
172
173AC_MSG_CHECKING([whether to enable MSVA functionality])
174AC_MSG_RESULT($use_msva)
175
176# Building documentation requires pandoc, which in turn needs pdflatex
177# to build PDF output.
178build_doc=no
179AC_PATH_PROG([PANDOC], [pandoc], [no])
180if test "$PANDOC" != "no"; then
181        AC_PATH_PROG([PDFLATEX], [pdflatex], [no])
182        if test "$PDFLATEX" != "no"; then
183                build_doc="html, manual page, pdf"
184        else
185                build_doc="html, manual page"
186        fi
187else
188        AC_PATH_PROG([MARKDOWN], [markdown], [no])
189        if test "$MARKDOWN" != "no"; then
190                build_doc="html stub"
191        fi
192fi
193AM_CONDITIONAL([USE_PANDOC], [test "$PANDOC" != "no"])
194AM_CONDITIONAL([USE_PDFLATEX], [test "$PANDOC" != "no" && \
195                               test "$PDFLATEX" != "no"])
196AM_CONDITIONAL([USE_MARKDOWN], [test -n "$MARKDOWN" && \
197                               test "$MARKDOWN" != "no"])
198
199# Check for Apache binary
200AC_PATH_PROGS([APACHE2], [apache2 httpd], [no], [$PATH:/usr/sbin])
201if test "${APACHE2}" = "no"; then
202        AC_MSG_WARN([Neither apache2 nor httpd found in \
203                     PATH. Test suite will fail.])
204fi
205
206AC_PATH_PROGS([HTTP_CLI], [curl], [no])
207
208MODULE_CFLAGS="${LIBGNUTLS_CFLAGS} ${GNUTLS_FEAT_CFLAGS} ${MSVA_CFLAGS} ${APXS_CFLAGS} ${AP_INCLUDES} ${APR_INCLUDES} ${APU_INCLUDES} ${STRICT_CFLAGS}"
209MODULE_LIBS="${LIBGNUTLS_LIBS}"
210
211AC_PATH_PROGS([SOFTHSM], [softhsm2-util], [no])
212AM_CONDITIONAL([HAVE_SOFTHSM], [test "${SOFTHSM}" != "no"])
213
214AC_SUBST(MODULE_CFLAGS)
215AC_SUBST(MODULE_LIBS)
216
217# assign default values to TEST_HOST and TEST_IP if necessary
218: ${TEST_HOST:="localhost"}
219: ${TEST_IP:="[[::1]] 127.0.0.1"}
220AC_ARG_VAR([TEST_HOST], [Host name to use for server instances started by \
221                        "make check", must resolve to addresses in TEST_IP. \
222                        The default is "localhost".])
223AC_ARG_VAR([TEST_IP], [List of IP addresses to use for server instances \
224                      started by "make check". The default is \
225                      "[::1] 127.0.0.1". Note that IPv6 addresses must be \
226                      enclosed in square brackets.])
227
228: ${TEST_LOCK_WAIT:="30"}
229: ${TEST_QUERY_TIMEOUT:="30"}
230AC_ARG_VAR([TEST_LOCK_WAIT], [Timeout in seconds to acquire locks for \
231                             Apache instances in the test suite, or the \
232                             previous instance to remove its PID file if \
233                             flock is not used. Default is 30.])
234AC_ARG_VAR([TEST_QUERY_TIMEOUT], [Timeout in seconds for HTTPS requests \
235                                 sent using gnutls-cli in the test suite. \
236                                 Default is 30.])
237
238dnl Allow user to set SoftHSM PKCS #11 module
239AC_ARG_VAR([SOFTHSM_LIB], [Absolute path of the SoftHSM PKCS @%:@11 module to \
240                          use. By default the test suite will search common \
241                          library paths.])
242
243dnl Build list of "Listen" statements for Apache
244LISTEN_LIST="@%:@ Listen addresses for the test servers"
245for i in ${TEST_IP}; do
246        LISTEN_LIST="${LISTEN_LIST}
247Listen ${i}:\${TEST_PORT}"
248done
249# Available extra ports, tests can "Define" variables of the listed
250# names in their apache.conf to enable them.
251for j in TEST_HTTP_PORT; do
252LISTEN_LIST="${LISTEN_LIST}
253<IfDefine ${j}>"
254for i in ${TEST_IP}; do
255        LISTEN_LIST="${LISTEN_LIST}
256        Listen ${i}:\${${j}}"
257done
258LISTEN_LIST="${LISTEN_LIST}
259</IfDefine>"
260done
261AC_SUBST(LISTEN_LIST)
262AM_SUBST_NOTMAKE(LISTEN_LIST)
263
264DX_DOXYGEN_FEATURE(ON)
265DX_DOT_FEATURE(ON)
266DX_HTML_FEATURE(ON)
267DX_MAN_FEATURE(OFF)
268DX_RTF_FEATURE(OFF)
269DX_XML_FEATURE(OFF)
270DX_PDF_FEATURE(OFF)
271DX_PS_FEATURE(OFF)
272DX_INIT_DOXYGEN([mod_gnutls], [doc/doxygen.conf], [doc/api])
273
274AC_CONFIG_FILES([Makefile src/Makefile test/Makefile test/tests/Makefile \
275                        doc/Makefile doc/doxygen.conf include/mod_gnutls.h \
276                        test/proxy_backend.conf test/ocsp_server.conf \
277                        test/apache-conf/listen.conf \
278                        test/apache-conf/netns.conf])
279AC_OUTPUT
280
281echo "---"
282echo "Configuration summary for mod_gnutls:"
283echo ""
284echo "   * mod_gnutls version:  ${MOD_GNUTLS_VERSION}"
285echo "   * Apache Modules directory:    ${AP_LIBEXECDIR}"
286echo "   * GnuTLS Library version:      ${LIBGNUTLS_VERSION}"
287echo "   * CFLAGS for GnuTLS:           ${LIBGNUTLS_CFLAGS}"
288echo "   * LDFLAGS for GnuTLS:  ${LIBGNUTLS_LIBS}"
289echo "   * SRP Authentication:  ${use_srp}"
290echo "   * MSVA Client Verification:    ${use_msva}"
291echo "   * Build documentation: ${build_doc}"
292echo ""
293echo "---"
Note: See TracBrowser for help on using the repository browser.