source: mod_gnutls/configure.ac @ 19f2719

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

Release version 0.7.4

  • Property mode set to 100644
File size: 7.8 KB
RevLine 
[7bebb42]1dnl
[c6cfe6e]2AC_INIT(mod_gnutls, 0.7.4)
[9706fc2]3OOO_CONFIG_NICE(config.nice)
[42307a9]4MOD_GNUTLS_VERSION=AC_PACKAGE_VERSION
[6e0bfd6]5AC_PREREQ(2.53)
[9706fc2]6AC_CONFIG_SRCDIR([src/mod_gnutls.c])
[6e0bfd6]7AC_CONFIG_AUX_DIR(config)
[7bebb42]8
[5a6446d]9OOO_MAINTAIN_MODE
[9706fc2]10AM_MAINTAINER_MODE
11AC_CANONICAL_TARGET
[9a4d250]12# mod_gnutls test suite requires GNU make
13AM_INIT_AUTOMAKE([-Wno-portability])
[6e0bfd6]14AM_CONFIG_HEADER(include/mod_gnutls_config.h:config.in)
[9706fc2]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
[4038c7a]26AP_VERSION=2.2.0
[9706fc2]27CHECK_APACHE(,$AP_VERSION,
28    :,:,
29    AC_MSG_ERROR([*** Apache version $AP_VERSION not found!])
30)
31
[0de1839]32PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 3.1.4])
[cac3a7f]33
34LIBGNUTLS_VERSION=`pkg-config --modversion gnutls`
[16068f4]35
[787dab7]36AC_ARG_ENABLE(srp,
37       AS_HELP_STRING([--disable-srp],
38               [unconditionally disable the SRP functionality]),
39       use_srp=$enableval, use_srp=yes)
[b072204]40
[f71e6ce]41# check if the available GnuTLS library supports SRP
42AC_SEARCH_LIBS([gnutls_srp_server_get_username], [gnutls], [], [use_srp="no"])
43
[b072204]44SRP_CFLAGS=""
[787dab7]45if test "$use_srp" != "no"; then
[b27cce7]46        SRP_CFLAGS="-DENABLE_SRP=1"
[787dab7]47fi
[c70c6d7]48
[fd82e59]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
[787dab7]59AC_MSG_CHECKING([whether to enable SRP functionality])
60AC_MSG_RESULT($use_srp)
61
[412ee84]62dnl Optionally disable flock
63AC_ARG_ENABLE(flock,
[dff57b4]64        AS_HELP_STRING([--disable-flock], [Disable use of flock during tests \
65        (some exotic architectures don't support it)]),
[412ee84]66        [use_flock=$enableval], [use_flock=yes])
[5d9f34e]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"])
[412ee84]82
[cf4e708]83dnl Enable test namespaces? Default is "yes".
84AC_ARG_ENABLE(test-namespaces,
85        AS_HELP_STRING([--disable-test-namespaces], [Disable use of network \
86        namespaces to run tests in parallel (some architectures might not \
87        support it)]),
88        [use_netns=$enableval], [use_netns=yes])
[b21bf4f]89
90# Check if "unshare" is available and has permission to create network
91# and user namespaces
92AC_PATH_PROG([UNSHARE], [unshare], [no])
93AS_IF([test "${UNSHARE}" != "no"],
94      [
[5aae10e]95        AC_MSG_CHECKING([for permission to create network and user namespaces])
[b21bf4f]96        AS_IF([${UNSHARE} --net -r /bin/sh -c \
[d7c2508]97                "ip link set up lo && ip addr show" >&AS_MESSAGE_LOG_FD 2>&1],
[b21bf4f]98              [unshare_works="yes"], [unshare_works="no"])
99        AC_MSG_RESULT([$unshare_works])
100      ],
[1bb6b1c]101      [unshare_works="no"])
[b21bf4f]102# decide whether to enable network namespaces
103AS_IF([test "$enable_test_namespaces" != "no" \
104            && test "$unshare_works" = "yes"],
105      [use_netns="yes"], [use_netns="no"])
[cf4e708]106AM_CONDITIONAL([ENABLE_NETNS], [test "$use_netns" != "no"])
[b21bf4f]107# Adjust Apache configuration for tests accordingly: Use pthread mutex
108# and test specific PID files if using namespaces, defaults otherwise.
109AS_IF([test "$use_netns" = "yes"],
110      [MUTEX_TYPE="pthread"; PID_AFFIX="-\${TEST_NAME}"],
111      [MUTEX_TYPE="default"; PID_AFFIX=""])
[cf4e708]112AC_SUBST(MUTEX_TYPE)
113AC_SUBST(PID_AFFIX)
114AM_SUBST_NOTMAKE(MUTEX_TYPE)
115AM_SUBST_NOTMAKE(PID_AFFIX)
116
[fa45dcb]117AC_ARG_ENABLE(msva,
118       AS_HELP_STRING([--enable-msva],
119               [enable Monkeysphere client certificate verification]),
120       use_msva=$enableval, use_msva=no)
[b27cce7]121AM_CONDITIONAL([USE_MSVA], [test "$use_msva" != "no"])
[fa45dcb]122
123MSVA_CFLAGS=""
124if test "$use_msva" != "no"; then
[b27cce7]125        AC_CHECK_HEADERS([msv/msv.h], [],
[fa45dcb]126                         [AC_MSG_ERROR([*** No libmsv headers found!])])
127        AC_SEARCH_LIBS([msv_query_agent], [msv], [],
128                         [AC_MSG_ERROR([*** No libmsv found with msv_query_agent!])])
[b27cce7]129        MSVA_CFLAGS="-DENABLE_MSVA=1"
[fa45dcb]130fi
131
132AC_MSG_CHECKING([whether to enable MSVA functionality])
133AC_MSG_RESULT($use_msva)
134
[6e0bfd6]135have_apr_memcache=0
136CHECK_APR_MEMCACHE([have_apr_memcache=1], [have_apr_memcache=0])
137AC_SUBST(have_apr_memcache)
[ed47098]138
[6e1d45d]139# Building documentation requires pandoc, which in turn needs pdflatex
140# to build PDF output.
[28f3f4f]141build_doc=no
[6e1d45d]142AC_PATH_PROG([PANDOC], [pandoc], [no])
143if test "$PANDOC" != "no"; then
144        AC_PATH_PROG([PDFLATEX], [pdflatex], [no])
[28f3f4f]145        if test "$PDFLATEX" != "no"; then
146                build_doc=yes
147        else
148                build_doc="html only"
149        fi
[7225749]150else
151        AC_PATH_PROG([MARKDOWN], [markdown], [no])
152        if test "$MARKDOWN" != "no"; then
153                build_doc="html stub"
154        fi
[6e1d45d]155fi
156AM_CONDITIONAL([USE_PANDOC], [test "$PANDOC" != "no"])
157AM_CONDITIONAL([USE_PDFLATEX], [test "$PANDOC" != "no" && \
158                               test "$PDFLATEX" != "no"])
[7225749]159AM_CONDITIONAL([USE_MARKDOWN], [test -n "$MARKDOWN" && \
160                               test "$MARKDOWN" != "no"])
[6e1d45d]161
[af7da2d]162# Check for Apache binary
[83b3901]163AC_PATH_PROGS([APACHE2], [apache2 httpd], [no], [$PATH:/usr/sbin])
[af7da2d]164if test "${APACHE2}" = "no"; then
165        AC_MSG_WARN([Neither apache2 nor httpd found in \
[52c3f68]166                     PATH. Test suite will fail.])
167fi
168
[67f2f58]169AC_PATH_PROGS([HTTP_CLI], [curl wget], [no])
170
[fd82e59]171MODULE_CFLAGS="${LIBGNUTLS_CFLAGS} ${SRP_CFLAGS} ${MSVA_CFLAGS} ${APR_MEMCACHE_CFLAGS} ${APXS_CFLAGS} ${AP_INCLUDES} ${APR_INCLUDES} ${APU_INCLUDES} ${STRICT_CFLAGS}"
[5021874]172MODULE_LIBS="${APR_MEMCACHE_LIBS} ${LIBGNUTLS_LIBS}"
[9706fc2]173
[b0e5dae]174AC_PATH_PROGS([SOFTHSM], [softhsm2-util softhsm], [no])
[74772b2]175if test "${SOFTHSM}" != "no"; then
176        softhsm_version=$(${SOFTHSM} --version)
177        AS_VERSION_COMPARE([$(${SOFTHSM} --version)], [2.0.0],
178                           [AC_SUBST(SOFTHSM_MAJOR_VERSION, [1])],
179                           [AC_SUBST(SOFTHSM_MAJOR_VERSION, [2])],
180                           [AC_SUBST(SOFTHSM_MAJOR_VERSION, [2])])
181fi
[5eb4544]182AM_CONDITIONAL([HAVE_SOFTHSM], [test "${SOFTHSM}" != "no"])
[74772b2]183AM_CONDITIONAL([HAVE_SOFTHSM1], [test "${SOFTHSM_MAJOR_VERSION}" = "1"])
184AM_CONDITIONAL([HAVE_SOFTHSM2], [test "${SOFTHSM_MAJOR_VERSION}" = "2"])
[5eb4544]185
[9706fc2]186AC_SUBST(MODULE_CFLAGS)
[16068f4]187AC_SUBST(MODULE_LIBS)
[9706fc2]188
[26081ce]189# assign default values to TEST_HOST and TEST_IP if necessary
190: ${TEST_HOST:="localhost"}
[a08b25e]191: ${TEST_IP:="[[::1]] 127.0.0.1"}
[26081ce]192AC_ARG_VAR([TEST_HOST], [Host name to use for server instances started by \
[a08b25e]193                        "make check", must resolve to addresses in TEST_IP. \
194                        The default is "localhost".])
195AC_ARG_VAR([TEST_IP], [List of IP addresses to use for server instances \
196                      started by "make check". The default is \
197                      "[::1] 127.0.0.1". Note that IPv6 addresses must be \
198                      enclosed in square brackets.])
199AM_SUBST_NOTMAKE(TEST_IP)
200
[aeaf28b]201dnl Allow user to set SoftHSM PKCS #11 module
202AC_ARG_VAR([SOFTHSM_LIB], [Absolute path of the SoftHSM PKCS @%:@11 module to \
203                          use. By default the test suite will search common \
204                          library paths.])
205
[a08b25e]206dnl Build list of "Listen" statements for Apache
207LISTEN_LIST="# Listen addresses for the test servers"
208for i in ${TEST_IP}; do
209        LISTEN_LIST="${LISTEN_LIST}
210Listen ${i}:\${TEST_PORT}"
211done
[8ac7c0d]212dnl HTTP ports, only active if TEST_HTTP_PORT is defined
213LISTEN_LIST="${LISTEN_LIST}
214<IfDefine TEST_HTTP_PORT>"
215for i in ${TEST_IP}; do
216        LISTEN_LIST="${LISTEN_LIST}
217        Listen ${i}:\${TEST_HTTP_PORT}"
218done
219LISTEN_LIST="${LISTEN_LIST}
220</IfDefine>"
[a08b25e]221AC_SUBST(LISTEN_LIST)
222AM_SUBST_NOTMAKE(LISTEN_LIST)
[26081ce]223
[6e1d45d]224AC_CONFIG_FILES([Makefile src/Makefile test/Makefile test/tests/Makefile \
[ddf6027]225                        doc/Makefile include/mod_gnutls.h \
[f87c1b5]226                        test/proxy_backend.conf \
[ddf6027]227                        test/apache-conf/listen.conf \
228                        test/apache-conf/netns.conf])
[9706fc2]229AC_OUTPUT
230
231echo "---"
[42307a9]232echo "Configuration summary for mod_gnutls:"
[9706fc2]233echo ""
[ea14e97]234echo "   * mod_gnutls version:  ${MOD_GNUTLS_VERSION}"
[16068f4]235echo "   * Apache Modules directory:    ${AP_LIBEXECDIR}"
[42307a9]236echo "   * GnuTLS Library version:      ${LIBGNUTLS_VERSION}"
[28f3f4f]237echo "   * SRP Authentication:  ${use_srp}"
238echo "   * MSVA Client Verification:    ${use_msva}"
239echo "   * Build documentation: ${build_doc}"
[9706fc2]240echo ""
241echo "---"
Note: See TracBrowser for help on using the repository browser.