]> git.ipfire.org Git - thirdparty/strongswan.git/blame - configure.in
fixed ikev1/protoport-route timing
[thirdparty/strongswan.git] / configure.in
CommitLineData
f2c2d395
MW
1dnl configure.in for linux strongSwan
2dnl Copyright (C) 2006 Martin Willi
3dnl Hochschule fuer Technik Rapperswil
8b3b4a24 4dnl
f2c2d395
MW
5dnl This program is free software; you can redistribute it and/or modify it
6dnl under the terms of the GNU General Public License as published by the
7dnl Free Software Foundation; either version 2 of the License, or (at your
8dnl option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
8b3b4a24 9dnl
f2c2d395
MW
10dnl This program is distributed in the hope that it will be useful, but
11dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13dnl for more details.
14
15dnl ===========================
16dnl initialize & set some vars
17dnl ===========================
18
31bd75ec 19AC_INIT(strongSwan,4.4.0)
5e5f0bd4 20AM_INIT_AUTOMAKE(tar-ustar)
e455ae13 21AC_CONFIG_MACRO_DIR([m4/config])
a47486b5 22PKG_PROG_PKG_CONFIG
f2c2d395 23
db26d00e
MW
24dnl =================================
25dnl check --enable-xxx & --with-xxx
26dnl =================================
27
b7b56533
MW
28m4_include(m4/macros/with.m4)
29
30ARG_WITH_SUBST([default-pkcs11], [/usr/lib/opensc-pkcs11.so], [set the default PKCS11 library])
31ARG_WITH_SUBST([random-device], [/dev/random], [set the device to read real random data from])
32ARG_WITH_SUBST([urandom-device], [/dev/urandom], [set the device to read pseudo random data from])
33ARG_WITH_SUBST([strongswan-conf], [${sysconfdir}/strongswan.conf], [set the strongswan.conf file location])
34ARG_WITH_SUBST([resolv-conf], [${sysconfdir}/resolv.conf], [set the file to use in DNS handler plugin])
35ARG_WITH_SUBST([piddir], [/var/run], [set path for PID and UNIX socket files])
36ARG_WITH_SUBST([ipsecdir], [${libexecdir%/}/ipsec], [set installation path for ipsec tools])
37ARG_WITH_SUBST([plugindir], [${ipsecdir%/}/plugins], [set the installation path of plugins])
85af7a89 38ARG_WITH_SUBST([nm-ca-dir], [/usr/share/ca-certificates], [directory the NM plugin uses to look up trusted root certificates])
b7b56533
MW
39ARG_WITH_SUBST([linux-headers], [\${top_srcdir}/src/include], [set directory of linux header files to use])
40ARG_WITH_SUBST([routing-table], [220], [set routing table to use for IPsec routes])
41ARG_WITH_SUBST([routing-table-prio], [220], [set priority for IPsec routing table])
42
4819ec6a 43ARG_WITH_SET([capabilities], [no], [set capability dropping library. Currently only the value "libcap" is supported])
3e35a6e7 44ARG_WITH_SET([mpz_powm_sec], [yes], [use the more side-channel resistant mpz_powm_sec in libgmp, if available])
db26d00e 45
195307b5 46AC_ARG_WITH(
6b9290ff
MW
47 [xauth-module],
48 AS_HELP_STRING([--with-xauth-module=lib],[set the path to the XAUTH module]),
49 [AC_DEFINE_UNQUOTED(XAUTH_DEFAULT_LIB, "$withval")],
195307b5
AS
50)
51
25b12c69
MW
52AC_ARG_WITH(
53 [user],
c7e0f07c 54 AS_HELP_STRING([--with-user=user],[change user of the daemons to "user" after startup (default is "root").]),
25b12c69
MW
55 [AC_DEFINE_UNQUOTED(IPSEC_USER, "$withval") AC_SUBST(ipsecuser, "$withval")],
56 [AC_SUBST(ipsecuser, "root")]
57)
58
59AC_ARG_WITH(
60 [group],
c7e0f07c 61 AS_HELP_STRING([--with-group=group],[change group of the daemons to "group" after startup (default is "root").]),
25b12c69
MW
62 [AC_DEFINE_UNQUOTED(IPSEC_GROUP, "$withval") AC_SUBST(ipsecgroup, "$withval")],
63 [AC_SUBST(ipsecgroup, "root")]
6874bf69
MW
64)
65
b803bc82
MW
66m4_include(m4/macros/enable-disable.m4)
67
68ARG_ENABL_SET([curl], [enable CURL fetcher plugin to fetch files via libcurl. Requires libcurl.])
69ARG_ENABL_SET([ldap], [enable LDAP fetching plugin to fetch files via libldap. Requires openLDAP.])
70ARG_DISBL_SET([aes], [disable AES software implementation plugin.])
71ARG_DISBL_SET([des], [disable DES/3DES software implementation plugin.])
72ARG_ENABL_SET([blowfish], [enable Blowfish software implementation plugin.])
73ARG_ENABL_SET([md4], [enable MD4 software implementation plugin.])
74ARG_DISBL_SET([md5], [disable MD5 software implementation plugin.])
75ARG_DISBL_SET([sha1], [disable SHA1 software implementation plugin.])
76ARG_DISBL_SET([sha2], [disable SHA256/SHA384/SHA512 software implementation plugin.])
77ARG_DISBL_SET([fips-prf], [disable FIPS PRF software implementation plugin.])
78ARG_DISBL_SET([gmp], [disable GNU MP (libgmp) based crypto implementation plugin.])
79ARG_DISBL_SET([random], [disable RNG implementation on top of /dev/(u)random.])
80ARG_DISBL_SET([x509], [disable X509 certificate implementation plugin.])
81ARG_DISBL_SET([pubkey], [disable RAW public key support plugin.])
82ARG_DISBL_SET([pkcs1], [disable PKCS1 key decoding plugin.])
83ARG_DISBL_SET([pgp], [disable PGP key decoding plugin.])
84ARG_DISBL_SET([dnskey], [disable DNS RR key decoding plugin.])
85ARG_DISBL_SET([pem], [disable PEM decoding plugin.])
86ARG_DISBL_SET([hmac], [disable HMAC crypto implementation plugin.])
87ARG_DISBL_SET([xcbc], [disable xcbc crypto implementation plugin.])
88ARG_ENABL_SET([test-vectors], [enable plugin providing crypto test vectors.])
89ARG_ENABL_SET([mysql], [enable MySQL database support. Requires libmysqlclient_r.])
90ARG_ENABL_SET([sqlite], [enable SQLite database support. Requires libsqlite3.])
91ARG_DISBL_SET([stroke], [disable charons stroke (pluto compatibility) configuration backend.])
92ARG_ENABL_SET([medsrv], [enable mediation server web frontend and daemon plugin.])
93ARG_ENABL_SET([medcli], [enable mediation client configuration database plugin.])
94ARG_ENABL_SET([smp], [enable SMP configuration and control interface. Requires libxml.])
95ARG_ENABL_SET([sql], [enable SQL database configuration backend.])
96ARG_ENABL_SET([smartcard], [enable smartcard support.])
97ARG_ENABL_SET([cisco-quirks], [enable support of Cisco VPN client.])
98ARG_ENABL_SET([leak-detective], [enable malloc hooks to find memory leaks.])
99ARG_ENABL_SET([lock-profiler], [enable lock/mutex profiling code.])
100ARG_ENABL_SET([unit-tests], [enable unit tests on IKEv2 daemon startup.])
b76b867c 101ARG_ENABL_SET([load-tester], [enable load testing plugin for IKEv2 daemon.])
b803bc82
MW
102ARG_ENABL_SET([eap-sim], [enable SIM authenication module for EAP.])
103ARG_ENABL_SET([eap-sim-file], [enable EAP-SIM backend based on a triplet file.])
edcb2dd3
MW
104ARG_ENABL_SET([eap-simaka-pseudonym], [enable EAP-SIM/AKA pseudonym storage plugin.])
105ARG_ENABL_SET([eap-simaka-reauth], [enable EAP-SIM/AKA reauthentication data storage plugin.])
b803bc82 106ARG_ENABL_SET([eap-identity], [enable EAP module providing EAP-Identity helper.])
ddbb3409
AS
107ARG_ENABL_SET([eap-md5], [enable EAP MD5 (CHAP) authenication module.])
108ARG_ENABL_SET([eap-gtc], [enable PAM based EAP GTC authenication module.])
b803bc82 109ARG_ENABL_SET([eap-aka], [enable EAP AKA authentication module.])
47208157 110ARG_ENABL_SET([eap-aka-3gpp2], [enable EAP AKA backend implementing 3GPP2 algorithms in software. Requires libgmp.])
b803bc82
MW
111ARG_ENABL_SET([eap-mschapv2], [enable EAP MS-CHAPv2 authenication module.])
112ARG_ENABL_SET([eap-radius], [enable RADIUS proxy authenication module.])
113ARG_DISBL_SET([kernel-netlink], [disable the netlink kernel interface.])
114ARG_ENABL_SET([kernel-pfkey], [enable the PF_KEY kernel interface.])
115ARG_ENABL_SET([kernel-pfroute], [enable the PF_ROUTE kernel interface.])
116ARG_ENABL_SET([kernel-klips], [enable the KLIPS kernel interface.])
dab05604
MW
117ARG_DISBL_SET([socket-default], [disable default socket implementation for charon.])
118ARG_ENABL_SET([socket-raw], [enable raw socket implementation of charon, enforced if pluto is enabled])
9ed1bb48 119ARG_ENABL_SET([socket-dynamic], [enable dynamic socket implementation for charon])
0d7b48a3 120ARG_ENABL_SET([farp], [enable ARP faking plugin that responds to ARP requests to peers virtual IP])
b803bc82
MW
121ARG_ENABL_SET([nat-transport], [enable NAT traversal with IPsec transport mode in pluto.])
122ARG_DISBL_SET([vendor-id], [disable the sending of the strongSwan vendor ID in pluto.])
123ARG_DISBL_SET([xauth-vid], [disable the sending of the XAUTH vendor ID.])
124ARG_ENABL_SET([dumm], [enable the DUMM UML test framework.])
125ARG_ENABL_SET([fast], [enable libfast (FastCGI Application Server w/ templates.])
126ARG_ENABL_SET([manager], [enable web management console (proof of concept).])
127ARG_ENABL_SET([mediation], [enable IKEv2 Mediation Extension.])
128ARG_ENABL_SET([integrity-test], [enable integrity testing of libstrongswan and plugins.])
129ARG_DISBL_SET([pluto], [disable the IKEv1 keying daemon pluto.])
130ARG_DISBL_SET([threads], [disable the use of threads in pluto. Charon always uses threads.])
131ARG_DISBL_SET([charon], [disable the IKEv2 keying daemon charon.])
132ARG_DISBL_SET([tools], [disable additional utilities (openac, scepclient and pki).])
133ARG_DISBL_SET([scripts], [disable additional utilities (found in directory scripts).])
134ARG_DISBL_SET([updown], [disable updown firewall script plugin.])
135ARG_DISBL_SET([attr], [disable strongswan.conf based configuration attribute plugin.])
24779482 136ARG_ENABL_SET([attr-sql], [enable SQL based configuration attribute plugin.])
beaa048e 137ARG_ENABL_SET([dhcp], [enable DHCP based attribute provider plugin.])
4819ec6a 138ARG_DISBL_SET([resolve], [disable resolve DNS handler plugin.])
b803bc82
MW
139ARG_ENABL_SET([padlock], [enables VIA Padlock crypto plugin.])
140ARG_ENABL_SET([openssl], [enables the OpenSSL crypto plugin.])
141ARG_ENABL_SET([gcrypt], [enables the libgcrypt plugin.])
142ARG_ENABL_SET([agent], [enables the ssh-agent signing plugin.])
143ARG_ENABL_SET([uci], [enable OpenWRT UCI configuration plugin.])
55699f03 144ARG_ENABL_SET([android], [enable Android specific plugin.])
b803bc82
MW
145ARG_ENABL_SET([nm], [enable NetworkManager plugin.])
146ARG_ENABL_SET([vstr], [enforce using the Vstr string library to replace glibc-like printf hooks.])
3372ad14 147ARG_ENABL_SET([monolithic], [build monolithic version of libstrongswan that includes all enabled plugins. Similarly, the plugins of charon are assembled in libcharon.])
bf45d6dd 148
be0a03be
MW
149dnl =========================
150dnl set up compiler and flags
151dnl =========================
152
153if test -z "$CFLAGS"; then
f5410905 154 CFLAGS="-g -O2 -Wall -Wno-format -Wno-pointer-sign -Wno-strict-aliasing"
be0a03be
MW
155fi
156AC_PROG_CC
f5410905 157AC_LIB_PREFIX
be0a03be
MW
158AC_C_BIGENDIAN
159
f2c2d395
MW
160dnl =========================
161dnl check required programs
162dnl =========================
163
164AC_PROG_INSTALL
165AC_PROG_LIBTOOL
7d2b06da 166AC_PROG_EGREP
69fc7820 167AC_PROG_AWK
f2c2d395
MW
168AC_PROG_LEX
169AC_PROG_YACC
298b06c2 170AC_PATH_PROG([PERL], [perl], [], [$PATH:/bin:/usr/bin:/usr/local/bin])
69fc7820
TB
171AC_PATH_PROG([GPERF], [gperf], [], [$PATH:/bin:/usr/bin:/usr/local/bin])
172
173dnl because gperf is not needed by end-users we just report it but do not abort on failure
174AC_MSG_CHECKING([gperf version >= 3.0.0])
175if test -x "$GPERF"; then
176 if test "`$GPERF --version | $AWK -F' ' '/^GNU gperf/ { print $3 }' | $AWK -F. '{ print $1 }'`" -ge "3"; then
177 AC_MSG_RESULT([yes])
178 else
179 AC_MSG_RESULT([no])
180 fi
181else
182 AC_MSG_RESULT([not found])
183fi
f2c2d395 184
7d2b06da
TB
185dnl translate user/group to numercial ids
186AC_MSG_CHECKING([for uid of user "$ipsecuser"])
187ipsecuid=`id -u $ipsecuser 2>/dev/null`
188if test -n "$ipsecuid"; then
189 AC_MSG_RESULT([$ipsecuid])
190 AC_SUBST(ipsecuid)
191else
192 AC_MSG_ERROR([not found])
193fi
194AC_MSG_CHECKING([for gid of group "$ipsecgroup"])
6ff7ab85 195ipsecgid=`$EGREP "^$ipsecgroup:" /etc/group | $AWK -F: '{ print $3 }'`
7d2b06da
TB
196if test -n "$ipsecgid"; then
197 AC_MSG_RESULT([$ipsecgid])
198 AC_SUBST(ipsecgid)
199else
200 AC_MSG_ERROR([not found])
201fi
202
6b9290ff
MW
203dnl =========================
204dnl dependency calculation
205dnl =========================
f2c2d395 206
47208157 207if test x$eap_aka_3gpp2 = xtrue; then
a998276a 208 gmp=true;
47208157
MW
209fi
210
211if test x$eap_aka = xtrue; then
a998276a 212 fips_prf=true;
f8330d03 213 simaka=true;
a998276a
MW
214fi
215
216if test x$eap_sim = xtrue; then
217 fips_prf=true;
f8330d03 218 simaka=true;
a998276a
MW
219fi
220
221if test x$fips_prf = xtrue; then
40f130da
MW
222 if test x$openssl = xfalse; then
223 sha1=true;
224 fi
a998276a
MW
225fi
226
6b9290ff
MW
227if test x$smp = xtrue; then
228 xml=true
229fi
230
231if test x$manager = xtrue; then
232 fast=true
233fi
234
782db7ed 235if test x$medsrv = xtrue; then
a7f79ee9 236 mediation=true
9529fb68 237 fast=true
782db7ed
MW
238fi
239
240if test x$medcli = xtrue; then
a7f79ee9 241 mediation=true
782db7ed
MW
242fi
243
dab05604
MW
244if test x$pluto = xtrue; then
245 if test x$socket_raw = xfalse; then
9ed1bb48 246 AC_MSG_NOTICE([Enforcing --enable-socket-raw, as pluto is enabled])
dab05604 247 socket_raw=true
0fa7d1ab
MW
248 if test x$socket_default_given = xfalse; then
249 socket_default=false
250 fi
dab05604
MW
251 fi
252fi
253
a9f56adb 254dnl ===========================================
6b9290ff 255dnl check required libraries and header files
a9f56adb
TB
256dnl ===========================================
257
258AC_HEADER_STDBOOL
8b6a5ce5 259AC_FUNC_ALLOCA
6b9290ff 260
3974b2fb
TB
261dnl libraries needed on some platforms but not on others
262dnl ====================================================
ea7e89c7 263saved_LIBS=$LIBS
3974b2fb 264
26965b4e 265dnl FreeBSD and Mac OS X have dlopen integrated in libc, Linux needs libdl
ea7e89c7
TB
266LIBS=""
267AC_SEARCH_LIBS(dlopen, dl, [DLLIB=$LIBS])
ea7e89c7
TB
268AC_SUBST(DLLIB)
269
3974b2fb
TB
270dnl glibc's backtrace() can be replicated on FreeBSD with libexecinfo
271LIBS=""
272AC_SEARCH_LIBS(backtrace, execinfo, [BTLIB=$LIBS])
273AC_CHECK_FUNCS(backtrace)
274AC_SUBST(BTLIB)
275
26965b4e
TB
276dnl OpenSolaris needs libsocket and libnsl for socket()
277LIBS=""
278AC_SEARCH_LIBS(socket, socket, [SOCKLIB=$LIBS],
279 [AC_CHECK_LIB(nsl, socket, [SOCKLIB="-lsocket -lnsl"], [], [-lsocket])]
280)
281AC_SUBST(SOCKLIB)
282
3f310c0d
MW
283dnl FreeBSD has clock_gettime in libc, Linux needs librt
284LIBS=""
285AC_SEARCH_LIBS(clock_gettime, rt, [RTLIB=$LIBS])
286AC_CHECK_FUNCS(clock_gettime)
287AC_SUBST(RTLIB)
288
070ac5b0
TB
289dnl Android has pthread_* functions in bionic (libc), others need libpthread
290LIBS=""
291AC_SEARCH_LIBS(pthread_create, pthread, [PTHREADLIB=$LIBS])
292AC_SUBST(PTHREADLIB)
293
3974b2fb
TB
294LIBS=$saved_LIBS
295dnl ======================
296
4f734a55
MW
297AC_MSG_CHECKING(for dladdr)
298AC_TRY_COMPILE(
299 [#define _GNU_SOURCE
300 #include <dlfcn.h>],
301 [Dl_info* info = 0;
302 dladdr(0, info);],
303 [AC_MSG_RESULT([yes]); AC_DEFINE([HAVE_DLADDR])],
304 [AC_MSG_RESULT([no])]
305)
306
3d5818ec
MW
307dnl check if pthread_condattr_setclock(CLOCK_MONOTONE) is supported
308saved_LIBS=$LIBS
070ac5b0 309LIBS=$PTHREADLIB
3d5818ec
MW
310AC_MSG_CHECKING([for pthread_condattr_setclock(CLOCK_MONOTONE)])
311AC_TRY_RUN(
312 [#include <pthread.h>
313 int main() { pthread_condattr_t attr;
314 pthread_condattr_init(&attr);
315 return pthread_condattr_setclock(&attr, CLOCK_MONOTONIC);}],
316 [AC_MSG_RESULT([yes]); AC_DEFINE([HAVE_CONDATTR_CLOCK_MONOTONIC])],
5269150e
MW
317 [AC_MSG_RESULT([no])],
318 dnl Check existence of pthread_condattr_setclock if cross-compiling
319 [AC_MSG_RESULT([unknown]);
320 AC_CHECK_FUNCS(pthread_condattr_setclock,
321 [AC_DEFINE([HAVE_CONDATTR_CLOCK_MONOTONIC])]
322 )]
3d5818ec 323)
866dc013
TB
324dnl check if we actually are able to configure attributes on cond vars
325AC_CHECK_FUNCS(pthread_condattr_init)
b2944d71
TB
326dnl instead of pthread_condattr_setclock Android has this function
327AC_CHECK_FUNCS(pthread_cond_timedwait_monotonic)
85202e87
TB
328dnl check if we can cancel threads
329AC_CHECK_FUNCS(pthread_cancel)
f36143b0
TB
330dnl check if native rwlocks are available
331AC_CHECK_FUNCS(pthread_rwlock_init)
3d5818ec
MW
332LIBS=$saved_LIBS
333
65ea37ab 334AC_CHECK_FUNCS(prctl)
65ea37ab 335
e580e0a9 336AC_CHECK_HEADERS(sys/sockio.h)
1e7b4b00 337AC_CHECK_HEADERS(net/pfkeyv2.h netipsec/ipsec.h netinet6/ipsec.h linux/udp.h)
ea7e89c7
TB
338
339AC_CHECK_MEMBERS([struct sockaddr.sa_len], [], [],
340[
341 #include <sys/types.h>
342 #include <sys/socket.h>
343])
344
345AC_CHECK_MEMBERS([struct sadb_x_policy.sadb_x_policy_priority], [], [],
346[
347 #include <sys/types.h>
348 #ifdef HAVE_NET_PFKEYV2_H
349 #include <net/pfkeyv2.h>
350 #else
351 #include <stdint.h>
352 #include <linux/pfkeyv2.h>
353 #endif
354])
e696757c 355
cb186f99
TB
356AC_MSG_CHECKING([for in6addr_any])
357AC_TRY_COMPILE(
358 [#include <sys/types.h>
359 #include <sys/socket.h>
360 #include <netinet/in.h>],
361 [struct in6_addr in6;
362 in6 = in6addr_any;],
363 [AC_MSG_RESULT([yes]); AC_DEFINE([HAVE_IN6ADDR_ANY])],
364 [AC_MSG_RESULT([no])]
365)
366
367AC_MSG_CHECKING([for in6_pktinfo])
368AC_TRY_COMPILE(
369 [#define _GNU_SOURCE
370 #include <sys/types.h>
371 #include <sys/socket.h>
372 #include <netinet/in.h>],
373 [struct in6_pktinfo pi;
374 if (pi.ipi6_ifindex)
375 {
376 return 0;
377 }],
378 [AC_MSG_RESULT([yes]); AC_DEFINE([HAVE_IN6_PKTINFO])],
379 [AC_MSG_RESULT([no])]
380)
381
617e59b7
TB
382AC_MSG_CHECKING([for IPSEC_MODE_BEET])
383AC_TRY_COMPILE(
a6ae2a14
TB
384 [#include <sys/types.h>
385 #ifdef HAVE_NETIPSEC_IPSEC_H
617e59b7
TB
386 #include <netipsec/ipsec.h>
387 #elif defined(HAVE_NETINET6_IPSEC_H)
388 #include <netinet6/ipsec.h>
389 #else
a6ae2a14 390 #include <stdint.h>
617e59b7
TB
391 #include <linux/ipsec.h>
392 #endif],
393 [int mode = IPSEC_MODE_BEET;
394 return mode;],
395 [AC_MSG_RESULT([yes]); AC_DEFINE([HAVE_IPSEC_MODE_BEET])],
396 [AC_MSG_RESULT([no])]
397)
398
399AC_MSG_CHECKING([for IPSEC_DIR_FWD])
400AC_TRY_COMPILE(
a6ae2a14
TB
401 [#include <sys/types.h>
402 #ifdef HAVE_NETIPSEC_IPSEC_H
617e59b7
TB
403 #include <netipsec/ipsec.h>
404 #elif defined(HAVE_NETINET6_IPSEC_H)
405 #include <netinet6/ipsec.h>
406 #else
a6ae2a14 407 #include <stdint.h>
617e59b7
TB
408 #include <linux/ipsec.h>
409 #endif],
410 [int dir = IPSEC_DIR_FWD;
411 return dir;],
412 [AC_MSG_RESULT([yes]); AC_DEFINE([HAVE_IPSEC_DIR_FWD])],
413 [AC_MSG_RESULT([no])]
414)
415
efd0fe21
MW
416AC_MSG_CHECKING([for gcc atomic operations])
417AC_TRY_RUN(
418[
419 int main() {
420 volatile int ref = 1;
421 __sync_fetch_and_add (&ref, 1);
422 __sync_sub_and_fetch (&ref, 1);
423 /* Make sure test fails if operations are not supported */
424 __sync_val_compare_and_swap(&ref, 1, 0);
425 return ref;
426 }
427],
428[AC_MSG_RESULT([yes]); AC_DEFINE(HAVE_GCC_ATOMIC_OPERATIONS)],
bb835afa 429[AC_MSG_RESULT([no])],
efd0fe21
MW
430[AC_MSG_RESULT([no])])
431
10bc5d96
MW
432dnl check for the new register_printf_specifier function with len argument,
433dnl or the deprecated register_printf_function without
d25ce370 434AC_CHECK_FUNC(
f6bbcec3 435 [register_printf_specifier],
f6bbcec3
MW
436 [AC_DEFINE(HAVE_PRINTF_SPECIFIER)],
437 [AC_CHECK_FUNC(
f6bbcec3
MW
438 [register_printf_function],
439 [AC_DEFINE(HAVE_PRINTF_FUNCTION)],
440 [
441 AC_MSG_NOTICE([printf does not support custom format specifiers!])
442 vstr=true
443 ]
444 )]
bf45d6dd
TB
445)
446
447if test x$vstr = xtrue; then
448 AC_HAVE_LIBRARY([vstr],[LIBS="$LIBS"],[AC_MSG_ERROR([Vstr string library not found])])
449 AC_DEFINE(USE_VSTR)
450fi
d25ce370 451
6b9290ff 452if test x$gmp = xtrue; then
3e35a6e7
MW
453 saved_LIBS=$LIBS
454 AC_HAVE_LIBRARY([gmp],,[AC_MSG_ERROR([GNU Multi Precision library gmp not found])])
455 AC_MSG_CHECKING([mpz_powm_sec])
456 if test x$mpz_powm_sec = xyes; then
457 AC_TRY_COMPILE(
458 [#include "gmp.h"],
459 [
460 void *x = mpz_powm_sec;
461 ],
462 [AC_MSG_RESULT([yes]); AC_DEFINE(HAVE_MPZ_POWM_SEC)], [AC_MSG_RESULT([no])]
463 )
464 else
465 AC_MSG_RESULT([disabled])
466 fi
467 LIBS=$saved_LIBS
6b9290ff
MW
468 AC_MSG_CHECKING([gmp.h version >= 4.1.4])
469 AC_TRY_COMPILE(
470 [#include "gmp.h"],
471 [
472 #if (__GNU_MP_VERSION*100 + __GNU_MP_VERSION_MINOR*10 + __GNU_MP_VERSION_PATCHLEVEL) < 414
473 #error bad gmp
474 #endif
8b3b4a24 475 ],
6b9290ff
MW
476 [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); AC_MSG_ERROR([No usable gmp.h found!])]
477 )
f2c2d395 478fi
6b9290ff
MW
479
480if test x$ldap = xtrue; then
481 AC_HAVE_LIBRARY([ldap],[LIBS="$LIBS"],[AC_MSG_ERROR([LDAP library ldap not found])])
482 AC_HAVE_LIBRARY([lber],[LIBS="$LIBS"],[AC_MSG_ERROR([LDAP library lber not found])])
483 AC_CHECK_HEADER([ldap.h],,[AC_MSG_ERROR([LDAP header ldap.h not found!])])
f2c2d395
MW
484fi
485
6b9290ff
MW
486if test x$curl = xtrue; then
487 AC_HAVE_LIBRARY([curl],[LIBS="$LIBS"],[AC_MSG_ERROR([CURL library curl not found])])
488 AC_CHECK_HEADER([curl/curl.h],,[AC_MSG_ERROR([CURL header curl/curl.h not found!])])
489fi
490
491if test x$xml = xtrue; then
a47486b5 492 PKG_CHECK_MODULES(xml, [libxml-2.0])
f2d6355e
MW
493 AC_SUBST(xml_CFLAGS)
494 AC_SUBST(xml_LIBS)
495fi
496
a47486b5
MW
497if test x$dumm = xtrue; then
498 PKG_CHECK_MODULES(gtk, [gtk+-2.0 vte])
499 AC_SUBST(gtk_CFLAGS)
500 AC_SUBST(gtk_LIBS)
d2e9cbc9
TB
501 AC_CHECK_PROGS(RUBY, ruby)
502 AC_MSG_CHECKING([for Ruby header files])
503 if test -n "$RUBY"; then
504 RUBYDIR=`($RUBY -rmkmf -e 'print Config::CONFIG[["archdir"]] || $archdir') 2>/dev/null`
505 if test -n "$RUBYDIR"; then
506 dirs="$RUBYDIR"
507 RUBYINCLUDE=none
508 for i in $dirs; do
509 if test -r $i/ruby.h; then
510 AC_MSG_RESULT([$i])
511 RUBYINCLUDE="-I$i"
512 break;
513 fi
514 done
515 if test x"$RUBYINCLUDE" = xnone; then
516 AC_MSG_ERROR([ruby.h not found])
517 fi
518 AC_SUBST(RUBYINCLUDE)
519 else
520 AC_MSG_ERROR([unable to determine ruby configuration])
521 fi
522 else
523 AC_MSG_ERROR([don't know how to run ruby])
524 fi
a47486b5
MW
525fi
526
6b9290ff
MW
527if test x$fast = xtrue; then
528 AC_HAVE_LIBRARY([neo_cgi],[LIBS="$LIBS"],[AC_MSG_ERROR([ClearSilver library neo_cgi not found!])])
529 AC_HAVE_LIBRARY([neo_utl],[LIBS="$LIBS"],[AC_MSG_ERROR([ClearSilver library neo_utl not found!])])
530 AC_HAVE_LIBRARY([z],[LIBS="$LIBS"],[AC_MSG_ERROR([ClearSilver dependency zlib not found!])])
531dnl autoconf does not like CamelCase!? How to fix this?
532dnl AC_CHECK_HEADER([ClearSilver/ClearSilver.h],,[AC_MSG_ERROR([ClearSilver header file ClearSilver/ClearSilver.h not found!])])
8b3b4a24 533
6b9290ff
MW
534 AC_HAVE_LIBRARY([fcgi],[LIBS="$LIBS"],[AC_MSG_ERROR([FastCGI library fcgi not found!])])
535 AC_CHECK_HEADER([fcgiapp.h],,[AC_MSG_ERROR([FastCGI header file fcgiapp.h not found!])])
a84fb01b
MW
536fi
537
6b9290ff 538if test x$mysql = xtrue; then
84074347
MW
539 AC_PATH_PROG([MYSQLCONFIG], [mysql_config], [], [$PATH:/bin:/usr/bin:/usr/local/bin])
540 if test x$MYSQLCONFIG = x; then
541 AC_MSG_ERROR([mysql_config not found!])
542 fi
543 AC_SUBST(MYSQLLIB, `$MYSQLCONFIG --libs_r`)
544 AC_SUBST(MYSQLCFLAG, `$MYSQLCONFIG --cflags`)
6b9290ff 545fi
f2c2d395 546
f8277a83 547if test x$sqlite = xtrue; then
6b9290ff
MW
548 AC_HAVE_LIBRARY([sqlite3],[LIBS="$LIBS"],[AC_MSG_ERROR([SQLite library sqlite3 not found])])
549 AC_CHECK_HEADER([sqlite3.h],,[AC_MSG_ERROR([SQLite header sqlite3.h not found!])])
f8277a83
MW
550 AC_MSG_CHECKING([sqlite3_prepare_v2])
551 AC_TRY_COMPILE(
552 [#include <sqlite3.h>],
553 [
554 void *test = sqlite3_prepare_v2;
8b3b4a24 555 ],
f8277a83 556 [AC_MSG_RESULT([yes])]; AC_DEFINE_UNQUOTED(HAVE_SQLITE3_PREPARE_V2, 1), [AC_MSG_RESULT([no])])
7da767f7
MW
557 AC_MSG_CHECKING([sqlite3.h version >= 3.3.1])
558 AC_TRY_COMPILE(
559 [#include <sqlite3.h>],
560 [
561 #if SQLITE_VERSION_NUMBER < 3003001
562 #error bad sqlite
563 #endif
8b3b4a24 564 ],
7da767f7 565 [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); AC_MSG_ERROR([SQLite version >= 3.3.1 required!])])
6b9290ff 566fi
f2c2d395 567
17353034 568if test x$openssl = xtrue; then
e581a31d 569 AC_HAVE_LIBRARY([crypto],[LIBS="$LIBS"],[AC_MSG_ERROR([OpenSSL crypto library not found])])
17353034
TB
570 AC_CHECK_HEADER([openssl/evp.h],,[AC_MSG_ERROR([OpenSSL header openssl/evp.h not found!])])
571fi
572
4977018c 573if test x$gcrypt = xtrue; then
1d39663f
MW
574 AC_HAVE_LIBRARY([gcrypt],[LIBS="$LIBS"],[AC_MSG_ERROR([gcrypt library not found])])
575 AC_CHECK_HEADER([gcrypt.h],,[AC_MSG_ERROR([gcrypt header gcrypt.h not found!])])
62d6da67
MW
576 AC_MSG_CHECKING([gcrypt CAMELLIA cipher])
577 AC_TRY_COMPILE(
578 [#include <gcrypt.h>],
579 [enum gcry_cipher_algos alg = GCRY_CIPHER_CAMELLIA128;],
580 [AC_MSG_RESULT([yes]); AC_DEFINE([HAVE_GCRY_CIPHER_CAMELLIA])],
581 [AC_MSG_RESULT([no])]
582 )
4977018c
MW
583fi
584
61c46386
MW
585if test x$uci = xtrue; then
586 AC_HAVE_LIBRARY([uci],[LIBS="$LIBS"],[AC_MSG_ERROR([UCI library libuci not found])])
587 AC_CHECK_HEADER([uci.h],,[AC_MSG_ERROR([UCI header uci.h not found!])])
588fi
589
55699f03
MW
590if test x$android = xtrue; then
591 AC_HAVE_LIBRARY([cutils],[LIBS="$LIBS"],[AC_MSG_ERROR([Android library libcutils not found])])
592 AC_CHECK_HEADER([cutils/properties.h],,[AC_MSG_ERROR([Android header cutils/properties.h not found!])])
c711687c
TB
593 dnl we have to force the use of libdl here because the autodetection
594 dnl above does not work correctly when cross-compiling for android.
595 DLLIB="-ldl"
596 AC_SUBST(DLLIB)
55699f03
MW
597fi
598
6dbce9c8 599if test x$nm = xtrue; then
89d236f0
MW
600 PKG_CHECK_EXISTS([libnm-glib],
601 [PKG_CHECK_MODULES(nm, [NetworkManager gthread-2.0 libnm-glib libnm-glib-vpn])],
602 [PKG_CHECK_MODULES(nm, [NetworkManager gthread-2.0 libnm_glib libnm_glib_vpn])]
603 )
6dbce9c8
MW
604 AC_SUBST(nm_CFLAGS)
605 AC_SUBST(nm_LIBS)
606fi
607
1caa265c
MW
608if test x$eap_gtc = xtrue; then
609 AC_HAVE_LIBRARY([pam],[LIBS="$LIBS"],[AC_MSG_ERROR([PAM library not found])])
610 AC_CHECK_HEADER([security/pam_appl.h],,[AC_MSG_ERROR([PAM header security/pam_appl.h not found!])])
611fi
612
eb3e2705
MW
613if test x$capabilities = xlibcap; then
614 AC_HAVE_LIBRARY([cap],[LIBS="$LIBS"],[AC_MSG_ERROR([libcap library not found])])
615 AC_CHECK_HEADER([sys/capability.h],,[AC_MSG_ERROR([libcap header sys/capability.h not found!])])
616fi
617
e4e6a77a
MW
618if test x$integrity_test = xtrue; then
619 AC_MSG_CHECKING([for dladdr()])
620 AC_TRY_COMPILE(
621 [#define _GNU_SOURCE
622 #include <dlfcn.h>],
8b3b4a24 623 [Dl_info info; dladdr(main, &info);],
e4e6a77a
MW
624 [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]);
625 AC_MSG_ERROR([dladdr() not supported, required by integrity-test!])]
626 )
627 AC_MSG_CHECKING([for dl_iterate_phdr()])
628 AC_TRY_COMPILE(
629 [#define _GNU_SOURCE
630 #include <link.h>],
8b3b4a24 631 [dl_iterate_phdr((void*)0, (void*)0);],
e4e6a77a
MW
632 [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]);
633 AC_MSG_ERROR([dl_iterate_phdr() not supported, required by integrity-test!])]
634 )
635fi
636
75dc0192
TB
637dnl ==========================================================
638dnl collect all plugins for libstrongswan, libhydra and pluto
639dnl ==========================================================
1ba62b55
MW
640
641libstrongswan_plugins=
75dc0192 642libhydra_plugins=
de92b9e7 643pluto_plugins=
1ba62b55 644
81811a9d
MW
645if test x$test_vectors = xtrue; then
646 libstrongswan_plugins=${libstrongswan_plugins}" test-vectors"
647 pluto_plugins=${pluto_plugins}" test-vectors"
648fi
1ba62b55 649if test x$curl = xtrue; then
29727a44 650 libstrongswan_plugins=${libstrongswan_plugins}" curl"
de92b9e7 651 pluto_plugins=${pluto_plugins}" curl"
1ba62b55
MW
652fi
653if test x$ldap = xtrue; then
29727a44 654 libstrongswan_plugins=${libstrongswan_plugins}" ldap"
de92b9e7 655 pluto_plugins=${pluto_plugins}" ldap"
1ba62b55
MW
656fi
657if test x$aes = xtrue; then
29727a44 658 libstrongswan_plugins=${libstrongswan_plugins}" aes"
d36ae9e3 659 pluto_plugins=${pluto_plugins}" aes"
1ba62b55
MW
660fi
661if test x$des = xtrue; then
29727a44 662 libstrongswan_plugins=${libstrongswan_plugins}" des"
d36ae9e3
AS
663 pluto_plugins=${pluto_plugins}" des"
664fi
665if test x$blowfish = xtrue; then
666 libstrongswan_plugins=${libstrongswan_plugins}" blowfish"
667 pluto_plugins=${pluto_plugins}" blowfish"
668fi
1ba62b55 669if test x$sha1 = xtrue; then
29727a44 670 libstrongswan_plugins=${libstrongswan_plugins}" sha1"
d36ae9e3 671 pluto_plugins=${pluto_plugins}" sha1"
1ba62b55
MW
672fi
673if test x$sha2 = xtrue; then
29727a44 674 libstrongswan_plugins=${libstrongswan_plugins}" sha2"
d36ae9e3 675 pluto_plugins=${pluto_plugins}" sha2"
1ba62b55 676fi
1e0d1ae2
AS
677if test x$md4 = xtrue; then
678 libstrongswan_plugins=${libstrongswan_plugins}" md4"
679fi
e577ad39
MW
680if test x$md5 = xtrue; then
681 libstrongswan_plugins=${libstrongswan_plugins}" md5"
d36ae9e3 682 pluto_plugins=${pluto_plugins}" md5"
e577ad39 683fi
1ba62b55 684if test x$random = xtrue; then
29727a44 685 libstrongswan_plugins=${libstrongswan_plugins}" random"
bc2e33ca 686 pluto_plugins=${pluto_plugins}" random"
1ba62b55
MW
687fi
688if test x$x509 = xtrue; then
29727a44 689 libstrongswan_plugins=${libstrongswan_plugins}" x509"
f3e9eae2 690 pluto_plugins=${pluto_plugins}" x509"
1ba62b55
MW
691fi
692if test x$pubkey = xtrue; then
29727a44 693 libstrongswan_plugins=${libstrongswan_plugins}" pubkey"
c146b2c8 694 pluto_plugins=${pluto_plugins}" pubkey"
1ba62b55 695fi
1e0f6937
MW
696if test x$pkcs1 = xtrue; then
697 libstrongswan_plugins=${libstrongswan_plugins}" pkcs1"
698 pluto_plugins=${pluto_plugins}" pkcs1"
699fi
9493dd2c
MW
700if test x$pgp = xtrue; then
701 libstrongswan_plugins=${libstrongswan_plugins}" pgp"
702 pluto_plugins=${pluto_plugins}" pgp"
703fi
5ef478aa
MW
704if test x$dnskey = xtrue; then
705 libstrongswan_plugins=${libstrongswan_plugins}" dnskey"
706 pluto_plugins=${pluto_plugins}" dnskey"
707fi
160f4c22
MW
708if test x$pem = xtrue; then
709 libstrongswan_plugins=${libstrongswan_plugins}" pem"
710 pluto_plugins=${pluto_plugins}" pem"
711fi
1ba62b55 712if test x$mysql = xtrue; then
29727a44 713 libstrongswan_plugins=${libstrongswan_plugins}" mysql"
601bc1df 714 pluto_plugins=${pluto_plugins}" mysql"
1ba62b55
MW
715fi
716if test x$sqlite = xtrue; then
29727a44 717 libstrongswan_plugins=${libstrongswan_plugins}" sqlite"
601bc1df 718 pluto_plugins=${pluto_plugins}" sqlite"
1ba62b55
MW
719fi
720if test x$padlock = xtrue; then
29727a44 721 libstrongswan_plugins=${libstrongswan_plugins}" padlock"
1ba62b55
MW
722fi
723if test x$openssl = xtrue; then
29727a44 724 libstrongswan_plugins=${libstrongswan_plugins}" openssl"
13e51a62 725 pluto_plugins=${pluto_plugins}" openssl"
1ba62b55 726fi
4977018c
MW
727if test x$gcrypt = xtrue; then
728 libstrongswan_plugins=${libstrongswan_plugins}" gcrypt"
729 pluto_plugins=${pluto_plugins}" gcrypt"
730fi
40f130da
MW
731if test x$fips_prf = xtrue; then
732 libstrongswan_plugins=${libstrongswan_plugins}" fips-prf"
733fi
0c013ff3
MW
734if test x$xcbc = xtrue; then
735 libstrongswan_plugins=${libstrongswan_plugins}" xcbc"
736fi
737if test x$hmac = xtrue; then
738 libstrongswan_plugins=${libstrongswan_plugins}" hmac"
739 pluto_plugins=${pluto_plugins}" hmac"
740fi
21c95463
MW
741if test x$agent = xtrue; then
742 libstrongswan_plugins=${libstrongswan_plugins}" agent"
743fi
e577ad39
MW
744if test x$gmp = xtrue; then
745 libstrongswan_plugins=${libstrongswan_plugins}" gmp"
96d42f44 746 pluto_plugins=${pluto_plugins}" gmp"
e577ad39 747fi
a5ec3025
TB
748if test x$attr = xtrue; then
749 libhydra_plugins=${libhydra_plugins}" attr"
750 pluto_plugins=${pluto_plugins}" attr"
751fi
75dc0192
TB
752if test x$attr_sql = xtrue -o x$sql = xtrue; then
753 libhydra_plugins=${libhydra_plugins}" attr-sql"
754 pluto_plugins=${pluto_plugins}" attr-sql"
755fi
1ba62b55
MW
756
757AC_SUBST(libstrongswan_plugins)
75dc0192 758AC_SUBST(libhydra_plugins)
de92b9e7 759AC_SUBST(pluto_plugins)
1ba62b55 760
6b9290ff
MW
761dnl =========================
762dnl set Makefile.am vars
763dnl =========================
f2c2d395 764
1ba62b55
MW
765dnl libstrongswan plugins
766dnl =====================
81811a9d 767AM_CONDITIONAL(USE_TEST_VECTORS, test x$test_vectors = xtrue)
6b9290ff
MW
768AM_CONDITIONAL(USE_CURL, test x$curl = xtrue)
769AM_CONDITIONAL(USE_LDAP, test x$ldap = xtrue)
770AM_CONDITIONAL(USE_AES, test x$aes = xtrue)
771AM_CONDITIONAL(USE_DES, test x$des = xtrue)
d36ae9e3 772AM_CONDITIONAL(USE_BLOWFISH, test x$blowfish = xtrue)
1e0d1ae2 773AM_CONDITIONAL(USE_MD4, test x$md4 = xtrue)
6b9290ff
MW
774AM_CONDITIONAL(USE_MD5, test x$md5 = xtrue)
775AM_CONDITIONAL(USE_SHA1, test x$sha1 = xtrue)
776AM_CONDITIONAL(USE_SHA2, test x$sha2 = xtrue)
777AM_CONDITIONAL(USE_FIPS_PRF, test x$fips_prf = xtrue)
778AM_CONDITIONAL(USE_GMP, test x$gmp = xtrue)
6a365f07 779AM_CONDITIONAL(USE_RANDOM, test x$random = xtrue)
6b9290ff 780AM_CONDITIONAL(USE_X509, test x$x509 = xtrue)
affd7a90 781AM_CONDITIONAL(USE_PUBKEY, test x$pubkey = xtrue)
1e0f6937 782AM_CONDITIONAL(USE_PKCS1, test x$pkcs1 = xtrue)
9493dd2c 783AM_CONDITIONAL(USE_PGP, test x$pgp = xtrue)
5ef478aa 784AM_CONDITIONAL(USE_DNSKEY, test x$dnskey = xtrue)
160f4c22 785AM_CONDITIONAL(USE_PEM, test x$pem = xtrue)
6b9290ff 786AM_CONDITIONAL(USE_HMAC, test x$hmac = xtrue)
27d04e05 787AM_CONDITIONAL(USE_XCBC, test x$xcbc = xtrue)
6b9290ff
MW
788AM_CONDITIONAL(USE_MYSQL, test x$mysql = xtrue)
789AM_CONDITIONAL(USE_SQLITE, test x$sqlite = xtrue)
24779482 790AM_CONDITIONAL(USE_ATTR_SQL, test x$attr_sql = xtrue -o x$sql = xtrue)
1ba62b55
MW
791AM_CONDITIONAL(USE_PADLOCK, test x$padlock = xtrue)
792AM_CONDITIONAL(USE_OPENSSL, test x$openssl = xtrue)
4977018c 793AM_CONDITIONAL(USE_GCRYPT, test x$gcrypt = xtrue)
21c95463 794AM_CONDITIONAL(USE_AGENT, test x$agent = xtrue)
1ba62b55
MW
795
796dnl charon plugins
797dnl ==============
6b9290ff 798AM_CONDITIONAL(USE_STROKE, test x$stroke = xtrue)
5b7ec6d4 799AM_CONDITIONAL(USE_MEDSRV, test x$medsrv = xtrue)
782db7ed 800AM_CONDITIONAL(USE_MEDCLI, test x$medcli = xtrue)
6dbce9c8 801AM_CONDITIONAL(USE_NM, test x$nm = xtrue)
61c46386 802AM_CONDITIONAL(USE_UCI, test x$uci = xtrue)
55699f03 803AM_CONDITIONAL(USE_ANDROID, test x$android = xtrue)
6b9290ff
MW
804AM_CONDITIONAL(USE_SMP, test x$smp = xtrue)
805AM_CONDITIONAL(USE_SQL, test x$sql = xtrue)
ad3af574 806AM_CONDITIONAL(USE_UPDOWN, test x$updown = xtrue)
adc25ec2 807AM_CONDITIONAL(USE_ATTR, test x$attr = xtrue)
beaa048e 808AM_CONDITIONAL(USE_DHCP, test x$dhcp = xtrue)
4819ec6a 809AM_CONDITIONAL(USE_RESOLVE, test x$resolve = xtrue)
b76b867c
MW
810AM_CONDITIONAL(USE_UNIT_TESTS, test x$unit_tests = xtrue)
811AM_CONDITIONAL(USE_LOAD_TESTER, test x$load_tester = xtrue)
6b9290ff 812AM_CONDITIONAL(USE_EAP_SIM, test x$eap_sim = xtrue)
79a87846 813AM_CONDITIONAL(USE_EAP_SIM_FILE, test x$eap_sim_file = xtrue)
edcb2dd3
MW
814AM_CONDITIONAL(USE_EAP_SIMAKA_PSEUDONYM, test x$eap_simaka_pseudonym = xtrue)
815AM_CONDITIONAL(USE_EAP_SIMAKA_REAUTH, test x$eap_simaka_reauth = xtrue)
6b9290ff
MW
816AM_CONDITIONAL(USE_EAP_IDENTITY, test x$eap_identity = xtrue)
817AM_CONDITIONAL(USE_EAP_MD5, test x$eap_md5 = xtrue)
1caa265c 818AM_CONDITIONAL(USE_EAP_GTC, test x$eap_gtc = xtrue)
6b9290ff 819AM_CONDITIONAL(USE_EAP_AKA, test x$eap_aka = xtrue)
47208157 820AM_CONDITIONAL(USE_EAP_AKA_3GPP2, test x$eap_aka_3gpp2 = xtrue)
f98cdf7a 821AM_CONDITIONAL(USE_EAP_MSCHAPV2, test x$eap_mschapv2 = xtrue)
4a6b84a9 822AM_CONDITIONAL(USE_EAP_RADIUS, test x$eap_radius = xtrue)
09d7ef26 823AM_CONDITIONAL(USE_KERNEL_NETLINK, test x$kernel_netlink = xtrue)
1adaa02b 824AM_CONDITIONAL(USE_KERNEL_PFKEY, test x$kernel_pfkey = xtrue)
ea7e89c7 825AM_CONDITIONAL(USE_KERNEL_PFROUTE, test x$kernel_pfroute = xtrue)
ea625fab 826AM_CONDITIONAL(USE_KERNEL_KLIPS, test x$kernel_klips = xtrue)
dab05604
MW
827AM_CONDITIONAL(USE_SOCKET_DEFAULT, test x$socket_default = xtrue)
828AM_CONDITIONAL(USE_SOCKET_RAW, test x$socket_raw = xtrue)
9ed1bb48 829AM_CONDITIONAL(USE_SOCKET_DYNAMIC, test x$socket_dynamic = xtrue)
0d7b48a3 830AM_CONDITIONAL(USE_FARP, test x$farp = xtrue)
1ba62b55
MW
831
832dnl other options
833dnl =============
834AM_CONDITIONAL(USE_SMARTCARD, test x$smartcard = xtrue)
835AM_CONDITIONAL(USE_CISCO_QUIRKS, test x$cisco_quirks = xtrue)
836AM_CONDITIONAL(USE_LEAK_DETECTIVE, test x$leak_detective = xtrue)
02140125 837AM_CONDITIONAL(USE_LOCK_PROFILER, test x$lock_profiler = xtrue)
6b9290ff
MW
838AM_CONDITIONAL(USE_NAT_TRANSPORT, test x$nat_transport = xtrue)
839AM_CONDITIONAL(USE_VENDORID, test x$vendor_id = xtrue)
840AM_CONDITIONAL(USE_XAUTH_VID, test x$xauth_vid = xtrue)
841AM_CONDITIONAL(USE_DUMM, test x$dumm = xtrue)
842AM_CONDITIONAL(USE_FAST, test x$fast = xtrue)
843AM_CONDITIONAL(USE_MANAGER, test x$manager = xtrue)
e20b7921 844AM_CONDITIONAL(USE_ME, test x$mediation = xtrue)
6b9290ff 845AM_CONDITIONAL(USE_INTEGRITY_TEST, test x$integrity_test = xtrue)
eb3e2705 846AM_CONDITIONAL(USE_CAPABILITIES, test x$capabilities = xlibcap)
6b9290ff 847AM_CONDITIONAL(USE_PLUTO, test x$pluto = xtrue)
6905f794 848AM_CONDITIONAL(USE_THREADS, test x$threads = xtrue)
6b9290ff
MW
849AM_CONDITIONAL(USE_CHARON, test x$charon = xtrue)
850AM_CONDITIONAL(USE_TOOLS, test x$tools = xtrue)
cf00cffe 851AM_CONDITIONAL(USE_SCRIPTS, test x$scripts = xtrue)
4985ad6e 852AM_CONDITIONAL(USE_LIBSTRONGSWAN, test x$charon = xtrue -o x$pluto = xtrue -o x$tools = xtrue)
0bf68cbf 853AM_CONDITIONAL(USE_LIBHYDRA, test x$charon = xtrue -o x$pluto = xtrue)
6b9290ff 854AM_CONDITIONAL(USE_FILE_CONFIG, test x$pluto = xtrue -o x$stroke = xtrue)
d25ce370 855AM_CONDITIONAL(USE_VSTR, test x$vstr = xtrue)
f8330d03 856AM_CONDITIONAL(USE_SIMAKA, test x$simaka = xtrue)
3372ad14 857AM_CONDITIONAL(MONOLITHIC, test x$monolithic = xtrue)
f2c2d395 858
9e72d3bc
MW
859dnl ==============================
860dnl set global definitions
861dnl ==============================
862
a7f79ee9 863if test x$mediation = xtrue; then
9e72d3bc
MW
864 AC_DEFINE(ME)
865fi
eb3e2705
MW
866if test x$capabilities = xlibcap; then
867 AC_DEFINE(CAPABILITIES)
868fi
3372ad14
TB
869if test x$monolithic = xtrue; then
870 AC_DEFINE(MONOLITHIC)
871fi
872
9e72d3bc 873
f2c2d395
MW
874dnl ==============================
875dnl build Makefiles
876dnl ==============================
877
878AC_OUTPUT(
879 Makefile
880 src/Makefile
04a7b6d8 881 src/include/Makefile
f2c2d395 882 src/libstrongswan/Makefile
552cc11b
MW
883 src/libstrongswan/plugins/aes/Makefile
884 src/libstrongswan/plugins/des/Makefile
d36ae9e3 885 src/libstrongswan/plugins/blowfish/Makefile
1e0d1ae2 886 src/libstrongswan/plugins/md4/Makefile
552cc11b
MW
887 src/libstrongswan/plugins/md5/Makefile
888 src/libstrongswan/plugins/sha1/Makefile
889 src/libstrongswan/plugins/sha2/Makefile
890 src/libstrongswan/plugins/fips_prf/Makefile
891 src/libstrongswan/plugins/gmp/Makefile
6a365f07 892 src/libstrongswan/plugins/random/Makefile
552cc11b 893 src/libstrongswan/plugins/hmac/Makefile
27d04e05 894 src/libstrongswan/plugins/xcbc/Makefile
552cc11b 895 src/libstrongswan/plugins/x509/Makefile
affd7a90 896 src/libstrongswan/plugins/pubkey/Makefile
1e0f6937 897 src/libstrongswan/plugins/pkcs1/Makefile
9493dd2c 898 src/libstrongswan/plugins/pgp/Makefile
5ef478aa 899 src/libstrongswan/plugins/dnskey/Makefile
160f4c22 900 src/libstrongswan/plugins/pem/Makefile
552cc11b
MW
901 src/libstrongswan/plugins/curl/Makefile
902 src/libstrongswan/plugins/ldap/Makefile
903 src/libstrongswan/plugins/mysql/Makefile
904 src/libstrongswan/plugins/sqlite/Makefile
36d62fac 905 src/libstrongswan/plugins/padlock/Makefile
17353034 906 src/libstrongswan/plugins/openssl/Makefile
4977018c 907 src/libstrongswan/plugins/gcrypt/Makefile
21c95463 908 src/libstrongswan/plugins/agent/Makefile
81811a9d 909 src/libstrongswan/plugins/test_vectors/Makefile
0bf68cbf 910 src/libhydra/Makefile
a5ec3025 911 src/libhydra/plugins/attr/Makefile
75dc0192 912 src/libhydra/plugins/attr_sql/Makefile
f2c2d395 913 src/libfreeswan/Makefile
f8330d03 914 src/libsimaka/Makefile
f2c2d395
MW
915 src/pluto/Makefile
916 src/whack/Makefile
917 src/charon/Makefile
bd3f8ea3
TB
918 src/libcharon/Makefile
919 src/libcharon/plugins/eap_aka/Makefile
920 src/libcharon/plugins/eap_aka_3gpp2/Makefile
921 src/libcharon/plugins/eap_identity/Makefile
922 src/libcharon/plugins/eap_md5/Makefile
923 src/libcharon/plugins/eap_gtc/Makefile
924 src/libcharon/plugins/eap_sim/Makefile
925 src/libcharon/plugins/eap_sim_file/Makefile
926 src/libcharon/plugins/eap_simaka_pseudonym/Makefile
927 src/libcharon/plugins/eap_simaka_reauth/Makefile
928 src/libcharon/plugins/eap_mschapv2/Makefile
929 src/libcharon/plugins/eap_radius/Makefile
930 src/libcharon/plugins/kernel_netlink/Makefile
931 src/libcharon/plugins/kernel_pfkey/Makefile
932 src/libcharon/plugins/kernel_pfroute/Makefile
933 src/libcharon/plugins/kernel_klips/Makefile
934 src/libcharon/plugins/socket_default/Makefile
935 src/libcharon/plugins/socket_raw/Makefile
936 src/libcharon/plugins/socket_dynamic/Makefile
0d7b48a3 937 src/libcharon/plugins/farp/Makefile
bd3f8ea3
TB
938 src/libcharon/plugins/smp/Makefile
939 src/libcharon/plugins/sql/Makefile
940 src/libcharon/plugins/medsrv/Makefile
941 src/libcharon/plugins/medcli/Makefile
942 src/libcharon/plugins/nm/Makefile
943 src/libcharon/plugins/uci/Makefile
944 src/libcharon/plugins/android/Makefile
945 src/libcharon/plugins/stroke/Makefile
946 src/libcharon/plugins/updown/Makefile
beaa048e 947 src/libcharon/plugins/dhcp/Makefile
bd3f8ea3
TB
948 src/libcharon/plugins/resolve/Makefile
949 src/libcharon/plugins/unit_tester/Makefile
950 src/libcharon/plugins/load_tester/Makefile
f2c2d395
MW
951 src/stroke/Makefile
952 src/ipsec/Makefile
953 src/starter/Makefile
954 src/_updown/Makefile
955 src/_updown_espmark/Makefile
956 src/_copyright/Makefile
957 src/openac/Makefile
958 src/scepclient/Makefile
7c577c8e 959 src/pki/Makefile
f2d6355e 960 src/dumm/Makefile
2d9ce480 961 src/dumm/ext/extconf.rb
552cc11b 962 src/libfast/Makefile
b8c7453a 963 src/manager/Makefile
9529fb68 964 src/medsrv/Makefile
67a7bb02 965 src/checksum/Makefile
39b7780d 966 scripts/Makefile
9ee1111d 967 testing/Makefile
f2c2d395 968)