source: mod_gnutls/configure.ac @ f3a3f6f

asyncioproxy-ticket
Last change on this file since f3a3f6f was f3a3f6f, checked in by Fiona Klute <fiona.klute@…>, 12 months ago

Check for Python yaml module in ./configure (required for tests)

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