source: mod_gnutls/configure.ac @ 2b1b52f

asyncio
Last change on this file since 2b1b52f was cb1d852, checked in by Fiona Klute <fiona.klute@…>, 9 months ago

Add --enable-gnutls-debug-log to ./configure

This replaces the OOO_MAINTAIN_MODE macro, which previously enabled
the debug log and nothing else. The new code and documentation should
be much clearer.

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