source: mod_gnutls/configure.ac @ eb34ac4

debian/masterdebian/stretch-backportsjessie-backportsupstream
Last change on this file since eb34ac4 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
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
16LT_INIT([disable-static])
17
18AC_SUBST(MOD_GNUTLS_VERSION)
19
20AC_PROG_CC
21AC_PROG_CC_C99
22AC_PROG_LD
23AC_PROG_INSTALL
24AC_PROG_LIBTOOL
25
26AC_CONFIG_MACRO_DIR([m4])
27
28AP_VERSION=2.2.0
29CHECK_APACHE(,$AP_VERSION,
30    :,:,
31    AC_MSG_ERROR([*** Apache version $AP_VERSION not found!])
32)
33
34PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 3.1.4])
35
36LIBGNUTLS_VERSION=`pkg-config --modversion gnutls`
37
38AC_ARG_ENABLE(srp,
39       AS_HELP_STRING([--disable-srp],
40               [unconditionally disable the SRP functionality]),
41       use_srp=$enableval, use_srp=yes)
42
43# check if the available GnuTLS library supports SRP
44AC_SEARCH_LIBS([gnutls_srp_server_get_username], [gnutls], [], [use_srp="no"])
45
46SRP_CFLAGS=""
47if test "$use_srp" != "no"; then
48        SRP_CFLAGS="-DENABLE_SRP=1"
49fi
50
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
61AC_MSG_CHECKING([whether to enable SRP functionality])
62AC_MSG_RESULT($use_srp)
63
64dnl Optionally disable flock
65AC_ARG_ENABLE(flock,
66        AS_HELP_STRING([--disable-flock], [Disable use of flock during tests \
67        (some exotic architectures don't support it)]),
68        [use_flock=$enableval], [use_flock=yes])
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"])
84
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])
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      [
97        AC_MSG_CHECKING([for permission to create network and user namespaces])
98        AS_IF([${UNSHARE} --net -r /bin/sh -c \
99                "ip link set up lo && ip addr show" >&AS_MESSAGE_LOG_FD 2>&1],
100              [unshare_works="yes"], [unshare_works="no"])
101        AC_MSG_RESULT([$unshare_works])
102      ],
103      [unshare_works="no"])
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"])
108AM_CONDITIONAL([ENABLE_NETNS], [test "$use_netns" != "no"])
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=""])
114AC_SUBST(MUTEX_TYPE)
115AC_SUBST(PID_AFFIX)
116AM_SUBST_NOTMAKE(MUTEX_TYPE)
117AM_SUBST_NOTMAKE(PID_AFFIX)
118
119AC_ARG_ENABLE(msva,
120       AS_HELP_STRING([--enable-msva],
121               [enable Monkeysphere client certificate verification]),
122       use_msva=$enableval, use_msva=no)
123AM_CONDITIONAL([USE_MSVA], [test "$use_msva" != "no"])
124
125MSVA_CFLAGS=""
126if test "$use_msva" != "no"; then
127        AC_CHECK_HEADERS([msv/msv.h], [],
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!])])
131        MSVA_CFLAGS="-DENABLE_MSVA=1"
132fi
133
134AC_MSG_CHECKING([whether to enable MSVA functionality])
135AC_MSG_RESULT($use_msva)
136
137have_apr_memcache=0
138CHECK_APR_MEMCACHE([have_apr_memcache=1], [have_apr_memcache=0])
139AC_SUBST(have_apr_memcache)
140
141# Building documentation requires pandoc, which in turn needs pdflatex
142# to build PDF output.
143build_doc=no
144AC_PATH_PROG([PANDOC], [pandoc], [no])
145if test "$PANDOC" != "no"; then
146        AC_PATH_PROG([PDFLATEX], [pdflatex], [no])
147        if test "$PDFLATEX" != "no"; then
148                build_doc=yes
149        else
150                build_doc="html only"
151        fi
152else
153        AC_PATH_PROG([MARKDOWN], [markdown], [no])
154        if test "$MARKDOWN" != "no"; then
155                build_doc="html stub"
156        fi
157fi
158AM_CONDITIONAL([USE_PANDOC], [test "$PANDOC" != "no"])
159AM_CONDITIONAL([USE_PDFLATEX], [test "$PANDOC" != "no" && \
160                               test "$PDFLATEX" != "no"])
161AM_CONDITIONAL([USE_MARKDOWN], [test -n "$MARKDOWN" && \
162                               test "$MARKDOWN" != "no"])
163
164# Check for Apache binary
165AC_PATH_PROGS([APACHE2], [apache2 httpd], [no], [$PATH:/usr/sbin])
166if test "${APACHE2}" = "no"; then
167        AC_MSG_WARN([Neither apache2 nor httpd found in \
168                     PATH. Test suite will fail.])
169fi
170
171AC_PATH_PROGS([HTTP_CLI], [curl wget], [no])
172
173MODULE_CFLAGS="${LIBGNUTLS_CFLAGS} ${SRP_CFLAGS} ${MSVA_CFLAGS} ${APR_MEMCACHE_CFLAGS} ${APXS_CFLAGS} ${AP_INCLUDES} ${APR_INCLUDES} ${APU_INCLUDES} ${STRICT_CFLAGS}"
174MODULE_LIBS="${APR_MEMCACHE_LIBS} ${LIBGNUTLS_LIBS}"
175
176AC_PATH_PROGS([SOFTHSM], [softhsm2-util softhsm], [no])
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
184AM_CONDITIONAL([HAVE_SOFTHSM], [test "${SOFTHSM}" != "no"])
185AM_CONDITIONAL([HAVE_SOFTHSM1], [test "${SOFTHSM_MAJOR_VERSION}" = "1"])
186AM_CONDITIONAL([HAVE_SOFTHSM2], [test "${SOFTHSM_MAJOR_VERSION}" = "2"])
187
188AC_SUBST(MODULE_CFLAGS)
189AC_SUBST(MODULE_LIBS)
190
191# assign default values to TEST_HOST and TEST_IP if necessary
192: ${TEST_HOST:="localhost"}
193: ${TEST_IP:="[[::1]] 127.0.0.1"}
194AC_ARG_VAR([TEST_HOST], [Host name to use for server instances started by \
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
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
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
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>"
223AC_SUBST(LISTEN_LIST)
224AM_SUBST_NOTMAKE(LISTEN_LIST)
225
226AC_CONFIG_FILES([Makefile src/Makefile test/Makefile test/tests/Makefile \
227                        doc/Makefile include/mod_gnutls.h \
228                        test/proxy_backend.conf \
229                        test/apache-conf/listen.conf \
230                        test/apache-conf/netns.conf])
231AC_OUTPUT
232
233echo "---"
234echo "Configuration summary for mod_gnutls:"
235echo ""
236echo "   * mod_gnutls version:  ${MOD_GNUTLS_VERSION}"
237echo "   * Apache Modules directory:    ${AP_LIBEXECDIR}"
238echo "   * GnuTLS Library version:      ${LIBGNUTLS_VERSION}"
239echo "   * SRP Authentication:  ${use_srp}"
240echo "   * MSVA Client Verification:    ${use_msva}"
241echo "   * Build documentation: ${build_doc}"
242echo ""
243echo "---"
Note: See TracBrowser for help on using the repository browser.