source: mod_gnutls/configure.ac @ 0202d6b

debian/masterdebian/stretch-backportsupstream mod_gnutls/0.8.2
Last change on this file since 0202d6b was 0202d6b, checked in by Thomas Klute <thomas2.klute@…>, 22 months ago

Release version 0.8.2

  • Property mode set to 100644
File size: 9.4 KB
Line 
1dnl
2AC_INIT(mod_gnutls, 0.8.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
16LT_INIT([disable-static])
17
18AC_SUBST(MOD_GNUTLS_VERSION)
19
20AC_PROG_CC
21AC_PROG_CC_C99
22AC_PROG_LD
23AC_PROG_INSTALL
24AC_PROG_LIBTOOL
25
26AC_CONFIG_MACRO_DIR([m4])
27
28AP_VERSION=2.4.0
29CHECK_APACHE(,$AP_VERSION,
30    :,:,
31    AC_MSG_ERROR([*** Apache version $AP_VERSION not found!])
32)
33
34PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 3.3.0])
35
36LIBGNUTLS_VERSION=`pkg-config --modversion gnutls`
37
38AC_ARG_ENABLE(vpath-install,
39       AS_HELP_STRING([--enable-vpath-install],
40               [Modify the Apache module directory provided by apxs to \
41               follow --prefix, if necessary. Most users will not want this, \
42               but it is required for VPATH builds including "make \
43               distcheck".]),
44       vpath_install=$enableval, vpath_install=no)
45AM_CONDITIONAL([ENABLE_VPATH_INSTALL], [test "$vpath_install" = "yes"])
46
47AC_ARG_ENABLE(srp,
48       AS_HELP_STRING([--disable-srp],
49               [unconditionally disable the SRP functionality]),
50       use_srp=$enableval, use_srp=yes)
51
52# check if the available GnuTLS library supports SRP
53AC_SEARCH_LIBS([gnutls_srp_server_get_username], [gnutls], [], [use_srp="no"])
54
55SRP_CFLAGS=""
56if test "$use_srp" != "no"; then
57        SRP_CFLAGS="-DENABLE_SRP=1"
58fi
59
60AC_ARG_ENABLE(strict,
61       AS_HELP_STRING([--disable-strict],
62               [Avoid strict compiler warnings and errors]),
63       use_strict=$enableval, use_strict=yes)
64
65STRICT_CFLAGS=""
66if test "$use_strict" != "no"; then
67        STRICT_CFLAGS="-Wall -Werror -Wextra"
68fi
69
70AC_MSG_CHECKING([whether to enable SRP functionality])
71AC_MSG_RESULT($use_srp)
72
73dnl Optionally disable flock
74AC_ARG_ENABLE(flock,
75        AS_HELP_STRING([--disable-flock], [Disable use of flock during tests \
76        (some exotic architectures don't support it)]),
77        [use_flock=$enableval], [use_flock=yes])
78# Check if flock is available and supports --timeout
79AC_PATH_PROG([FLOCK], [flock], [no])
80AS_IF([test "${FLOCK}" != "no"],
81      [
82        AC_MSG_CHECKING([whether ${FLOCK} supports --timeout])
83        lockfile="$(mktemp)"
84        AS_IF([${FLOCK} --timeout 1 ${lockfile} true >&AS_MESSAGE_LOG_FD 2>&1],
85              [flock_works="yes"], [flock_works="no"])
86        rm "${lockfile}"
87        AC_MSG_RESULT([$flock_works])
88      ],
89      [flock_works="no"])
90# disable flock if requested by user or it doesn't support timeout
91AM_CONDITIONAL([DISABLE_FLOCK],
92               [test "$enable_flock" = "no" || test "$flock_works" = "no"])
93
94# openssl is needed as the responder for OCSP tests
95AC_PATH_PROG([OPENSSL], [openssl], [no])
96# OCSP checks with gnutls-cli from GnuTLS versions before 3.3.23,
97# 3.4.12, or 3.5.1 (on the respective 3.x branch) fail if intermediate
98# CAs cannot be status checked, even if there are no intermediate CAs
99# like in the mod_gnutls test suite where end entity certificates are
100# directly issued by a root CA.
101AC_MSG_CHECKING([for gnutls-cli version supporting OCSP for EE under root CA])
102AC_PREPROC_IFELSE(
103        [AC_LANG_SOURCE([[#include "gnutls/gnutls.h"
104                        #if GNUTLS_VERSION_NUMBER < 0x030317
105                        #error
106                        #elif GNUTLS_VERSION_NUMBER >= 0x030400 && GNUTLS_VERSION_NUMBER < 0x03040c
107                        #error
108                        #elif GNUTLS_VERSION_NUMBER == 0x030500
109                        #error
110                        #endif
111                        ]])],
112        [gnutls_ocsp_ok="yes"],
113        [gnutls_ocsp_ok="no"],
114)
115AC_MSG_RESULT([$gnutls_ocsp_ok])
116AM_CONDITIONAL([ENABLE_OCSP_TEST], [test "${OPENSSL}" != "no" && test "${gnutls_ocsp_ok}" = "yes"])
117
118dnl Enable test namespaces? Default is "yes".
119AC_ARG_ENABLE(test-namespaces,
120        AS_HELP_STRING([--disable-test-namespaces], [Disable use of network \
121        namespaces to run tests in parallel (some architectures might not \
122        support it)]),
123        [use_netns=$enableval], [use_netns=yes])
124
125# Check if "unshare" is available and has permission to create network
126# and user namespaces
127AC_PATH_PROG([UNSHARE], [unshare], [no])
128AS_IF([test "${UNSHARE}" != "no"],
129      [
130        AC_MSG_CHECKING([for permission to create network and user namespaces])
131        AS_IF([${UNSHARE} --net -r /bin/sh -c \
132                "ip link set up lo && ip addr show" >&AS_MESSAGE_LOG_FD 2>&1],
133              [unshare_works="yes"], [unshare_works="no"])
134        AC_MSG_RESULT([$unshare_works])
135      ],
136      [unshare_works="no"])
137# decide whether to enable network namespaces
138AS_IF([test "$enable_test_namespaces" != "no" \
139            && test "$unshare_works" = "yes"],
140      [use_netns="yes"], [use_netns="no"])
141AM_CONDITIONAL([ENABLE_NETNS], [test "$use_netns" != "no"])
142# Adjust Apache configuration for tests accordingly: Use pthread mutex
143# and test specific PID files if using namespaces, defaults otherwise.
144AS_IF([test "$use_netns" = "yes"],
145      [MUTEX_TYPE="pthread"; PID_AFFIX="-\${TEST_NAME}"],
146      [MUTEX_TYPE="default"; PID_AFFIX=""])
147AC_SUBST(MUTEX_TYPE)
148AC_SUBST(PID_AFFIX)
149AM_SUBST_NOTMAKE(MUTEX_TYPE)
150AM_SUBST_NOTMAKE(PID_AFFIX)
151
152AC_ARG_ENABLE(msva,
153       AS_HELP_STRING([--enable-msva],
154               [enable Monkeysphere client certificate verification]),
155       use_msva=$enableval, use_msva=no)
156AM_CONDITIONAL([USE_MSVA], [test "$use_msva" != "no"])
157
158MSVA_CFLAGS=""
159if test "$use_msva" != "no"; then
160        AC_CHECK_HEADERS([msv/msv.h], [],
161                         [AC_MSG_ERROR([*** No libmsv headers found!])])
162        AC_SEARCH_LIBS([msv_query_agent], [msv], [],
163                         [AC_MSG_ERROR([*** No libmsv found with msv_query_agent!])])
164        MSVA_CFLAGS="-DENABLE_MSVA=1"
165fi
166
167AC_MSG_CHECKING([whether to enable MSVA functionality])
168AC_MSG_RESULT($use_msva)
169
170have_apr_memcache=0
171CHECK_APR_MEMCACHE([have_apr_memcache=1], [have_apr_memcache=0])
172AC_SUBST(have_apr_memcache)
173
174# Building documentation requires pandoc, which in turn needs pdflatex
175# to build PDF output.
176build_doc=no
177AC_PATH_PROG([PANDOC], [pandoc], [no])
178if test "$PANDOC" != "no"; then
179        AC_PATH_PROG([PDFLATEX], [pdflatex], [no])
180        if test "$PDFLATEX" != "no"; then
181                build_doc=yes
182        else
183                build_doc="html only"
184        fi
185else
186        AC_PATH_PROG([MARKDOWN], [markdown], [no])
187        if test "$MARKDOWN" != "no"; then
188                build_doc="html stub"
189        fi
190fi
191AM_CONDITIONAL([USE_PANDOC], [test "$PANDOC" != "no"])
192AM_CONDITIONAL([USE_PDFLATEX], [test "$PANDOC" != "no" && \
193                               test "$PDFLATEX" != "no"])
194AM_CONDITIONAL([USE_MARKDOWN], [test -n "$MARKDOWN" && \
195                               test "$MARKDOWN" != "no"])
196
197# Check for Apache binary
198AC_PATH_PROGS([APACHE2], [apache2 httpd], [no], [$PATH:/usr/sbin])
199if test "${APACHE2}" = "no"; then
200        AC_MSG_WARN([Neither apache2 nor httpd found in \
201                     PATH. Test suite will fail.])
202fi
203
204AC_PATH_PROGS([HTTP_CLI], [curl wget], [no])
205
206MODULE_CFLAGS="${LIBGNUTLS_CFLAGS} ${SRP_CFLAGS} ${MSVA_CFLAGS} ${APR_MEMCACHE_CFLAGS} ${APXS_CFLAGS} ${AP_INCLUDES} ${APR_INCLUDES} ${APU_INCLUDES} ${STRICT_CFLAGS}"
207MODULE_LIBS="${APR_MEMCACHE_LIBS} ${LIBGNUTLS_LIBS}"
208
209AC_PATH_PROGS([SOFTHSM], [softhsm2-util softhsm], [no])
210if test "${SOFTHSM}" != "no"; then
211        softhsm_version=$(${SOFTHSM} --version)
212        AS_VERSION_COMPARE([$(${SOFTHSM} --version)], [2.0.0],
213                           [AC_SUBST(SOFTHSM_MAJOR_VERSION, [1])],
214                           [AC_SUBST(SOFTHSM_MAJOR_VERSION, [2])],
215                           [AC_SUBST(SOFTHSM_MAJOR_VERSION, [2])])
216fi
217AM_CONDITIONAL([HAVE_SOFTHSM], [test "${SOFTHSM}" != "no"])
218AM_CONDITIONAL([HAVE_SOFTHSM1], [test "${SOFTHSM_MAJOR_VERSION}" = "1"])
219AM_CONDITIONAL([HAVE_SOFTHSM2], [test "${SOFTHSM_MAJOR_VERSION}" = "2"])
220
221AC_SUBST(MODULE_CFLAGS)
222AC_SUBST(MODULE_LIBS)
223
224# assign default values to TEST_HOST and TEST_IP if necessary
225: ${TEST_HOST:="localhost"}
226: ${TEST_IP:="[[::1]] 127.0.0.1"}
227AC_ARG_VAR([TEST_HOST], [Host name to use for server instances started by \
228                        "make check", must resolve to addresses in TEST_IP. \
229                        The default is "localhost".])
230AC_ARG_VAR([TEST_IP], [List of IP addresses to use for server instances \
231                      started by "make check". The default is \
232                      "[::1] 127.0.0.1". Note that IPv6 addresses must be \
233                      enclosed in square brackets.])
234AM_SUBST_NOTMAKE(TEST_IP)
235
236dnl Allow user to set SoftHSM PKCS #11 module
237AC_ARG_VAR([SOFTHSM_LIB], [Absolute path of the SoftHSM PKCS @%:@11 module to \
238                          use. By default the test suite will search common \
239                          library paths.])
240
241dnl Build list of "Listen" statements for Apache
242LISTEN_LIST="@%:@ Listen addresses for the test servers"
243for i in ${TEST_IP}; do
244        LISTEN_LIST="${LISTEN_LIST}
245Listen ${i}:\${TEST_PORT}"
246done
247# Available extra ports, tests can "Define" variables of the listed
248# names in their apache.conf to enable them.
249for j in TEST_HTTP_PORT OCSP_PORT; do
250LISTEN_LIST="${LISTEN_LIST}
251<IfDefine ${j}>"
252for i in ${TEST_IP}; do
253        LISTEN_LIST="${LISTEN_LIST}
254        Listen ${i}:\${${j}}"
255done
256LISTEN_LIST="${LISTEN_LIST}
257</IfDefine>"
258done
259AC_SUBST(LISTEN_LIST)
260AM_SUBST_NOTMAKE(LISTEN_LIST)
261
262DX_DOXYGEN_FEATURE(ON)
263DX_DOT_FEATURE(ON)
264DX_HTML_FEATURE(ON)
265DX_MAN_FEATURE(OFF)
266DX_RTF_FEATURE(OFF)
267DX_XML_FEATURE(OFF)
268DX_PDF_FEATURE(ON)
269DX_PS_FEATURE(OFF)
270DX_INIT_DOXYGEN([mod_gnutls], [doc/doxygen.conf], [doc/api])
271
272AC_CONFIG_FILES([Makefile src/Makefile test/Makefile test/tests/Makefile \
273                        doc/Makefile doc/doxygen.conf include/mod_gnutls.h \
274                        test/proxy_backend.conf \
275                        test/apache-conf/listen.conf \
276                        test/apache-conf/netns.conf])
277AC_OUTPUT
278
279echo "---"
280echo "Configuration summary for mod_gnutls:"
281echo ""
282echo "   * mod_gnutls version:  ${MOD_GNUTLS_VERSION}"
283echo "   * Apache Modules directory:    ${AP_LIBEXECDIR}"
284echo "   * GnuTLS Library version:      ${LIBGNUTLS_VERSION}"
285echo "   * SRP Authentication:  ${use_srp}"
286echo "   * MSVA Client Verification:    ${use_msva}"
287echo "   * Build documentation: ${build_doc}"
288echo ""
289echo "---"
Note: See TracBrowser for help on using the repository browser.