source: mod_gnutls/configure.ac @ eda8686

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

Disable building static libraries

Only the dynamic library is used by Apache, so there is not reason to
build a static version.

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