source: mod_gnutls/configure.ac @ c4d6e77

asynciodebian/masterdebian/stretch-backportsproxy-ticketupstream
Last change on this file since c4d6e77 was 9e309ae, checked in by Thomas Klute <thomas2.klute@…>, 5 years ago

Merge version 0.7.4 into ocsp

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