1 dnl configure.in for linux strongSwan
2 dnl Copyright (C) 2006 Martin Willi
3 dnl Hochschule fuer Technik Rapperswil
5 dnl This program is free software; you can redistribute it and/or modify it
6 dnl under the terms of the GNU General Public License as published by the
7 dnl Free Software Foundation; either version 2 of the License, or (at your
8 dnl option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
10 dnl This program is distributed in the hope that it will be useful, but
11 dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 dnl ===========================
16 dnl initialize & set some vars
17 dnl ===========================
19 AC_INIT(strongSwan,4.1.10)
20 AM_INIT_AUTOMAKE(tar-ustar)
22 AC_SUBST(confdir, '${sysconfdir}')
24 dnl =================================
25 dnl check --enable-xxx & --with-xxx
26 dnl =================================
31 AS_HELP_STRING([--with-default-pkcs11=lib],[set the default PKCS11 library other than "/usr/lib/opensc-pkcs11.so"]),
32 [AC_DEFINE_UNQUOTED(PKCS11_DEFAULT_LIB, "$withval")],
33 [AC_DEFINE_UNQUOTED(PKCS11_DEFAULT_LIB, "/usr/lib/opensc-pkcs11.so")]
38 AS_HELP_STRING([--with-xauth-module=lib],[set the path to the XAUTH module]),
39 [AC_DEFINE_UNQUOTED(XAUTH_DEFAULT_LIB, "$withval")],
44 AS_HELP_STRING([--with-random-device=dev],[set the device for real random data other than "/dev/random"]),
45 [AC_DEFINE_UNQUOTED(DEV_RANDOM, "$withval")],
46 [AC_DEFINE_UNQUOTED(DEV_RANDOM, "/dev/random")]
50 AS_HELP_STRING([--with-resolv-conf=file],[set the file to store DNS server information other than "sysconfdir/resolv.conf"]),
51 [AC_DEFINE_UNQUOTED(RESOLV_CONF, "$withval")],
52 [AC_DEFINE_UNQUOTED(RESOLV_CONF, "${sysconfdir}/resolv.conf")]
57 AS_HELP_STRING([--with-urandom-device=dev],[set the device for pseudo random data other than "/dev/urandom"]),
58 [AC_DEFINE_UNQUOTED(DEV_URANDOM, "$withval")],
59 [AC_DEFINE_UNQUOTED(DEV_URANDOM, "/dev/urandom")]
64 AS_HELP_STRING([--with-ipsecdir=dir],[installation path for ipsec tools other than "libexecdir/ipsec"]),
65 [AC_SUBST(ipsecdir, "$withval")],
66 [AC_SUBST(ipsecdir, "${libexecdir}/ipsec")]
71 AS_HELP_STRING([--with-piddir=dir],[path for PID and UNIX socket files other than "/var/run"]),
72 [AC_SUBST(piddir, "$withval")],
73 [AC_SUBST(piddir, "/var/run")]
78 AS_HELP_STRING([--with-eapdir=dir],[path for pluggable EAP modules other than "ipsecdir/plugins/eap"]),
79 [AC_SUBST(eapdir, "$withval")],
80 [AC_SUBST(eapdir, "${ipsecdir}/plugins/eap")]
85 AS_HELP_STRING([--with-backenddir=dir],[path for pluggable configuration backend modules other than "ipsecdir/plugins/backends"]),
86 [AC_SUBST(backenddir, "$withval")],
87 [AC_SUBST(backenddir, "${ipsecdir}/plugins/backends")]
92 AS_HELP_STRING([--with-interfacedir=dir],[path for pluggable control interface modules other than "ipsecdir/plugins/interfaces"]),
93 [AC_SUBST(interfacedir, "$withval")],
94 [AC_SUBST(interfacedir, "${ipsecdir}/plugins/interfaces")]
99 AS_HELP_STRING([--with-sim-reader=library.so],[library containing the sim_run_alg() function for EAP-SIM]),
100 [AC_DEFINE_UNQUOTED(SIM_READER_LIB, "$withval")]
105 AS_HELP_STRING([--with-linux-headers=dir],[use the linux header files in dir instead of the supplied ones in "src/include"]),
106 [AC_SUBST(linuxdir, "$withval")], [AC_SUBST(linuxdir, "../include")]
108 AC_SUBST(LINUX_HEADERS)
112 AS_HELP_STRING([--with-routing-table=num],[use routing table for IPsec routes (default: 220)]),
113 [AC_DEFINE_UNQUOTED(IPSEC_ROUTING_TABLE, $withval) AC_SUBST(IPSEC_ROUTING_TABLE, "$withval")],
114 [AC_DEFINE_UNQUOTED(IPSEC_ROUTING_TABLE, 220) AC_SUBST(IPSEC_ROUTING_TABLE, "220")]
118 [routing-table-prio],
119 AS_HELP_STRING([--with-routing-table-prio=prio],[priority for IPsec routing table (default: 220)]),
120 [AC_DEFINE_UNQUOTED(IPSEC_ROUTING_TABLE_PRIO, $withval) AC_SUBST(IPSEC_ROUTING_TABLE_PRIO, "$withval")],
121 [AC_DEFINE_UNQUOTED(IPSEC_ROUTING_TABLE_PRIO, 220) AC_SUBST(IPSEC_ROUTING_TABLE_PRIO, "220")]
126 AS_HELP_STRING([--with-uid=uid],[change user of the daemons to UID after startup (default is 0).]),
127 [AC_DEFINE_UNQUOTED(IPSEC_UID, $withval) AC_SUBST(ipsecuid, "$withval")],
128 [AC_DEFINE_UNQUOTED(IPSEC_UID, 0) AC_SUBST(ipsecuid, "0")]
133 AS_HELP_STRING([--with-gid=gid],[change group of the daemons to GID after startup (default is 0).]),
134 [AC_DEFINE_UNQUOTED(IPSEC_GID, $withval) AC_SUBST(ipsecgid, "$withval")],
135 [AC_DEFINE_UNQUOTED(IPSEC_GID, 0) AC_SUBST(ipsecgid, "0")]
140 AS_HELP_STRING([--enable-http],[enable OCSP and fetching of Certificates and CRLs over HTTP (default is NO). Requires libcurl.]),
141 [if test x$enableval = xyes; then
146 AM_CONDITIONAL(USE_LIBCURL, test x$http = xtrue)
150 AS_HELP_STRING([--enable-ldap],[enable fetching of CRLs from LDAP (default is NO). Requires openLDAP.]),
151 [if test x$enableval = xyes; then
156 AM_CONDITIONAL(USE_LIBLDAP, test x$ldap = xtrue)
160 AS_HELP_STRING([--disable-stroke],[disable charons stroke (pluto compatibility) configuration backend. (default is NO).]),
161 [if test x$enableval = xyes; then
168 AM_CONDITIONAL(USE_STROKE, test x$stroke = xtrue)
172 AS_HELP_STRING([--enable-dbus],[enable DBUS configuration and control interface (default is NO). Requires libdbus.]),
173 [if test x$enableval = xyes; then
178 AM_CONDITIONAL(USE_LIBDBUS, test x$dbus = xtrue)
182 AS_HELP_STRING([--enable-xml],[enable XML configuration and control interface (default is NO). Requires libxml.]),
183 [if test x$enableval = xyes; then
188 AM_CONDITIONAL(USE_LIBXML, test x$xml = xtrue)
192 AS_HELP_STRING([--enable-sqlite],[enable SQLite configuration backend (default is NO). Requires libsqlite3.]),
193 [if test x$enableval = xyes; then
198 AM_CONDITIONAL(USE_LIBSQLITE, test x$sqlite = xtrue)
202 AS_HELP_STRING([--enable-smartcard],[enable smartcard support (default is NO).]),
203 [if test x$enableval = xyes; then
208 AM_CONDITIONAL(USE_SMARTCARD, test x$smartcard = xtrue)
212 AS_HELP_STRING([--enable-cisco-quirks],[enable support of Cisco VPN client (default is NO).]),
213 [if test x$enableval = xyes; then
217 AM_CONDITIONAL(USE_CISCO_QUIRKS, test x$cisco_quirks = xtrue)
221 AS_HELP_STRING([--enable-leak-detective],[enable malloc hooks to find memory leaks (default is NO).]),
222 [if test x$enableval = xyes; then
226 AM_CONDITIONAL(USE_LEAK_DETECTIVE, test x$leak_detective = xtrue)
230 AS_HELP_STRING([--enable-eap-sim],[build SIM authenication module for EAP (default is NO).]),
231 [if test x$enableval = xyes; then
235 AM_CONDITIONAL(USE_EAP_SIM, test x$eap_sim = xtrue)
239 AS_HELP_STRING([--enable-eap-identity],[build EAP module providing EAP-Identity helper (default is NO).]),
240 [if test x$enableval = xyes; then
244 AM_CONDITIONAL(USE_EAP_IDENTITY, test x$eap_identity = xtrue)
248 AS_HELP_STRING([--enable-eap-md5],[build MD5 (CHAP) authenication module for EAP (default is NO).]),
249 [if test x$enableval = xyes; then
253 AM_CONDITIONAL(USE_EAP_MD5, test x$eap_md5 = xtrue)
257 AS_HELP_STRING([--enable-eap-aka],[build AKA authentication module for EAP (default is NO).]),
258 [if test x$enableval = xyes; then
262 AM_CONDITIONAL(USE_EAP_AKA, test x$eap_aka = xtrue)
266 AS_HELP_STRING([--enable-nat-transport],[enable NAT traversal with IPsec transport mode (default is NO).]),
267 [if test x$enableval = xyes; then
271 AM_CONDITIONAL(USE_NAT_TRANSPORT, test x$nat_transport = xtrue)
275 AS_HELP_STRING([--disable-vendor-id],[disable the sending of the strongSwan vendor ID (default is NO).]),
276 [if test x$enableval = xyes; then
283 AM_CONDITIONAL(USE_VENDORID, test x$vendor_id = xtrue)
287 AS_HELP_STRING([--disable-xauth-vid],[disable the sending of the XAUTH vendor ID (default is NO).]),
288 [if test x$enableval = xyes; then
295 AM_CONDITIONAL(USE_XAUTH_VID, test x$xauth_vid = xtrue)
299 AS_HELP_STRING([--enable-uml],[build the UML test framework (default is NO).]),
300 [if test x$enableval = xyes; then
304 AM_CONDITIONAL(USE_UML, test x$uml = xtrue)
308 AS_HELP_STRING([--enable-manager],[build web management console (default is NO).]),
309 [if test x$enableval = xyes; then
313 AM_CONDITIONAL(USE_MANAGER, test x$manager = xtrue)
317 AS_HELP_STRING([--enable-p2p],[enable peer-to-peer NAT traversal (default is NO).]),
318 [if test x$enableval = xyes; then
323 AM_CONDITIONAL(USE_P2P, test x$p2p = xtrue)
327 AS_HELP_STRING([--enable-integrity-test],[enable the integrity test of the crypto library (default is NO).]),
328 [if test x$enableval = xyes; then
330 AC_DEFINE(INTEGRITY_TEST)
333 AM_CONDITIONAL(USE_INTEGRITY_TEST, test x$integrity_test = xtrue)
337 AS_HELP_STRING([--disable-self-test],[disable the self-test of the crypto library (default is NO).]),
338 [if test x$enableval = xyes; then
342 AC_DEFINE(NO_SELF_TEST)
346 AM_CONDITIONAL(USE_SELF_TEST, test x$self_test = xtrue)
350 AS_HELP_STRING([--disable-pluto],[disable the IKEv1 keying daemon pluto. (default is NO).]),
351 [if test x$enableval = xyes; then
358 AM_CONDITIONAL(USE_PLUTO, test x$pluto = xtrue)
362 AS_HELP_STRING([--disable-charon],[disable the IKEv2 keying daemon charon. (default is NO).]),
363 [if test x$enableval = xyes; then
370 AM_CONDITIONAL(USE_CHARON, test x$charon = xtrue)
374 AS_HELP_STRING([--disable-tools],[disable additional utilities (openac and scepclient). (default is NO).]),
375 [if test x$enableval = xyes; then
382 AM_CONDITIONAL(USE_TOOLS, test x$tools = xtrue)
384 AM_CONDITIONAL(USE_PLUTO_OR_CHARON, test x$pluto = xtrue -o x$charon = xtrue)
385 AM_CONDITIONAL(USE_LIBSTRONGSWAN, test x$charon = xtrue -o x$tools = xtrue)
386 AM_CONDITIONAL(USE_FILE_CONFIG, test x$pluto = xtrue -o x$stroke = xtrue)
388 dnl =========================
389 dnl check required programs
390 dnl =========================
397 AC_PATH_PROG([GPERF], [gperf], [], [$PATH:/bin:/usr/bin:/usr/local/bin])
398 AC_PATH_PROG([PERL], [perl], [], [$PATH:/bin:/usr/bin:/usr/local/bin])
400 dnl ==========================
401 dnl check required libraries
402 dnl ==========================
404 AC_CHECK_FUNCS(backtrace)
405 AC_CHECK_FUNCS(getifaddrs)
407 AC_HAVE_LIBRARY([gmp],[LIBS="$LIBS"],[AC_MSG_ERROR([GNU Multi Precision library gmp not found])])
408 if test "$ldap" = "true"; then
409 AC_HAVE_LIBRARY([ldap],[LIBS="$LIBS"],[AC_MSG_ERROR([LDAP enabled, but library ldap not found])])
410 AC_HAVE_LIBRARY([lber],[LIBS="$LIBS"],[AC_MSG_ERROR([LDAP enabled, but library lber not found])])
412 if test "$http" = "true"; then
413 AC_HAVE_LIBRARY([curl],[LIBS="$LIBS"],[AC_MSG_ERROR([HTTP enabled, but library curl not found])])
416 if test "$xml" = "true"; then
417 PKG_CHECK_MODULES(xml, [libxml-2.0],, AC_MSG_ERROR([No libxml2 package information found]))
422 if test "$dbus" = "true"; then
423 PKG_CHECK_MODULES(dbus, [dbus-1],, AC_MSG_ERROR([No libdbus package information found]))
424 AC_SUBST(dbus_CFLAGS)
429 dnl =============================
430 dnl check required header files
431 dnl =============================
434 AC_MSG_CHECKING([gmp.h version >= 4.1.4])
438 #if (__GNU_MP_VERSION*100 + __GNU_MP_VERSION_MINOR*10 + __GNU_MP_VERSION_PATCHLEVEL) < 414
442 [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); AC_MSG_ERROR([No usable gmp.h found!])]
444 AC_MSG_CHECKING([capset() definition])
446 [#include <linux/capset.h>],
450 [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); AC_DEFINE_UNQUOTED(NO_CAPSET_DEFINED, 1)]
452 if test "$ldap" = "true"; then
453 AC_CHECK_HEADER([ldap.h],,[AC_MSG_ERROR([LDAP enabled, but ldap.h not found!])])
455 if test "$http" = "true"; then
456 AC_CHECK_HEADER([curl/curl.h],,[AC_MSG_ERROR([HTTP enabled, but curl.h not found!])])
459 dnl ==============================
461 dnl ==============================
467 src/libstrongswan/Makefile
468 src/libcrypto/Makefile
469 src/libfreeswan/Makefile
477 src/_updown_espmark/Makefile
478 src/_copyright/Makefile
480 src/scepclient/Makefile