source: mod_gnutls/configure.ac @ b6ce8ad

main mod_gnutls/0.12.0
Last change on this file since b6ce8ad was b6ce8ad, checked in by Fiona Klute <fiona.klute@…>, 20 months ago

Release version 0.12.0

  • Property mode set to 100644
File size: 12.0 KB
Line 
1AC_INIT(mod_gnutls, 0.12.0)
2OOO_CONFIG_NICE(config.nice)
3MOD_GNUTLS_VERSION=AC_PACKAGE_VERSION
4AC_PREREQ(2.53)
5AC_CONFIG_SRCDIR([src/mod_gnutls.c])
6AC_CONFIG_AUX_DIR(config)
7
8AM_MAINTAINER_MODE([enable])
9AC_CANONICAL_TARGET
10# mod_gnutls test suite requires GNU make
11AM_INIT_AUTOMAKE([-Wno-portability])
12AM_CONFIG_HEADER(include/mod_gnutls_config.h:config.in)
13
14LT_INIT([disable-static])
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.4.17
27CHECK_APACHE(,$AP_VERSION,
28    :,:,
29    AC_MSG_ERROR([*** Apache version $AP_VERSION not found!])
30)
31
32PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 3.6.3])
33LIBGNUTLS_VERSION=`pkg-config --modversion gnutls`
34
35dnl Maybe use the binaries for tests, too?
36AC_ARG_WITH([gnutls-dev],
37        AS_HELP_STRING([--with-gnutls-dev=DIR],
38                [Use GnuTLS libraries from a development (git) tree. Use \
39                this if you want to test mod_gnutls with the latest \
40                GnuTLS code.]),
41        [
42                AS_IF([test -d "${with_gnutls_dev}" ],
43                [
44                        LIBGNUTLS_CFLAGS="-I${with_gnutls_dev}/lib/includes"
45                        LIBGNUTLS_LIBS="-lgnutls -L${with_gnutls_dev}/lib/.libs -R${with_gnutls_dev}/lib/.libs"
46                        LIBGNUTLS_VERSION=`PKG_CONFIG_PATH="${with_gnutls_dev}/lib" pkg-config --modversion gnutls`
47                ],
48                [AC_MSG_ERROR([--with-gnutls-dev=DIR requires a directory!])])
49        ], [])
50
51AC_ARG_ENABLE(vpath-install,
52       AS_HELP_STRING([--enable-vpath-install],
53               [Modify the Apache module directory provided by apxs to \
54               follow --prefix, if necessary. Most users will not want this, \
55               but it is required for VPATH builds including "make \
56               distcheck".]),
57       vpath_install=$enableval, vpath_install=no)
58AM_CONDITIONAL([ENABLE_VPATH_INSTALL], [test "$vpath_install" = "yes"])
59
60AC_ARG_ENABLE(clang-coverage,
61       AS_HELP_STRING([--enable-clang-coverage],
62               [Collect coverage information using clang profiling \
63               instrumentation. Do not use for production!]),
64       coverage=$enableval, coverage=no)
65COVERAGE_CFLAGS=""
66AS_IF([test "${coverage}" != "no"], [
67        COVERAGE_CFLAGS="-fprofile-instr-generate -fcoverage-mapping"
68])
69AM_CONDITIONAL([ENABLE_COVERAGE], [test "$coverage" = "yes"])
70
71AC_ARG_ENABLE(srp,
72       AS_HELP_STRING([--enable-srp],
73               [enable SRP functionality if supported by libgnutls]),
74       use_srp=$enableval, use_srp=no)
75
76# check if the available GnuTLS library supports SRP
77AC_SEARCH_LIBS([gnutls_srp_server_get_username], [gnutls], [], [use_srp="no"])
78
79AC_MSG_CHECKING([whether to enable SRP functionality])
80AC_MSG_RESULT($use_srp)
81
82GNUTLS_FEAT_CFLAGS=""
83AS_IF([test "${use_srp}" != "no"], [
84        GNUTLS_FEAT_CFLAGS="-DENABLE_SRP=1"
85        AC_MSG_WARN([You have enabled SRP support. This feature is deprecated and will be removed in a future release.])
86])
87
88AC_ARG_ENABLE(strict,
89       AS_HELP_STRING([--disable-strict],
90               [Avoid strict compiler warnings and errors]),
91       use_strict=$enableval, use_strict=yes)
92
93STRICT_CFLAGS=""
94if test "$use_strict" != "no"; then
95        STRICT_CFLAGS="-Wall -Werror -Wextra -Wno-error=deprecated-declarations"
96fi
97
98MOD_GNUTLS_DEBUG=0
99AC_ARG_ENABLE(gnutls-debug-log,
100       AS_HELP_STRING([--enable-gnutls-debug-log],
101               [Write GnuTLS debug output to /tmp/gnutls_debug, for \
102               debugging only!]),
103       enable_gnutls_debug=$enableval, enable_gnutls_debug=no)
104if test "$enable_gnutls_debug" != "no"; then
105        MOD_GNUTLS_DEBUG=1
106fi
107AC_SUBST(MOD_GNUTLS_DEBUG)
108
109AM_PATH_PYTHON([3])
110AX_PYTHON_MODULE([yaml], [fatal])
111
112dnl Enable testing with Valgrind? Default is "no".
113AC_ARG_ENABLE([valgrind-test],
114        AS_HELP_STRING([--enable-valgrind-test], [Enable running \
115        tests with Valgrind (slow)]),
116        [use_valgrind=$enableval], [use_valgrind=no])
117AC_MSG_CHECKING([whether to run tests with Valgrind])
118AC_MSG_RESULT([$use_valgrind])
119AC_PATH_PROG([VALGRIND], [valgrind], [no])
120AS_IF([test "${use_valgrind}" != "no" -a "${VALGRIND}" = "no"],
121      [AC_MSG_ERROR([Valgrind test are enabled, but "valgrind" not \
122      found in PATH!])])
123AM_CONDITIONAL([ENABLE_VALGRIND], [test "${use_valgrind}" != "no"])
124
125dnl Optionally disable flock
126AC_ARG_ENABLE(flock,
127        AS_HELP_STRING([--disable-flock], [Disable use of flock during tests \
128        (some exotic architectures don't support it)]),
129        [use_flock=$enableval], [use_flock=yes])
130# Check if flock is available and supports --timeout
131AC_PATH_PROG([FLOCK], [flock], [no])
132AS_IF([test "${FLOCK}" != "no"],
133      [
134        AC_MSG_CHECKING([whether ${FLOCK} supports --timeout])
135        lockfile="$(mktemp)"
136        AS_IF([${FLOCK} --timeout 1 ${lockfile} true >&AS_MESSAGE_LOG_FD 2>&1],
137              [flock_works="yes"], [flock_works="no"])
138        AC_MSG_RESULT([$flock_works])
139        # Old versions of flock do not support --verbose. They fail
140        # without executing the command but still return 0. Check for
141        # this behavior by testing if the rm command was executed.
142        AC_MSG_CHECKING([whether ${FLOCK} supports --verbose])
143        testfile="$(mktemp)"
144        AS_IF([${FLOCK} --verbose --timeout 1 ${lockfile} rm "${testfile}" \
145                        >&AS_MESSAGE_LOG_FD 2>&1; test ! -e "${testfile}"],
146              [flock_verbose="yes"; FLOCK="${FLOCK} --verbose"],
147              [flock_verbose="no"; rm "${testfile}"])
148        AC_MSG_RESULT([$flock_verbose])
149        rm "${lockfile}"
150      ],
151      [flock_works="no"])
152# disable flock if requested by user or it doesn't support timeout
153AM_CONDITIONAL([DISABLE_FLOCK],
154               [test "$enable_flock" = "no" || test "$flock_works" = "no"])
155
156# openssl is needed as the responder for OCSP tests
157AC_PATH_PROG([OPENSSL], [openssl], [no])
158AM_CONDITIONAL([ENABLE_OCSP_TEST], [test "${OPENSSL}" != "no"])
159
160dnl Enable test namespaces? Default is "yes".
161AC_ARG_ENABLE(test-namespaces,
162        AS_HELP_STRING([--disable-test-namespaces], [Disable use of \
163        namespaces for tests (limits parallelization)]),
164        [use_netns=$enableval], [use_netns=yes])
165
166# Check if "unshare" is available and has permission to create
167# network, IPC, and user namespaces
168AC_PATH_PROG([UNSHARE], [unshare], [no])
169AS_IF([test "${UNSHARE}" != "no"],
170      [
171        AC_MSG_CHECKING([for permission to use namespaces])
172        AS_IF([${UNSHARE} --net --ipc -r /bin/sh -c \
173                "ip link set up lo && ip addr show" >&AS_MESSAGE_LOG_FD 2>&1],
174              [unshare_works="yes"], [unshare_works="no"])
175        AC_MSG_RESULT([$unshare_works])
176      ],
177      [unshare_works="no"])
178# decide whether to enable network namespaces
179AS_IF([test "$enable_test_namespaces" != "no" \
180            && test "$unshare_works" = "yes"],
181      [use_netns="yes"], [use_netns="no"])
182AM_CONDITIONAL([ENABLE_NETNS], [test "$use_netns" != "no"])
183
184AC_ARG_ENABLE(msva,
185       AS_HELP_STRING([--enable-msva],
186               [enable Monkeysphere client certificate verification]),
187       use_msva=$enableval, use_msva=no)
188AM_CONDITIONAL([USE_MSVA], [test "$use_msva" != "no"])
189
190MSVA_CFLAGS=""
191AS_IF([test "$use_msva" != "no"], [
192        AC_CHECK_HEADERS([msv/msv.h], [],
193                         [AC_MSG_ERROR([*** No libmsv headers found!])])
194        AC_SEARCH_LIBS([msv_query_agent], [msv], [],
195                         [AC_MSG_ERROR([*** No libmsv found with msv_query_agent!])])
196        MSVA_CFLAGS="-DENABLE_MSVA=1"
197])
198
199AC_MSG_CHECKING([whether to enable MSVA functionality])
200AC_MSG_RESULT($use_msva)
201
202# Building documentation requires pandoc, which in turn needs pdflatex
203# to build PDF output.
204build_doc=no
205AC_PATH_PROG([PANDOC], [pandoc], [no])
206AC_ARG_ENABLE(pdf-doc,
207        AS_HELP_STRING([--disable-pdf-doc], [don't build PDF documentation]))
208AS_IF([test "$PANDOC" != "no"], [
209        AC_PATH_PROG([PDFLATEX], [pdflatex], [no])
210        if test "$PDFLATEX" != "no" && test "${enable_pdf_doc}" != "no"; then
211                build_doc="html, manual page, pdf"
212        else
213                build_doc="html, manual page"
214        fi
215], [
216        AC_PATH_PROG([MARKDOWN], [markdown], [no])
217        if test "$MARKDOWN" != "no"; then
218                build_doc="html stub"
219        fi
220])
221AM_CONDITIONAL([USE_PANDOC], [test "$PANDOC" != "no"])
222AM_CONDITIONAL([USE_PDFLATEX], [test "$PANDOC" != "no" && \
223                               test "$PDFLATEX" != "no" && \
224                               test "${enable_pdf_doc}" != "no"])
225AM_CONDITIONAL([USE_MARKDOWN], [test -n "$MARKDOWN" && \
226                               test "$MARKDOWN" != "no"])
227
228# Check for Apache binary
229AC_PATH_PROGS([APACHE2], [apache2 httpd], [no], [$PATH:/usr/sbin])
230AS_IF([test "${APACHE2}" = "no"], [
231        AC_MSG_WARN([Neither apache2 nor httpd found in \
232                     PATH. Test suite will fail.])
233])
234
235AC_PATH_PROGS([HTTP_CLI], [curl], [no])
236
237MODULE_CFLAGS="${LIBGNUTLS_CFLAGS} ${GNUTLS_FEAT_CFLAGS} ${MSVA_CFLAGS} ${APR_CFLAGS} ${AP_INCLUDES} ${APR_INCLUDES} ${APU_INCLUDES} ${STRICT_CFLAGS} ${COVERAGE_CFLAGS}"
238MODULE_LIBS="${LIBGNUTLS_LIBS}"
239
240AC_PATH_PROGS([SOFTHSM], [softhsm2-util], [no])
241AM_CONDITIONAL([HAVE_SOFTHSM], [test "${SOFTHSM}" != "no"])
242
243AC_SUBST(MODULE_CFLAGS)
244AC_SUBST(MODULE_LIBS)
245
246# Adjust Apache configuration for tests: Use pthread mutex and test
247# specific PID files if using namespaces. Otherwise defaults are used,
248# and the user can override the default mutex type.
249AC_ARG_VAR([APACHE_MUTEX], [Override the default mutex for the test \
250                           environment. The value is used only when running \
251                           without namespace isolation, tests running in \
252                           their own namespaces always use "pthread".])
253AS_IF([test -n "${APACHE_MUTEX}"],
254      [MUTEX_CONF="Mutex ${APACHE_MUTEX} default"],
255      [MUTEX_CONF=""])
256AS_IF([test "$use_netns" = "yes"],
257      [MUTEX_CONF="Mutex pthread default"; PID_AFFIX="-\${TEST_NAME}"],
258      [PID_AFFIX=""])
259AC_SUBST(MUTEX_CONF)
260AC_SUBST(PID_AFFIX)
261AM_SUBST_NOTMAKE(MUTEX_CONF)
262AM_SUBST_NOTMAKE(PID_AFFIX)
263
264AC_MSG_CHECKING([which loopback addresses are usable])
265loopback_ips="$("${PYTHON}" "${srcdir}/test/check_test_ips.py" -q ::1 127.0.0.1)"
266AC_MSG_RESULT(${loopback_ips})
267
268# assign default values to TEST_HOST and TEST_IP if necessary
269: ${TEST_HOST:="localhost"}
270: ${TEST_IP:="${loopback_ips}"}
271AC_ARG_VAR([TEST_HOST], [Host name to use for server instances started by \
272                        "make check", must resolve to addresses in TEST_IP. \
273                        The default is "localhost".])
274AC_ARG_VAR([TEST_IP], [List of IP addresses to use for server instances \
275                      started by "make check". The default is \
276                      "[::1] 127.0.0.1". Note that IPv6 addresses must be \
277                      enclosed in square brackets.])
278
279: ${TEST_LOCK_WAIT:="30"}
280: ${TEST_QUERY_TIMEOUT:="30"}
281AC_ARG_VAR([TEST_LOCK_WAIT], [Timeout in seconds to acquire locks for \
282                             Apache instances in the test suite, or the \
283                             previous instance to remove its PID file if \
284                             flock is not used. Default is 30.])
285AC_ARG_VAR([TEST_QUERY_TIMEOUT], [Timeout in seconds for HTTPS requests \
286                                 sent using gnutls-cli in the test suite. \
287                                 Default is 30.])
288
289dnl Allow user to set SoftHSM PKCS #11 module
290AC_ARG_VAR([SOFTHSM_LIB], [Absolute path of the SoftHSM PKCS @%:@11 module to \
291                          use. By default the test suite will search common \
292                          library paths.])
293
294dnl Build list of "Listen" statements for Apache
295LISTEN_LIST="@%:@ Listen addresses for the test servers"
296for i in ${TEST_IP}; do
297        LISTEN_LIST="${LISTEN_LIST}
298Listen ${i}:\${TEST_PORT}"
299done
300# Available extra ports, tests can "Define" variables of the listed
301# names in their apache.conf to enable them.
302for j in TEST_HTTP_PORT; do
303LISTEN_LIST="${LISTEN_LIST}
304<IfDefine ${j}>"
305for i in ${TEST_IP}; do
306        LISTEN_LIST="${LISTEN_LIST}
307        Listen ${i}:\${${j}}"
308done
309LISTEN_LIST="${LISTEN_LIST}
310</IfDefine>"
311done
312AC_SUBST(LISTEN_LIST)
313AM_SUBST_NOTMAKE(LISTEN_LIST)
314
315DX_DOXYGEN_FEATURE(ON)
316DX_DOT_FEATURE(ON)
317DX_HTML_FEATURE(ON)
318DX_MAN_FEATURE(OFF)
319DX_RTF_FEATURE(OFF)
320DX_XML_FEATURE(OFF)
321DX_PDF_FEATURE(OFF)
322DX_PS_FEATURE(OFF)
323DX_INIT_DOXYGEN([mod_gnutls], [doc/doxygen.conf], [doc/api])
324
325AC_CONFIG_FILES([Makefile src/Makefile test/Makefile test/tests/Makefile \
326                        doc/Makefile doc/doxygen.conf include/mod_gnutls.h \
327                        test/proxy_backend.conf test/ocsp_server.conf \
328                        test/apache-conf/listen.conf \
329                        test/apache-conf/netns.conf])
330AC_OUTPUT
331
332echo "---"
333echo "Configuration summary for mod_gnutls:"
334echo ""
335echo "   * mod_gnutls version:  ${MOD_GNUTLS_VERSION}"
336echo "   * Apache Modules directory:    ${AP_LIBEXECDIR}"
337echo "   * GnuTLS Library version:      ${LIBGNUTLS_VERSION}"
338echo "   * CFLAGS for GnuTLS:           ${LIBGNUTLS_CFLAGS}"
339echo "   * LDFLAGS for GnuTLS:  ${LIBGNUTLS_LIBS}"
340echo "   * SRP Authentication:  ${use_srp}"
341echo "   * MSVA Client Verification:    ${use_msva}"
342echo "   * Build documentation: ${build_doc}"
343echo ""
344echo "---"
Note: See TracBrowser for help on using the repository browser.