source: mod_gnutls/configure.ac

mod_gnutls/0.11.0
Last change on this file was 86cd5f6, checked in by Fiona Klute <fiona.klute@…>, 4 months ago

Release version 0.11.0

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