source: mod_gnutls/configure.ac @ 42bee37

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

Test suite: OCSP index generation tool

gen_ocsp_index creates an index file in the format used by OpenSSL
from a list of certificates, e.g.:

./gen_ocsp_index server/x509.pem client/x509.pem

The purpose is to configure an OCSP responder for the test
environment.

  • Property mode set to 100644
File size: 7.8 KB
Line 
1dnl
2AC_INIT(mod_gnutls, 0.7.3)
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
62dnl Optionally disable flock
63AC_ARG_ENABLE(flock,
64        AS_HELP_STRING([--disable-flock], [Disable use of flock during tests \
65        (some exotic architectures don't support it)]),
66        [use_flock=$enableval], [use_flock=yes])
67# Check if flock is available and supports --timeout
68AC_PATH_PROG([FLOCK], [flock], [no])
69AS_IF([test "${FLOCK}" != "no"],
70      [
71        AC_MSG_CHECKING([whether ${FLOCK} supports --timeout])
72        lockfile="$(mktemp)"
73        AS_IF([${FLOCK} --timeout 1 ${lockfile} true >&AS_MESSAGE_LOG_FD 2>&1],
74              [flock_works="yes"], [flock_works="no"])
75        rm "${lockfile}"
76        AC_MSG_RESULT([$flock_works])
77      ],
78      [flock_works="no"])
79# disable flock if requested by user or it doesn't support timeout
80AM_CONDITIONAL([DISABLE_FLOCK],
81               [test "$enable_flock" = "no" || test "$flock_works" = "no"])
82
83# TODO: check for openssl ocsp
84AM_CONDITIONAL([ENABLE_OCSP_TEST], [true])
85
86dnl Enable test namespaces? Default is "yes".
87AC_ARG_ENABLE(test-namespaces,
88        AS_HELP_STRING([--disable-test-namespaces], [Disable use of network \
89        namespaces to run tests in parallel (some architectures might not \
90        support it)]),
91        [use_netns=$enableval], [use_netns=yes])
92
93# Check if "unshare" is available and has permission to create network
94# and user namespaces
95AC_PATH_PROG([UNSHARE], [unshare], [no])
96AS_IF([test "${UNSHARE}" != "no"],
97      [
98        AC_MSG_CHECKING([for permission to create network and user namespaces])
99        AS_IF([${UNSHARE} --net -r /bin/sh -c \
100                "ip link set up lo && ip addr show" >&AS_MESSAGE_LOG_FD 2>&1],
101              [unshare_works="yes"], [unshare_works="no"])
102        AC_MSG_RESULT([$unshare_works])
103      ],
104      [unshare_works="no"])
105# decide whether to enable network namespaces
106AS_IF([test "$enable_test_namespaces" != "no" \
107            && test "$unshare_works" = "yes"],
108      [use_netns="yes"], [use_netns="no"])
109AM_CONDITIONAL([ENABLE_NETNS], [test "$use_netns" != "no"])
110# Adjust Apache configuration for tests accordingly: Use pthread mutex
111# and test specific PID files if using namespaces, defaults otherwise.
112AS_IF([test "$use_netns" = "yes"],
113      [MUTEX_TYPE="pthread"; PID_AFFIX="-\${TEST_NAME}"],
114      [MUTEX_TYPE="default"; PID_AFFIX=""])
115AC_SUBST(MUTEX_TYPE)
116AC_SUBST(PID_AFFIX)
117AM_SUBST_NOTMAKE(MUTEX_TYPE)
118AM_SUBST_NOTMAKE(PID_AFFIX)
119
120AC_ARG_ENABLE(msva,
121       AS_HELP_STRING([--enable-msva],
122               [enable Monkeysphere client certificate verification]),
123       use_msva=$enableval, use_msva=no)
124AM_CONDITIONAL([USE_MSVA], [test "$use_msva" != "no"])
125
126MSVA_CFLAGS=""
127if test "$use_msva" != "no"; then
128        AC_CHECK_HEADERS([msv/msv.h], [],
129                         [AC_MSG_ERROR([*** No libmsv headers found!])])
130        AC_SEARCH_LIBS([msv_query_agent], [msv], [],
131                         [AC_MSG_ERROR([*** No libmsv found with msv_query_agent!])])
132        MSVA_CFLAGS="-DENABLE_MSVA=1"
133fi
134
135AC_MSG_CHECKING([whether to enable MSVA functionality])
136AC_MSG_RESULT($use_msva)
137
138have_apr_memcache=0
139CHECK_APR_MEMCACHE([have_apr_memcache=1], [have_apr_memcache=0])
140AC_SUBST(have_apr_memcache)
141
142# Building documentation requires pandoc, which in turn needs pdflatex
143# to build PDF output.
144build_doc=no
145AC_PATH_PROG([PANDOC], [pandoc], [no])
146if test "$PANDOC" != "no"; then
147        AC_PATH_PROG([PDFLATEX], [pdflatex], [no])
148        if test "$PDFLATEX" != "no"; then
149                build_doc=yes
150        else
151                build_doc="html only"
152        fi
153else
154        AC_PATH_PROG([MARKDOWN], [markdown], [no])
155        if test "$MARKDOWN" != "no"; then
156                build_doc="html stub"
157        fi
158fi
159AM_CONDITIONAL([USE_PANDOC], [test "$PANDOC" != "no"])
160AM_CONDITIONAL([USE_PDFLATEX], [test "$PANDOC" != "no" && \
161                               test "$PDFLATEX" != "no"])
162AM_CONDITIONAL([USE_MARKDOWN], [test -n "$MARKDOWN" && \
163                               test "$MARKDOWN" != "no"])
164
165# Check for Apache binary
166AC_PATH_PROGS([APACHE2], [apache2 httpd], [no], [$PATH:/usr/sbin])
167if test "${APACHE2}" = "no"; then
168        AC_MSG_WARN([Neither apache2 nor httpd found in \
169                     PATH. Test suite will fail.])
170fi
171
172AC_PATH_PROGS([HTTP_CLI], [curl wget], [no])
173
174MODULE_CFLAGS="${LIBGNUTLS_CFLAGS} ${SRP_CFLAGS} ${MSVA_CFLAGS} ${APR_MEMCACHE_CFLAGS} ${APXS_CFLAGS} ${AP_INCLUDES} ${APR_INCLUDES} ${APU_INCLUDES} ${STRICT_CFLAGS}"
175MODULE_LIBS="${APR_MEMCACHE_LIBS} ${LIBGNUTLS_LIBS}"
176
177AC_PATH_PROGS([SOFTHSM], [softhsm2-util softhsm], [no])
178if test "${SOFTHSM}" != "no"; then
179        softhsm_version=$(${SOFTHSM} --version)
180        AS_VERSION_COMPARE([$(${SOFTHSM} --version)], [2.0.0],
181                           [AC_SUBST(SOFTHSM_MAJOR_VERSION, [1])],
182                           [AC_SUBST(SOFTHSM_MAJOR_VERSION, [2])],
183                           [AC_SUBST(SOFTHSM_MAJOR_VERSION, [2])])
184fi
185AM_CONDITIONAL([HAVE_SOFTHSM], [test "${SOFTHSM}" != "no"])
186AM_CONDITIONAL([HAVE_SOFTHSM1], [test "${SOFTHSM_MAJOR_VERSION}" = "1"])
187AM_CONDITIONAL([HAVE_SOFTHSM2], [test "${SOFTHSM_MAJOR_VERSION}" = "2"])
188
189AC_SUBST(MODULE_CFLAGS)
190AC_SUBST(MODULE_LIBS)
191
192# assign default values to TEST_HOST and TEST_IP if necessary
193: ${TEST_HOST:="localhost"}
194: ${TEST_IP:="[[::1]] 127.0.0.1"}
195AC_ARG_VAR([TEST_HOST], [Host name to use for server instances started by \
196                        "make check", must resolve to addresses in TEST_IP. \
197                        The default is "localhost".])
198AC_ARG_VAR([TEST_IP], [List of IP addresses to use for server instances \
199                      started by "make check". The default is \
200                      "[::1] 127.0.0.1". Note that IPv6 addresses must be \
201                      enclosed in square brackets.])
202AM_SUBST_NOTMAKE(TEST_IP)
203
204dnl Allow user to set SoftHSM PKCS #11 module
205AC_ARG_VAR([SOFTHSM_LIB], [Absolute path of the SoftHSM PKCS @%:@11 module to \
206                          use. By default the test suite will search common \
207                          library paths.])
208
209dnl Build list of "Listen" statements for Apache
210LISTEN_LIST="# Listen addresses for the test servers"
211for i in ${TEST_IP}; do
212        LISTEN_LIST="${LISTEN_LIST}
213Listen ${i}:\${TEST_PORT}"
214done
215dnl HTTP ports, only active if TEST_HTTP_PORT is defined
216LISTEN_LIST="${LISTEN_LIST}
217<IfDefine TEST_HTTP_PORT>"
218for i in ${TEST_IP}; do
219        LISTEN_LIST="${LISTEN_LIST}
220        Listen ${i}:\${TEST_HTTP_PORT}"
221done
222LISTEN_LIST="${LISTEN_LIST}
223</IfDefine>"
224AC_SUBST(LISTEN_LIST)
225AM_SUBST_NOTMAKE(LISTEN_LIST)
226
227AC_CONFIG_FILES([Makefile src/Makefile test/Makefile test/tests/Makefile \
228                        doc/Makefile include/mod_gnutls.h \
229                        test/proxy_backend.conf \
230                        test/apache-conf/listen.conf \
231                        test/apache-conf/netns.conf])
232AC_OUTPUT
233
234echo "---"
235echo "Configuration summary for mod_gnutls:"
236echo ""
237echo "   * mod_gnutls version:  ${MOD_GNUTLS_VERSION}"
238echo "   * Apache Modules directory:    ${AP_LIBEXECDIR}"
239echo "   * GnuTLS Library version:      ${LIBGNUTLS_VERSION}"
240echo "   * SRP Authentication:  ${use_srp}"
241echo "   * MSVA Client Verification:    ${use_msva}"
242echo "   * Build documentation: ${build_doc}"
243echo ""
244echo "---"
Note: See TracBrowser for help on using the repository browser.