source: mod_gnutls/configure.ac @ ca0690b

asynciomainproxy-ticket
Last change on this file since ca0690b was ca0690b, checked in by Fiona Klute <fiona.klute@…>, 3 years ago

Add ./configure option to disable building PDF documentation

The Debian build currently disables PDF documentation with a patch,
this is a more convenient solution.

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