source: mod_gnutls/configure.ac @ 2b80754

debian/masterdebian/stretch-backportsjessie-backportsproxy-ticketupstream
Last change on this file since 2b80754 was 0bda20f, checked in by Thomas Klute <thomas2.klute@…>, 4 years ago

Make "make distcheck" work

This requires strict DIST/DISTCLEAN lists and working VPATH
installation. Note that most users will not want to use a VPATH build
because it defeats the expectation of having mod_gnutls installed into
the same directory as other Apache modules.

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