source: mod_gnutls/configure.ac @ 9e309ae

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

Merge version 0.7.4 into ocsp

  • Property mode set to 100644
File size: 8.0 KB
Line 
1dnl
2AC_INIT(mod_gnutls, 0.7.4)
3OOO_CONFIG_NICE(config.nice)
4MOD_GNUTLS_VERSION=AC_PACKAGE_VERSION
5AC_PREREQ(2.53)
6AC_CONFIG_SRCDIR([src/mod_gnutls.c])
7AC_CONFIG_AUX_DIR(config)
8
9OOO_MAINTAIN_MODE
10AM_MAINTAINER_MODE
11AC_CANONICAL_TARGET
12# mod_gnutls test suite requires GNU make
13AM_INIT_AUTOMAKE([-Wno-portability])
14AM_CONFIG_HEADER(include/mod_gnutls_config.h:config.in)
15
16AC_SUBST(MOD_GNUTLS_VERSION)
17
18AC_PROG_CC
19AC_PROG_CC_C99
20AC_PROG_LD
21AC_PROG_INSTALL
22AC_PROG_LIBTOOL
23
24AC_CONFIG_MACRO_DIR([m4])
25
26AP_VERSION=2.2.0
27CHECK_APACHE(,$AP_VERSION,
28    :,:,
29    AC_MSG_ERROR([*** Apache version $AP_VERSION not found!])
30)
31
32PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 3.1.4])
33
34LIBGNUTLS_VERSION=`pkg-config --modversion gnutls`
35
36AC_ARG_ENABLE(srp,
37       AS_HELP_STRING([--disable-srp],
38               [unconditionally disable the SRP functionality]),
39       use_srp=$enableval, use_srp=yes)
40
41# check if the available GnuTLS library supports SRP
42AC_SEARCH_LIBS([gnutls_srp_server_get_username], [gnutls], [], [use_srp="no"])
43
44SRP_CFLAGS=""
45if test "$use_srp" != "no"; then
46        SRP_CFLAGS="-DENABLE_SRP=1"
47fi
48
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
59AC_MSG_CHECKING([whether to enable SRP functionality])
60AC_MSG_RESULT($use_srp)
61
62dnl Optionally disable flock
63AC_ARG_ENABLE(flock,
64        AS_HELP_STRING([--disable-flock], [Disable use of flock during tests \
65        (some exotic architectures don't support it)]),
66        [use_flock=$enableval], [use_flock=yes])
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"])
82
83# openssl is needed as the responder for OCSP tests
84AC_PATH_PROG([OPENSSL], [openssl], [no])
85AM_CONDITIONAL([ENABLE_OCSP_TEST], [test "${OPENSSL}" != "no"])
86
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])
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      [
99        AC_MSG_CHECKING([for permission to create network and user namespaces])
100        AS_IF([${UNSHARE} --net -r /bin/sh -c \
101                "ip link set up lo && ip addr show" >&AS_MESSAGE_LOG_FD 2>&1],
102              [unshare_works="yes"], [unshare_works="no"])
103        AC_MSG_RESULT([$unshare_works])
104      ],
105      [unshare_works="no"])
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"])
110AM_CONDITIONAL([ENABLE_NETNS], [test "$use_netns" != "no"])
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=""])
116AC_SUBST(MUTEX_TYPE)
117AC_SUBST(PID_AFFIX)
118AM_SUBST_NOTMAKE(MUTEX_TYPE)
119AM_SUBST_NOTMAKE(PID_AFFIX)
120
121AC_ARG_ENABLE(msva,
122       AS_HELP_STRING([--enable-msva],
123               [enable Monkeysphere client certificate verification]),
124       use_msva=$enableval, use_msva=no)
125AM_CONDITIONAL([USE_MSVA], [test "$use_msva" != "no"])
126
127MSVA_CFLAGS=""
128if test "$use_msva" != "no"; then
129        AC_CHECK_HEADERS([msv/msv.h], [],
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!])])
133        MSVA_CFLAGS="-DENABLE_MSVA=1"
134fi
135
136AC_MSG_CHECKING([whether to enable MSVA functionality])
137AC_MSG_RESULT($use_msva)
138
139have_apr_memcache=0
140CHECK_APR_MEMCACHE([have_apr_memcache=1], [have_apr_memcache=0])
141AC_SUBST(have_apr_memcache)
142
143# Building documentation requires pandoc, which in turn needs pdflatex
144# to build PDF output.
145build_doc=no
146AC_PATH_PROG([PANDOC], [pandoc], [no])
147if test "$PANDOC" != "no"; then
148        AC_PATH_PROG([PDFLATEX], [pdflatex], [no])
149        if test "$PDFLATEX" != "no"; then
150                build_doc=yes
151        else
152                build_doc="html only"
153        fi
154else
155        AC_PATH_PROG([MARKDOWN], [markdown], [no])
156        if test "$MARKDOWN" != "no"; then
157                build_doc="html stub"
158        fi
159fi
160AM_CONDITIONAL([USE_PANDOC], [test "$PANDOC" != "no"])
161AM_CONDITIONAL([USE_PDFLATEX], [test "$PANDOC" != "no" && \
162                               test "$PDFLATEX" != "no"])
163AM_CONDITIONAL([USE_MARKDOWN], [test -n "$MARKDOWN" && \
164                               test "$MARKDOWN" != "no"])
165
166# Check for Apache binary
167AC_PATH_PROGS([APACHE2], [apache2 httpd], [no], [$PATH:/usr/sbin])
168if test "${APACHE2}" = "no"; then
169        AC_MSG_WARN([Neither apache2 nor httpd found in \
170                     PATH. Test suite will fail.])
171fi
172
173AC_PATH_PROGS([HTTP_CLI], [curl wget], [no])
174
175MODULE_CFLAGS="${LIBGNUTLS_CFLAGS} ${SRP_CFLAGS} ${MSVA_CFLAGS} ${APR_MEMCACHE_CFLAGS} ${APXS_CFLAGS} ${AP_INCLUDES} ${APR_INCLUDES} ${APU_INCLUDES} ${STRICT_CFLAGS}"
176MODULE_LIBS="${APR_MEMCACHE_LIBS} ${LIBGNUTLS_LIBS}"
177
178AC_PATH_PROGS([SOFTHSM], [softhsm2-util softhsm], [no])
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
186AM_CONDITIONAL([HAVE_SOFTHSM], [test "${SOFTHSM}" != "no"])
187AM_CONDITIONAL([HAVE_SOFTHSM1], [test "${SOFTHSM_MAJOR_VERSION}" = "1"])
188AM_CONDITIONAL([HAVE_SOFTHSM2], [test "${SOFTHSM_MAJOR_VERSION}" = "2"])
189
190AC_SUBST(MODULE_CFLAGS)
191AC_SUBST(MODULE_LIBS)
192
193# assign default values to TEST_HOST and TEST_IP if necessary
194: ${TEST_HOST:="localhost"}
195: ${TEST_IP:="[[::1]] 127.0.0.1"}
196AC_ARG_VAR([TEST_HOST], [Host name to use for server instances started by \
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
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
210dnl Build list of "Listen" statements for Apache
211LISTEN_LIST="@%:@ Listen addresses for the test servers"
212for i in ${TEST_IP}; do
213        LISTEN_LIST="${LISTEN_LIST}
214Listen ${i}:\${TEST_PORT}"
215done
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
219LISTEN_LIST="${LISTEN_LIST}
220<IfDefine ${j}>"
221for i in ${TEST_IP}; do
222        LISTEN_LIST="${LISTEN_LIST}
223        Listen ${i}:\${${j}}"
224done
225LISTEN_LIST="${LISTEN_LIST}
226</IfDefine>"
227done
228AC_SUBST(LISTEN_LIST)
229AM_SUBST_NOTMAKE(LISTEN_LIST)
230
231AC_CONFIG_FILES([Makefile src/Makefile test/Makefile test/tests/Makefile \
232                        doc/Makefile include/mod_gnutls.h \
233                        test/proxy_backend.conf \
234                        test/apache-conf/listen.conf \
235                        test/apache-conf/netns.conf])
236AC_OUTPUT
237
238echo "---"
239echo "Configuration summary for mod_gnutls:"
240echo ""
241echo "   * mod_gnutls version:  ${MOD_GNUTLS_VERSION}"
242echo "   * Apache Modules directory:    ${AP_LIBEXECDIR}"
243echo "   * GnuTLS Library version:      ${LIBGNUTLS_VERSION}"
244echo "   * SRP Authentication:  ${use_srp}"
245echo "   * MSVA Client Verification:    ${use_msva}"
246echo "   * Build documentation: ${build_doc}"
247echo ""
248echo "---"
Note: See TracBrowser for help on using the repository browser.