2013-02-01 10:29:23 +00:00
#
2014-02-07 13:46:25 +00:00
# Copyright (C) 2007-2014 Tobias Brunner
2013-02-01 10:29:23 +00:00
# Copyright (C) 2006-2013 Andreas Steffen
# Copyright (C) 2006-2013 Martin Willi
# Hochschule fuer Technik Rapperswil
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# ============================
# initialize & set some vars
# ============================
2006-05-16 14:24:03 +00:00
2014-02-27 21:46:52 +00:00
AC_INIT([strongSwan],[5.1.2])
2013-11-04 10:59:11 +00:00
AM_INIT_AUTOMAKE(m4_esyscmd([
echo tar-ustar
echo subdir-objects
case `automake --version | head -n 1` in
*" 1.9"*);;
*" 1.10"*);;
*" 1.11"*);;
# don't use parallel test harness in 1.12 and up
*) echo serial-tests;;
esac
]))
2013-04-10 12:01:41 +00:00
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
2009-09-07 07:31:31 +00:00
AC_CONFIG_MACRO_DIR([m4/config])
2012-07-03 14:45:12 +00:00
AC_CONFIG_HEADERS([config.h])
2012-07-04 12:53:21 +00:00
AC_DEFINE([CONFIG_H_INCLUDED], [], [defined if config.h included])
2008-04-28 16:43:30 +00:00
PKG_PROG_PKG_CONFIG
2006-05-16 14:24:03 +00:00
2013-09-02 09:26:31 +00:00
m4_include(m4/macros/split-package-version.m4)
SPLIT_PACKAGE_VERSION
2013-02-01 10:29:23 +00:00
# =================================
# check --enable-xxx & --with-xxx
# =================================
2006-05-17 14:21:38 +00:00
2009-09-07 10:07:57 +00:00
m4_include(m4/macros/with.m4)
ARG_WITH_SUBST([random-device], [/dev/random], [set the device to read real random data from])
ARG_WITH_SUBST([urandom-device], [/dev/urandom], [set the device to read pseudo random data from])
ARG_WITH_SUBST([strongswan-conf], [${sysconfdir}/strongswan.conf], [set the strongswan.conf file location])
ARG_WITH_SUBST([resolv-conf], [${sysconfdir}/resolv.conf], [set the file to use in DNS handler plugin])
ARG_WITH_SUBST([piddir], [/var/run], [set path for PID and UNIX socket files])
ARG_WITH_SUBST([ipsecdir], [${libexecdir%/}/ipsec], [set installation path for ipsec tools])
2011-06-08 13:49:15 +00:00
ARG_WITH_SUBST([ipseclibdir], [${libdir%/}/ipsec], [set installation path for ipsec libraries])
ARG_WITH_SUBST([plugindir], [${ipseclibdir%/}/plugins], [set the installation path of plugins])
2011-07-06 19:53:40 +00:00
ARG_WITH_SUBST([imcvdir], [${ipseclibdir%/}/imcvs], [set the installation path of IMC and IMV dynamic librariers])
2012-04-19 14:40:21 +00:00
ARG_WITH_SUBST([nm-ca-dir], [/usr/share/ca-certificates], [directory the NM backend uses to look up trusted root certificates])
2009-09-07 10:07:57 +00:00
ARG_WITH_SUBST([linux-headers], [\${top_srcdir}/src/include], [set directory of linux header files to use])
ARG_WITH_SUBST([routing-table], [220], [set routing table to use for IPsec routes])
ARG_WITH_SUBST([routing-table-prio], [220], [set priority for IPsec routing table])
2012-06-19 15:12:53 +00:00
ARG_WITH_SUBST([ipsec-script], [ipsec], [change the name of the ipsec script])
2013-04-16 10:37:04 +00:00
ARG_WITH_SUBST([fips-mode], [0], [set openssl FIPS mode: disabled(0), enabled(1), Suite B enabled(2)])
2009-09-07 10:07:57 +00:00
2012-11-08 18:31:24 +00:00
ARG_WITH_SET([tss], [no], [set implementation of the Trusted Computing Group's Software Stack (TSS). Currently the only supported value is "trousers"])
2010-06-15 17:40:44 +00:00
ARG_WITH_SET([capabilities], [no], [set capability dropping library. Currently supported values are "libcap" and "native"])
2010-02-18 16:38:59 +00:00
ARG_WITH_SET([mpz_powm_sec], [yes], [use the more side-channel resistant mpz_powm_sec in libgmp, if available])
2012-07-11 09:16:31 +00:00
ARG_WITH_SET([dev-headers], [no], [install strongSwan development headers to directory.])
2006-05-17 14:21:38 +00:00
2011-03-28 18:04:00 +00:00
if test -n "$PKG_CONFIG"; then
systemdsystemunitdir_default=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
fi
ARG_WITH_SET([systemdsystemunitdir], [$systemdsystemunitdir_default], [directory for systemd service files])
AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$systemdsystemunitdir" -a "x$systemdsystemunitdir" != xno])
AC_SUBST(systemdsystemunitdir)
2008-05-08 10:58:04 +00:00
AC_ARG_WITH(
[user],
2009-07-16 08:59:20 +00:00
AS_HELP_STRING([--with-user=user],[change user of the daemons to "user" after startup (default is "root").]),
2012-07-03 14:40:26 +00:00
[AC_DEFINE_UNQUOTED([IPSEC_USER], "$withval", [username to run daemon with])
AC_SUBST(ipsecuser, "$withval")],
2008-05-08 10:58:04 +00:00
[AC_SUBST(ipsecuser, "root")]
)
AC_ARG_WITH(
[group],
2009-07-16 08:59:20 +00:00
AS_HELP_STRING([--with-group=group],[change group of the daemons to "group" after startup (default is "root").]),
2012-07-03 14:40:26 +00:00
[AC_DEFINE_UNQUOTED(IPSEC_GROUP, "$withval", [groupname to run daemon with])
AC_SUBST(ipsecgroup, "$withval")],
2008-05-08 10:58:04 +00:00
[AC_SUBST(ipsecgroup, "root")]
2007-05-07 12:38:46 +00:00
)
2012-02-13 17:04:04 +00:00
AC_ARG_WITH(
[charon-udp-port],
2012-04-20 12:58:02 +00:00
AS_HELP_STRING([--with-charon-udp-port=port],[UDP port used by charon locally (default 500). Set to 0 to allocate randomly.]),
2012-02-13 17:04:04 +00:00
[AC_DEFINE_UNQUOTED(CHARON_UDP_PORT, [$withval], [UDP port used by charon locally])
AC_SUBST(charon_udp_port, [$withval])],
[AC_SUBST(charon_udp_port, 500)]
)
AC_ARG_WITH(
[charon-natt-port],
2012-04-20 12:58:02 +00:00
AS_HELP_STRING([--with-charon-natt-port=port],[UDP port used by charon locally in case a NAT is detected (must be different from charon-udp-port, default 4500). Set to 0 to allocate randomly.]),
2012-02-13 17:04:04 +00:00
[AC_DEFINE_UNQUOTED(CHARON_NATT_PORT, [$withval], [UDP post used by charon locally in case a NAT is detected])
AC_SUBST(charon_natt_port, [$withval])],
[AC_SUBST(charon_natt_port, 4500)]
)
AC_MSG_CHECKING([configured UDP ports ($charon_udp_port, $charon_natt_port)])
2012-04-20 12:58:02 +00:00
if test x$charon_udp_port != x0 -a x$charon_udp_port = x$charon_natt_port; then
2012-02-13 17:04:04 +00:00
AC_MSG_ERROR(the ports have to be different)
else
AC_MSG_RESULT(ok)
fi
2012-06-19 15:12:53 +00:00
# convert script name to uppercase
AC_SUBST(ipsec_script_upper, [`echo -n "$ipsec_script" | tr a-z A-Z`])
2009-09-07 08:34:14 +00:00
m4_include(m4/macros/enable-disable.m4)
ARG_ENABL_SET([curl], [enable CURL fetcher plugin to fetch files via libcurl. Requires libcurl.])
2012-03-27 07:22:14 +00:00
ARG_ENABL_SET([unbound], [enable UNBOUND resolver plugin to perform DNS queries via libunbound. Requires libldns and libunbound.])
2011-01-17 12:27:18 +00:00
ARG_ENABL_SET([soup], [enable soup fetcher plugin to fetch from HTTP via libsoup. Requires libsoup.])
2009-09-07 08:34:14 +00:00
ARG_ENABL_SET([ldap], [enable LDAP fetching plugin to fetch files via libldap. Requires openLDAP.])
ARG_DISBL_SET([aes], [disable AES software implementation plugin.])
ARG_DISBL_SET([des], [disable DES/3DES software implementation plugin.])
ARG_ENABL_SET([blowfish], [enable Blowfish software implementation plugin.])
2013-04-10 17:24:09 +00:00
ARG_DISBL_SET([rc2], [disable RC2 software implementation plugin.])
2009-09-07 08:34:14 +00:00
ARG_ENABL_SET([md4], [enable MD4 software implementation plugin.])
ARG_DISBL_SET([md5], [disable MD5 software implementation plugin.])
ARG_DISBL_SET([sha1], [disable SHA1 software implementation plugin.])
ARG_DISBL_SET([sha2], [disable SHA256/SHA384/SHA512 software implementation plugin.])
ARG_DISBL_SET([fips-prf], [disable FIPS PRF software implementation plugin.])
ARG_DISBL_SET([gmp], [disable GNU MP (libgmp) based crypto implementation plugin.])
2013-01-04 13:33:45 +00:00
ARG_ENABL_SET([rdrand], [enable Intel RDRAND random generator plugin.])
2009-09-07 08:34:14 +00:00
ARG_DISBL_SET([random], [disable RNG implementation on top of /dev/(u)random.])
2012-05-02 15:49:32 +00:00
ARG_DISBL_SET([nonce], [disable nonce generation plugin.])
2009-09-07 08:34:14 +00:00
ARG_DISBL_SET([x509], [disable X509 certificate implementation plugin.])
2010-07-05 13:26:35 +00:00
ARG_DISBL_SET([revocation], [disable X509 CRL/OCSP revocation check plugin.])
2010-12-09 09:41:54 +00:00
ARG_DISBL_SET([constraints], [disable advanced X509 constraint checking plugin.])
2009-09-07 08:34:14 +00:00
ARG_DISBL_SET([pubkey], [disable RAW public key support plugin.])
ARG_DISBL_SET([pkcs1], [disable PKCS1 key decoding plugin.])
2012-11-26 11:06:44 +00:00
ARG_DISBL_SET([pkcs7], [disable PKCS7 container support plugin.])
2012-01-18 18:12:21 +00:00
ARG_DISBL_SET([pkcs8], [disable PKCS8 private key decoding plugin.])
2013-04-12 09:59:01 +00:00
ARG_DISBL_SET([pkcs12], [disable PKCS12 container support plugin.])
2009-09-07 08:34:14 +00:00
ARG_DISBL_SET([pgp], [disable PGP key decoding plugin.])
ARG_DISBL_SET([dnskey], [disable DNS RR key decoding plugin.])
2013-04-01 13:20:39 +00:00
ARG_DISBL_SET([sshkey], [disable SSH key decoding plugin.])
2013-08-30 15:51:12 +00:00
ARG_ENABL_SET([dnscert], [enable DNSCERT authentication plugin.])
2012-06-08 09:26:50 +00:00
ARG_ENABL_SET([ipseckey], [enable IPSECKEY authentication plugin.])
2009-09-07 08:34:14 +00:00
ARG_DISBL_SET([pem], [disable PEM decoding plugin.])
ARG_DISBL_SET([hmac], [disable HMAC crypto implementation plugin.])
2012-04-03 08:40:47 +00:00
ARG_DISBL_SET([cmac], [disable CMAC crypto implementation plugin.])
2009-09-07 08:34:14 +00:00
ARG_DISBL_SET([xcbc], [disable xcbc crypto implementation plugin.])
2010-11-05 15:15:13 +00:00
ARG_ENABL_SET([af-alg], [enable AF_ALG crypto interface to Linux Crypto API.])
2009-09-07 08:34:14 +00:00
ARG_ENABL_SET([test-vectors], [enable plugin providing crypto test vectors.])
ARG_ENABL_SET([mysql], [enable MySQL database support. Requires libmysqlclient_r.])
ARG_ENABL_SET([sqlite], [enable SQLite database support. Requires libsqlite3.])
2012-06-13 09:33:32 +00:00
ARG_DISBL_SET([stroke], [disable charons stroke configuration backend.])
2009-09-07 08:34:14 +00:00
ARG_ENABL_SET([medsrv], [enable mediation server web frontend and daemon plugin.])
ARG_ENABL_SET([medcli], [enable mediation client configuration database plugin.])
ARG_ENABL_SET([smp], [enable SMP configuration and control interface. Requires libxml.])
ARG_ENABL_SET([sql], [enable SQL database configuration backend.])
ARG_ENABL_SET([leak-detective], [enable malloc hooks to find memory leaks.])
ARG_ENABL_SET([lock-profiler], [enable lock/mutex profiling code.])
2011-05-24 17:28:54 +00:00
ARG_ENABL_SET([unit-tester], [enable unit tests on IKEv2 daemon startup.])
2009-10-15 08:34:49 +00:00
ARG_ENABL_SET([load-tester], [enable load testing plugin for IKEv2 daemon.])
2010-08-30 14:22:33 +00:00
ARG_ENABL_SET([eap-sim], [enable SIM authentication module for EAP.])
2009-09-07 08:34:14 +00:00
ARG_ENABL_SET([eap-sim-file], [enable EAP-SIM backend based on a triplet file.])
2011-04-04 06:51:50 +00:00
ARG_ENABL_SET([eap-sim-pcsc], [enable EAP-SIM backend based on a smartcard reader. Requires libpcsclite.])
2011-09-26 13:43:38 +00:00
ARG_ENABL_SET([eap-aka], [enable EAP AKA authentication module.])
ARG_ENABL_SET([eap-aka-3gpp2], [enable EAP AKA backend implementing 3GPP2 algorithms in software. Requires libgmp.])
2010-06-02 13:55:58 +00:00
ARG_ENABL_SET([eap-simaka-sql], [enable EAP-SIM/AKA backend based on a triplet/quintuplet SQL database.])
2009-10-28 14:34:05 +00:00
ARG_ENABL_SET([eap-simaka-pseudonym], [enable EAP-SIM/AKA pseudonym storage plugin.])
ARG_ENABL_SET([eap-simaka-reauth], [enable EAP-SIM/AKA reauthentication data storage plugin.])
2009-09-07 08:34:14 +00:00
ARG_ENABL_SET([eap-identity], [enable EAP module providing EAP-Identity helper.])
2010-08-30 14:22:33 +00:00
ARG_ENABL_SET([eap-md5], [enable EAP MD5 (CHAP) authentication module.])
2012-08-11 14:05:05 +00:00
ARG_ENABL_SET([eap-gtc], [enable EAP GTC authentication module.])
2010-08-30 14:22:33 +00:00
ARG_ENABL_SET([eap-mschapv2], [enable EAP MS-CHAPv2 authentication module.])
ARG_ENABL_SET([eap-tls], [enable EAP TLS authentication module.])
ARG_ENABL_SET([eap-ttls], [enable EAP TTLS authentication module.])
2011-04-06 12:42:02 +00:00
ARG_ENABL_SET([eap-peap], [enable EAP PEAP authentication module.])
2010-08-30 13:36:24 +00:00
ARG_ENABL_SET([eap-tnc], [enable EAP TNC trusted network connect module.])
2012-08-23 12:42:23 +00:00
ARG_ENABL_SET([eap-dynamic], [enable dynamic EAP proxy module.])
2010-08-30 14:22:33 +00:00
ARG_ENABL_SET([eap-radius], [enable RADIUS proxy authentication module.])
2012-07-02 10:49:29 +00:00
ARG_DISBL_SET([xauth-generic], [disable generic XAuth backend.])
2011-12-19 19:21:02 +00:00
ARG_ENABL_SET([xauth-eap], [enable XAuth backend using EAP methods to verify passwords.])
2012-08-09 12:39:31 +00:00
ARG_ENABL_SET([xauth-pam], [enable XAuth backend using PAM to verify passwords.])
2013-02-04 17:55:54 +00:00
ARG_ENABL_SET([xauth-noauth], [enable XAuth pseudo-backend that does not actually verify or even request any credentials.])
2013-03-31 14:37:30 +00:00
ARG_ENABL_SET([tnc-ifmap], [enable TNC IF-MAP module. Requires libxml])
2011-11-13 20:56:47 +00:00
ARG_ENABL_SET([tnc-pdp], [enable TNC policy decision point module.])
2010-10-07 21:31:23 +00:00
ARG_ENABL_SET([tnc-imc], [enable TNC IMC module.])
ARG_ENABL_SET([tnc-imv], [enable TNC IMV module.])
2013-03-29 21:29:12 +00:00
ARG_ENABL_SET([tnccs-11], [enable TNCCS 1.1 protocol module. Requires libxml])
2010-10-05 19:15:24 +00:00
ARG_ENABL_SET([tnccs-20], [enable TNCCS 2.0 protocol module.])
2011-01-30 23:59:01 +00:00
ARG_ENABL_SET([tnccs-dynamic], [enable dynamic TNCCS protocol discovery module.])
2011-05-30 19:30:09 +00:00
ARG_ENABL_SET([imc-test], [enable IMC test module.])
ARG_ENABL_SET([imv-test], [enable IMV test module.])
2011-07-04 19:40:25 +00:00
ARG_ENABL_SET([imc-scanner], [enable IMC port scanner module.])
ARG_ENABL_SET([imv-scanner], [enable IMV port scanner module.])
2012-10-09 21:58:17 +00:00
ARG_ENABL_SET([imc-os], [enable IMC operating system module.])
ARG_ENABL_SET([imv-os], [enable IMV operating system module.])
2011-06-20 14:30:23 +00:00
ARG_ENABL_SET([imc-attestation],[enable IMC attestation module.])
ARG_ENABL_SET([imv-attestation],[enable IMV attestation module.])
2013-08-15 21:26:00 +00:00
ARG_ENABL_SET([imc-swid], [enable IMC swid module.])
ARG_ENABL_SET([imv-swid], [enable IMV swid module.])
2009-09-07 08:34:14 +00:00
ARG_DISBL_SET([kernel-netlink], [disable the netlink kernel interface.])
ARG_ENABL_SET([kernel-pfkey], [enable the PF_KEY kernel interface.])
ARG_ENABL_SET([kernel-pfroute], [enable the PF_ROUTE kernel interface.])
ARG_ENABL_SET([kernel-klips], [enable the KLIPS kernel interface.])
2013-06-11 16:43:01 +00:00
ARG_ENABL_SET([kernel-libipsec],[enable the libipsec kernel interface.])
2012-02-22 14:32:37 +00:00
ARG_ENABL_SET([libipsec], [enable user space IPsec implementation.])
2010-02-22 13:56:35 +00:00
ARG_DISBL_SET([socket-default], [disable default socket implementation for charon.])
2010-02-24 09:58:23 +00:00
ARG_ENABL_SET([socket-dynamic], [enable dynamic socket implementation for charon])
2010-03-19 11:08:41 +00:00
ARG_ENABL_SET([farp], [enable ARP faking plugin that responds to ARP requests to peers virtual IP])
2009-09-07 08:34:14 +00:00
ARG_ENABL_SET([dumm], [enable the DUMM UML test framework.])
ARG_ENABL_SET([fast], [enable libfast (FastCGI Application Server w/ templates.])
ARG_ENABL_SET([manager], [enable web management console (proof of concept).])
ARG_ENABL_SET([mediation], [enable IKEv2 Mediation Extension.])
ARG_ENABL_SET([integrity-test], [enable integrity testing of libstrongswan and plugins.])
2012-06-13 09:33:32 +00:00
ARG_DISBL_SET([load-warning], [disable the charon plugin load option warning in starter.])
2011-11-09 11:08:40 +00:00
ARG_DISBL_SET([ikev1], [disable IKEv1 protocol support in charon.])
2011-12-19 12:13:45 +00:00
ARG_DISBL_SET([ikev2], [disable IKEv2 protocol support in charon.])
ARG_DISBL_SET([charon], [disable the IKEv1/IKEv2 keying daemon charon.])
2009-09-07 08:34:14 +00:00
ARG_DISBL_SET([tools], [disable additional utilities (openac, scepclient and pki).])
ARG_DISBL_SET([scripts], [disable additional utilities (found in directory scripts).])
2010-10-19 12:42:47 +00:00
ARG_ENABL_SET([conftest], [enforce Suite B conformance test framework.])
2009-09-07 08:34:14 +00:00
ARG_DISBL_SET([updown], [disable updown firewall script plugin.])
ARG_DISBL_SET([attr], [disable strongswan.conf based configuration attribute plugin.])
2009-10-13 15:02:29 +00:00
ARG_ENABL_SET([attr-sql], [enable SQL based configuration attribute plugin.])
2010-03-22 13:39:33 +00:00
ARG_ENABL_SET([dhcp], [enable DHCP based attribute provider plugin.])
2009-09-20 17:06:58 +00:00
ARG_DISBL_SET([resolve], [disable resolve DNS handler plugin.])
2009-09-07 08:34:14 +00:00
ARG_ENABL_SET([padlock], [enables VIA Padlock crypto plugin.])
ARG_ENABL_SET([openssl], [enables the OpenSSL crypto plugin.])
ARG_ENABL_SET([gcrypt], [enables the libgcrypt plugin.])
ARG_ENABL_SET([agent], [enables the ssh-agent signing plugin.])
2013-04-29 09:19:57 +00:00
ARG_ENABL_SET([keychain], [enables OS X Keychain Services credential set.])
2010-07-13 15:34:34 +00:00
ARG_ENABL_SET([pkcs11], [enables the PKCS11 token support plugin.])
2010-08-13 17:39:59 +00:00
ARG_ENABL_SET([ctr], [enables the Counter Mode wrapper crypto plugin.])
2010-08-18 18:38:02 +00:00
ARG_ENABL_SET([ccm], [enables the CCM AEAD wrapper crypto plugin.])
2010-08-19 15:58:30 +00:00
ARG_ENABL_SET([gcm], [enables the GCM AEAD wrapper crypto plugin.])
2013-11-18 20:11:03 +00:00
ARG_ENABL_SET([ntru], [enables the NTRU crypto plugin.])
2010-07-05 12:36:05 +00:00
ARG_ENABL_SET([addrblock], [enables RFC 3779 address block constraint support.])
2012-07-23 15:14:47 +00:00
ARG_ENABL_SET([unity], [enables Cisco Unity extension plugin.])
2009-09-07 08:34:14 +00:00
ARG_ENABL_SET([uci], [enable OpenWRT UCI configuration plugin.])
2013-05-15 13:56:17 +00:00
ARG_ENABL_SET([osx-attr], [enable OS X SystemConfiguration attribute handler.])
2013-03-02 14:57:00 +00:00
ARG_ENABL_SET([android-dns], [enable Android specific DNS handler.])
2012-02-16 17:17:09 +00:00
ARG_ENABL_SET([android-log], [enable Android specific logger plugin.])
2010-09-20 15:36:42 +00:00
ARG_ENABL_SET([maemo], [enable Maemo specific plugin.])
2012-04-19 14:35:44 +00:00
ARG_ENABL_SET([nm], [enable NetworkManager backend.])
2008-10-24 08:06:22 +00:00
ARG_ENABL_SET([ha], [enable high availability cluster plugin.])
2011-02-03 12:38:13 +00:00
ARG_ENABL_SET([whitelist], [enable peer identity whitelisting plugin.])
2012-10-03 14:25:36 +00:00
ARG_ENABL_SET([lookip], [enable fast virtual IP lookup and notification plugin.])
2012-11-06 15:46:49 +00:00
ARG_ENABL_SET([error-notify], [enable error notification plugin.])
2011-08-03 13:16:41 +00:00
ARG_ENABL_SET([certexpire], [enable CSV export of expiration dates of used certificates.])
2013-02-19 13:49:38 +00:00
ARG_ENABL_SET([systime-fix], [enable plugin to handle cert lifetimes with invalid system time gracefully.])
2010-09-08 09:59:00 +00:00
ARG_ENABL_SET([led], [enable plugin to control LEDs on IKEv2 activity using the Linux kernel LED subsystem.])
2011-02-09 14:04:21 +00:00
ARG_ENABL_SET([duplicheck], [advanced duplicate checking plugin using liveness checks.])
2011-02-21 13:05:21 +00:00
ARG_ENABL_SET([coupling], [enable IKEv2 plugin to couple peer certificates permanently to authentication.])
2012-02-27 14:41:53 +00:00
ARG_ENABL_SET([radattr], [enable plugin to inject and process custom RADIUS attributes as IKEv2 client.])
2009-09-07 08:34:14 +00:00
ARG_ENABL_SET([vstr], [enforce using the Vstr string library to replace glibc-like printf hooks.])
2010-03-01 15:16:55 +00:00
ARG_ENABL_SET([monolithic], [build monolithic version of libstrongswan that includes all enabled plugins. Similarly, the plugins of charon are assembled in libcharon.])
2012-07-11 15:37:09 +00:00
ARG_ENABL_SET([bfd-backtraces], [use binutils libbfd to resolve backtraces for memory leaks and segfaults.])
2013-04-05 14:26:27 +00:00
ARG_ENABL_SET([unwind-backtraces],[use libunwind to create backtraces for memory leaks and segfaults.])
2013-03-27 10:03:56 +00:00
ARG_ENABL_SET([coverage], [enable lcov coverage report generation.])
2012-05-18 12:09:24 +00:00
ARG_ENABL_SET([tkm], [enable Trusted Key Manager support.])
2013-03-26 10:26:22 +00:00
ARG_ENABL_SET([cmd], [enable the command line IKE client charon-cmd.])
2009-04-24 03:32:17 +00:00
2013-02-01 10:29:23 +00:00
# ===================================
# option to disable default options
# ===================================
2013-01-31 17:22:25 +00:00
ARG_DISBL_SET([defaults], [disable all default plugins (they can be enabled with their respective --enable options)])
if test x$defaults = xfalse; then
for option in $enabled_by_default; do
eval test x\${${option}_given} = xtrue && continue
let $option=false
done
fi
2013-02-01 10:29:23 +00:00
# ===========================
# set up compiler and flags
# ===========================
2009-04-27 11:34:07 +00:00
if test -z "$CFLAGS"; then
2013-11-25 17:20:13 +00:00
CFLAGS="-g -O2 -Wall -Wno-format -Wno-format-security -Wno-pointer-sign"
2009-04-27 11:34:07 +00:00
fi
AC_PROG_CC
2012-05-18 19:19:52 +00:00
AM_PROG_CC_C_O
2009-07-15 14:04:37 +00:00
AC_LIB_PREFIX
2009-04-27 11:34:07 +00:00
AC_C_BIGENDIAN
2013-02-01 10:29:23 +00:00
# =========================
# check required programs
# =========================
2006-05-16 14:24:03 +00:00
2013-02-01 09:55:33 +00:00
LT_INIT
2006-05-16 14:24:03 +00:00
AC_PROG_INSTALL
2009-07-20 19:01:13 +00:00
AC_PROG_EGREP
2009-07-16 12:59:30 +00:00
AC_PROG_AWK
2006-05-16 14:24:03 +00:00
AC_PROG_LEX
AC_PROG_YACC
2014-01-23 15:44:12 +00:00
AM_PATH_PYTHON(,,[:])
2006-05-24 06:36:46 +00:00
AC_PATH_PROG([PERL], [perl], [], [$PATH:/bin:/usr/bin:/usr/local/bin])
2009-07-16 12:59:30 +00:00
AC_PATH_PROG([GPERF], [gperf], [], [$PATH:/bin:/usr/bin:/usr/local/bin])
2013-02-01 10:29:23 +00:00
# because gperf is not needed by end-users we just report it but do not abort on failure
2009-07-16 12:59:30 +00:00
AC_MSG_CHECKING([gperf version >= 3.0.0])
if test -x "$GPERF"; then
if test "`$GPERF --version | $AWK -F' ' '/^GNU gperf/ { print $3 }' | $AWK -F. '{ print $1 }'`" -ge "3"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
else
AC_MSG_RESULT([not found])
fi
2006-05-16 14:24:03 +00:00
2013-02-01 10:29:23 +00:00
# ========================
# dependency calculation
# ========================
2006-05-16 14:24:03 +00:00
2012-06-25 09:07:49 +00:00
if test x$xauth_generic_given = xfalse -a x$ikev1 = xfalse; then
xauth_generic=false;
fi
2013-06-11 16:43:01 +00:00
if test x$kernel_libipsec = xtrue; then
libipsec=true;
fi
2009-10-08 08:29:43 +00:00
if test x$eap_aka_3gpp2 = xtrue; then
2009-06-16 12:53:16 +00:00
gmp=true;
2009-10-08 08:29:43 +00:00
fi
if test x$eap_aka = xtrue; then
2009-06-16 12:53:16 +00:00
fips_prf=true;
2009-10-19 13:37:36 +00:00
simaka=true;
2009-06-16 12:53:16 +00:00
fi
if test x$eap_sim = xtrue; then
fips_prf=true;
2009-10-19 13:37:36 +00:00
simaka=true;
2009-06-16 12:53:16 +00:00
fi
2011-11-18 18:42:05 +00:00
if test x$eap_radius = xtrue -o x$radattr = xtrue -o x$tnc_pdp = xtrue; then
2012-02-27 14:18:58 +00:00
radius=true;
fi
2012-02-21 15:29:35 +00:00
if test x$tnc_imc = xtrue -o x$tnc_imv = xtrue -o x$tnccs_11 = xtrue -o x$tnccs_11 = xtrue -o x$tnccs_dynamic = xtrue -o x$eap_tnc = xtrue; then
2011-10-31 22:29:49 +00:00
tnc_tnccs=true;
2011-10-20 19:12:29 +00:00
fi
2013-08-19 10:20:57 +00:00
if test x$eap_tls = xtrue -o x$eap_ttls = xtrue -o x$eap_peap = xtrue -o x$tnc_tnccs = xtrue; then
tls=true;
fi
2013-08-15 21:26:00 +00:00
if test x$imc_test = xtrue -o x$imv_test = xtrue -o x$imc_scanner = xtrue -o x$imv_scanner = xtrue -o x$imc_os = xtrue -o x$imv_os = xtrue -o x$imc_attestation = xtrue -o x$imv_attestation = xtrue -o x$imc_swid = xtrue -o x$imv_swid = xtrue; then
2011-05-30 19:30:09 +00:00
imcv=true;
fi
2013-08-15 21:26:00 +00:00
if test x$imc_attestation = xtrue -o x$imv_attestation = xtrue -o x$imc_swid = xtrue -o x$imv_swid = xtrue; then
2011-09-08 10:05:55 +00:00
pts=true;
fi
2009-06-16 12:53:16 +00:00
if test x$fips_prf = xtrue; then
2010-03-08 11:40:45 +00:00
if test x$openssl = xfalse; then
sha1=true;
fi
2009-06-16 12:53:16 +00:00
fi
2013-03-31 14:37:30 +00:00
if test x$smp = xtrue -o x$tnccs_11 = xtrue -o x$tnc_ifmap = xtrue; then
2008-03-28 12:44:01 +00:00
xml=true
fi
if test x$manager = xtrue; then
fast=true
fi
2008-05-14 07:26:19 +00:00
if test x$medsrv = xtrue; then
2009-09-23 09:13:27 +00:00
mediation=true
2008-06-11 14:13:24 +00:00
fast=true
2008-05-14 07:26:19 +00:00
fi
if test x$medcli = xtrue; then
2009-09-23 09:13:27 +00:00
mediation=true
2008-05-14 07:26:19 +00:00
fi
2013-02-01 10:29:23 +00:00
# ===========================================
# check required libraries and header files
# ===========================================
2009-05-06 11:30:38 +00:00
AC_HEADER_STDBOOL
2009-08-14 11:25:22 +00:00
AC_FUNC_ALLOCA
2012-06-27 16:42:25 +00:00
AC_FUNC_STRERROR_R
2008-03-28 12:44:01 +00:00
2013-02-01 10:29:23 +00:00
# libraries needed on some platforms but not on others
# ------------------------------------------------------
2009-04-30 17:13:45 +00:00
saved_LIBS=$LIBS
2009-08-07 16:30:40 +00:00
2013-02-01 10:29:23 +00:00
# FreeBSD and Mac OS X have dlopen integrated in libc, Linux needs libdl
2009-04-30 17:13:45 +00:00
LIBS=""
AC_SEARCH_LIBS(dlopen, dl, [DLLIB=$LIBS])
AC_SUBST(DLLIB)
2013-02-01 10:29:23 +00:00
# glibc's backtrace() can be replicated on FreeBSD with libexecinfo
2009-08-07 16:30:40 +00:00
LIBS=""
AC_SEARCH_LIBS(backtrace, execinfo, [BTLIB=$LIBS])
AC_CHECK_FUNCS(backtrace)
AC_SUBST(BTLIB)
2013-02-01 10:29:23 +00:00
# OpenSolaris needs libsocket and libnsl for socket()
2009-08-14 12:42:03 +00:00
LIBS=""
AC_SEARCH_LIBS(socket, socket, [SOCKLIB=$LIBS],
[AC_CHECK_LIB(nsl, socket, [SOCKLIB="-lsocket -lnsl"], [], [-lsocket])]
)
AC_SUBST(SOCKLIB)
2013-02-01 10:29:23 +00:00
# FreeBSD has clock_gettime in libc, Linux needs librt
2009-08-31 13:03:35 +00:00
LIBS=""
AC_SEARCH_LIBS(clock_gettime, rt, [RTLIB=$LIBS])
AC_CHECK_FUNCS(clock_gettime)
AC_SUBST(RTLIB)
2013-02-01 10:29:23 +00:00
# Android has pthread_* functions in bionic (libc), others need libpthread
2009-12-10 10:08:01 +00:00
LIBS=""
AC_SEARCH_LIBS(pthread_create, pthread, [PTHREADLIB=$LIBS])
AC_SUBST(PTHREADLIB)
2009-08-07 16:30:40 +00:00
LIBS=$saved_LIBS
2013-02-01 10:29:23 +00:00
# ------------------------------------------------------
2009-08-07 16:30:40 +00:00
2009-05-04 11:59:44 +00:00
AC_MSG_CHECKING(for dladdr)
2013-02-01 09:55:33 +00:00
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#define _GNU_SOURCE
#include <dlfcn.h>]],
[[Dl_info* info = 0;
dladdr(0, info);]])],
2012-07-03 14:40:26 +00:00
[AC_MSG_RESULT([yes]); AC_DEFINE([HAVE_DLADDR], [], [have dladdr()])],
2009-05-04 11:59:44 +00:00
[AC_MSG_RESULT([no])]
)
2013-02-01 10:29:23 +00:00
# check if pthread_condattr_setclock(CLOCK_MONOTONE) is supported
2009-08-31 13:13:48 +00:00
saved_LIBS=$LIBS
2009-12-10 10:08:01 +00:00
LIBS=$PTHREADLIB
2009-08-31 13:13:48 +00:00
AC_MSG_CHECKING([for pthread_condattr_setclock(CLOCK_MONOTONE)])
2013-02-01 09:55:33 +00:00
AC_RUN_IFELSE(
[AC_LANG_SOURCE(
[[#include <pthread.h>
int main() { pthread_condattr_t attr;
pthread_condattr_init(&attr);
return pthread_condattr_setclock(&attr, CLOCK_MONOTONIC);}]])],
2012-07-03 14:40:26 +00:00
[AC_MSG_RESULT([yes]);
AC_DEFINE([HAVE_CONDATTR_CLOCK_MONOTONIC], [],
[pthread_condattr_setclock supports CLOCK_MONOTONIC])],
2009-11-09 10:43:15 +00:00
[AC_MSG_RESULT([no])],
2013-02-01 10:29:23 +00:00
# Check existence of pthread_condattr_setclock if cross-compiling
2009-11-09 10:43:15 +00:00
[AC_MSG_RESULT([unknown]);
AC_CHECK_FUNCS(pthread_condattr_setclock,
2012-07-03 14:40:26 +00:00
[AC_DEFINE([HAVE_CONDATTR_CLOCK_MONOTONIC], [],
[have pthread_condattr_setclock()])]
2009-11-09 10:43:15 +00:00
)]
2009-08-31 13:13:48 +00:00
)
2013-02-01 10:29:23 +00:00
# check if we actually are able to configure attributes on cond vars
2009-12-08 17:24:40 +00:00
AC_CHECK_FUNCS(pthread_condattr_init)
2013-02-01 10:29:23 +00:00
# instead of pthread_condattr_setclock Android has this function
2009-12-21 16:03:33 +00:00
AC_CHECK_FUNCS(pthread_cond_timedwait_monotonic)
2013-02-01 10:29:23 +00:00
# check if we can cancel threads
2009-12-22 09:51:11 +00:00
AC_CHECK_FUNCS(pthread_cancel)
2013-02-01 10:29:23 +00:00
# check if native rwlocks are available
2009-12-08 13:06:11 +00:00
AC_CHECK_FUNCS(pthread_rwlock_init)
2013-02-01 10:29:23 +00:00
# check if pthread spinlocks are available
2012-12-13 10:22:40 +00:00
AC_CHECK_FUNCS(pthread_spin_init)
2013-02-01 10:29:23 +00:00
# check if we have POSIX semaphore functions, including timed-wait
2012-08-20 14:58:15 +00:00
AC_CHECK_FUNCS(sem_timedwait)
2009-08-31 13:13:48 +00:00
LIBS=$saved_LIBS
2012-01-10 17:31:33 +00:00
AC_CHECK_FUNC(
[gettid],
2012-07-03 14:40:26 +00:00
[AC_DEFINE([HAVE_GETTID], [], [have gettid()])],
2012-01-10 17:31:33 +00:00
[AC_MSG_CHECKING([for SYS_gettid])
2013-02-01 09:55:33 +00:00
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#define _GNU_SOURCE
#include <unistd.h>
#include <sys/syscall.h>]],
[[int main() {
return syscall(SYS_gettid);}]])],
2012-07-03 14:40:26 +00:00
[AC_MSG_RESULT([yes]);
AC_DEFINE([HAVE_GETTID], [], [have gettid()])
AC_DEFINE([HAVE_SYS_GETTID], [], [have syscall(SYS_gettid)])],
2012-01-10 17:31:33 +00:00
[AC_MSG_RESULT([no])]
)]
2011-12-16 15:21:01 +00:00
)
2014-01-24 10:58:33 +00:00
AC_CHECK_FUNC(
[qsort_r],
[
AC_DEFINE([HAVE_QSORT_R], [], [have qsort_r()])
# set -Werror so that we get an error for "argument ... has
# incompatible pointer type" warnings
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Werror"
AC_MSG_CHECKING([for GNU-style qsort_r])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#define _GNU_SOURCE
#include <stdlib.h>
int cmp (const void *a, const void *b, void *x) { return 0; }]],
[[int arr[] = { 0, 1 };
qsort_r(arr, 2, sizeof(int), cmp, arr);]])],
[AC_MSG_RESULT([yes]);
AC_DEFINE([HAVE_QSORT_R_GNU], [], [have GNU-style qsort_r()])],
[
AC_MSG_RESULT([no]);
AC_MSG_CHECKING([for BSD-style qsort_r])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <stdlib.h>
int cmp (void *x, const void *a, const void *b) { return 0; }]],
[[int arr[] = { 0, 1 };
qsort_r(arr, 2, sizeof(int), arr, cmp);]])],
[AC_MSG_RESULT([yes]);
AC_DEFINE([HAVE_QSORT_R_BSD], [], [have BSD-style qsort_r()])],
[AC_MSG_RESULT([no]);
AC_MSG_FAILURE([qsort_r has unknown semantics])])
])
CFLAGS="$save_CFLAGS"
],
2014-01-27 12:41:21 +00:00
[]
2014-01-24 10:58:33 +00:00
)
2013-02-20 09:38:45 +00:00
AC_CHECK_FUNCS(prctl mallinfo getpass closefrom getpwnam_r getgrnam_r getpwuid_r)
2014-02-25 11:45:38 +00:00
AC_CHECK_FUNCS(fmemopen funopen mmap memrchr)
2010-07-06 14:26:59 +00:00
2013-10-18 07:38:01 +00:00
AC_CHECK_HEADERS(sys/sockio.h glob.h net/if_tun.h linux/fib_rules.h)
2009-08-06 08:01:59 +00:00
AC_CHECK_HEADERS(net/pfkeyv2.h netipsec/ipsec.h netinet6/ipsec.h linux/udp.h)
2013-03-27 08:56:48 +00:00
AC_CHECK_HEADERS(netinet/ip6.h, [], [],
[
#include <sys/types.h>
#include <netinet/in.h>
])
2009-04-30 17:13:45 +00:00
AC_CHECK_MEMBERS([struct sockaddr.sa_len], [], [],
[
#include <sys/types.h>
#include <sys/socket.h>
])
AC_CHECK_MEMBERS([struct sadb_x_policy.sadb_x_policy_priority], [], [],
[
#include <sys/types.h>
#ifdef HAVE_NET_PFKEYV2_H
#include <net/pfkeyv2.h>
#else
#include <stdint.h>
#include <linux/pfkeyv2.h>
#endif
])
2006-12-06 13:59:13 +00:00
2009-12-23 10:30:41 +00:00
AC_MSG_CHECKING([for in6addr_any])
2013-02-01 09:55:33 +00:00
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>]],
[[struct in6_addr in6;
in6 = in6addr_any;]])],
2012-07-03 14:40:26 +00:00
[AC_MSG_RESULT([yes]);
AC_DEFINE([HAVE_IN6ADDR_ANY], [], [have struct in6_addr in6addr_any])],
2009-12-23 10:30:41 +00:00
[AC_MSG_RESULT([no])]
)
AC_MSG_CHECKING([for in6_pktinfo])
2013-02-01 09:55:33 +00:00
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#define _GNU_SOURCE
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>]],
[[struct in6_pktinfo pi;
if (pi.ipi6_ifindex)
{
return 0;
}]])],
2012-07-03 14:40:26 +00:00
[AC_MSG_RESULT([yes]);
AC_DEFINE([HAVE_IN6_PKTINFO], [], [have struct in6_pktinfo.ipi6_ifindex])],
2009-12-23 10:30:41 +00:00
[AC_MSG_RESULT([no])]
)
2009-05-20 18:15:06 +00:00
AC_MSG_CHECKING([for IPSEC_MODE_BEET])
2013-02-01 09:55:33 +00:00
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <sys/types.h>
#ifdef HAVE_NETIPSEC_IPSEC_H
#include <netipsec/ipsec.h>
#elif defined(HAVE_NETINET6_IPSEC_H)
#include <netinet6/ipsec.h>
#else
#include <stdint.h>
#include <linux/ipsec.h>
#endif]],
[[int mode = IPSEC_MODE_BEET;
return mode;]])],
2012-07-03 14:40:26 +00:00
[AC_MSG_RESULT([yes]);
AC_DEFINE([HAVE_IPSEC_MODE_BEET], [], [have IPSEC_MODE_BEET defined])],
2009-05-20 18:15:06 +00:00
[AC_MSG_RESULT([no])]
)
AC_MSG_CHECKING([for IPSEC_DIR_FWD])
2013-02-01 09:55:33 +00:00
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <sys/types.h>
#ifdef HAVE_NETIPSEC_IPSEC_H
#include <netipsec/ipsec.h>
#elif defined(HAVE_NETINET6_IPSEC_H)
#include <netinet6/ipsec.h>
#else
#include <stdint.h>
#include <linux/ipsec.h>
#endif]],
[[int dir = IPSEC_DIR_FWD;
return dir;]])],
2012-07-03 14:40:26 +00:00
[AC_MSG_RESULT([yes]);
AC_DEFINE([HAVE_IPSEC_DIR_FWD], [], [have IPSEC_DIR_FWD defined])],
2009-05-20 18:15:06 +00:00
[AC_MSG_RESULT([no])]
)
2011-10-04 16:46:51 +00:00
AC_MSG_CHECKING([for RTA_TABLE])
2013-02-01 09:55:33 +00:00
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <sys/socket.h>
#include <linux/netlink.h>
#include <linux/rtnetlink.h>]],
[[int rta_type = RTA_TABLE;
return rta_type;]])],
2012-07-03 14:40:26 +00:00
[AC_MSG_RESULT([yes]);
AC_DEFINE([HAVE_RTA_TABLE], [], [have netlink RTA_TABLE defined])],
2011-10-04 16:46:51 +00:00
[AC_MSG_RESULT([no])]
)
2008-12-02 12:14:32 +00:00
AC_MSG_CHECKING([for gcc atomic operations])
2013-02-01 09:55:33 +00:00
AC_RUN_IFELSE([AC_LANG_SOURCE(
[[
int main() {
volatile int ref = 1;
__sync_fetch_and_add (&ref, 1);
__sync_sub_and_fetch (&ref, 1);
/* Make sure test fails if operations are not supported */
__sync_val_compare_and_swap(&ref, 1, 0);
return ref;
}
]])],
[AC_MSG_RESULT([yes]);
AC_DEFINE([HAVE_GCC_ATOMIC_OPERATIONS], [],
2012-07-03 14:40:26 +00:00
[have GCC __sync_* atomic operations])],
2013-02-01 09:55:33 +00:00
[AC_MSG_RESULT([no])],
[AC_MSG_RESULT([no])]
)
2008-12-02 12:14:32 +00:00
2013-02-01 10:29:23 +00:00
# check for the new register_printf_specifier function with len argument,
# or the deprecated register_printf_function without
2009-03-12 18:07:32 +00:00
AC_CHECK_FUNC(
2009-11-12 12:16:46 +00:00
[register_printf_specifier],
2012-07-03 14:40:26 +00:00
[AC_DEFINE([HAVE_PRINTF_SPECIFIER], [], [have register_printf_specifier()])],
2009-11-12 12:16:46 +00:00
[AC_CHECK_FUNC(
[register_printf_function],
2012-07-03 14:40:26 +00:00
[AC_DEFINE([HAVE_PRINTF_FUNCTION], [], [have register_printf_function()])],
2009-11-12 12:16:46 +00:00
[
AC_MSG_NOTICE([printf does not support custom format specifiers!])
2013-10-11 09:06:02 +00:00
builtin_printf=true
2009-11-12 12:16:46 +00:00
]
)]
2009-04-24 03:32:17 +00:00
)
if test x$vstr = xtrue; then
2013-02-01 09:55:33 +00:00
AC_CHECK_LIB([vstr],[main],[LIBS="$LIBS"],[AC_MSG_ERROR([Vstr string library not found])],[])
2013-11-13 10:29:59 +00:00
AC_DEFINE([USE_VSTR], [], [use Vstr string library for printf hooks])
2013-10-11 09:06:02 +00:00
builtin_printf=false
fi
if test x$builtin_printf = xtrue; then
AC_DEFINE([USE_BUILTIN_PRINTF], [], [using builtin printf for printf hooks])
2009-04-24 03:32:17 +00:00
fi
2009-03-12 18:07:32 +00:00
2008-03-28 12:44:01 +00:00
if test x$gmp = xtrue; then
2010-02-18 16:38:59 +00:00
saved_LIBS=$LIBS
2013-02-01 09:55:33 +00:00
AC_CHECK_LIB([gmp],[main],[],[AC_MSG_ERROR([GNU Multi Precision library gmp not found])],[])
2010-02-18 16:38:59 +00:00
AC_MSG_CHECKING([mpz_powm_sec])
if test x$mpz_powm_sec = xyes; then
2013-02-01 09:55:33 +00:00
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include "gmp.h"]],
[[void *x = mpz_powm_sec;]])],
2012-07-03 14:40:26 +00:00
[AC_MSG_RESULT([yes]);
AC_DEFINE([HAVE_MPZ_POWM_SEC], [], [have mpz_mown_sec()])],
[AC_MSG_RESULT([no])]
2010-02-18 16:38:59 +00:00
)
else
AC_MSG_RESULT([disabled])
fi
LIBS=$saved_LIBS
2008-03-28 12:44:01 +00:00
AC_MSG_CHECKING([gmp.h version >= 4.1.4])
2013-02-01 09:55:33 +00:00
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include "gmp.h"]],
[[
#if (__GNU_MP_VERSION*100 + __GNU_MP_VERSION_MINOR*10 + __GNU_MP_VERSION_PATCHLEVEL) < 414
#error bad gmp
#endif]])],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no]); AC_MSG_ERROR([No usable gmp.h found!])]
2008-03-28 12:44:01 +00:00
)
2006-05-16 14:24:03 +00:00
fi
2008-03-28 12:44:01 +00:00
if test x$ldap = xtrue; then
2013-02-01 09:55:33 +00:00
AC_CHECK_LIB([ldap],[main],[LIBS="$LIBS"],[AC_MSG_ERROR([LDAP library ldap not found])],[])
AC_CHECK_LIB([lber],[main],[LIBS="$LIBS"],[AC_MSG_ERROR([LDAP library lber not found])],[])
2008-03-28 12:44:01 +00:00
AC_CHECK_HEADER([ldap.h],,[AC_MSG_ERROR([LDAP header ldap.h not found!])])
2006-05-16 14:24:03 +00:00
fi
2008-03-28 12:44:01 +00:00
if test x$curl = xtrue; then
2013-02-01 09:55:33 +00:00
AC_CHECK_LIB([curl],[main],[LIBS="$LIBS"],[AC_MSG_ERROR([CURL library curl not found])],[])
2008-03-28 12:44:01 +00:00
AC_CHECK_HEADER([curl/curl.h],,[AC_MSG_ERROR([CURL header curl/curl.h not found!])])
fi
2012-03-27 07:22:14 +00:00
if test x$unbound = xtrue; then
AC_HAVE_LIBRARY([ldns],[LIBS="$LIBS"],[AC_MSG_ERROR([UNBOUND library ldns not found])])
AC_CHECK_HEADER([ldns/ldns.h],,[AC_MSG_ERROR([UNBOUND header ldns/ldns.h not found!])])
AC_HAVE_LIBRARY([unbound],[LIBS="$LIBS"],[AC_MSG_ERROR([UNBOUND library libunbound not found])])
AC_CHECK_HEADER([unbound.h],,[AC_MSG_ERROR([UNBOUND header unbound.h not found!])])
fi
2011-01-17 12:27:18 +00:00
if test x$soup = xtrue; then
PKG_CHECK_MODULES(soup, [libsoup-2.4])
AC_SUBST(soup_CFLAGS)
AC_SUBST(soup_LIBS)
fi
2008-03-28 12:44:01 +00:00
if test x$xml = xtrue; then
2008-04-28 16:43:30 +00:00
PKG_CHECK_MODULES(xml, [libxml-2.0])
2007-08-08 14:03:55 +00:00
AC_SUBST(xml_CFLAGS)
AC_SUBST(xml_LIBS)
fi
2012-11-08 18:31:24 +00:00
if test x$tss = xtrousers; then
2013-02-01 09:55:33 +00:00
AC_CHECK_LIB([tspi],[main],[LIBS="$LIBS"],[AC_MSG_ERROR([TrouSerS library libtspi not found])],[])
2011-12-18 17:26:38 +00:00
AC_CHECK_HEADER([trousers/tss.h],,[AC_MSG_ERROR([TrouSerS header trousers/tss.h not found!])])
2012-11-12 09:34:04 +00:00
AC_DEFINE([TSS_TROUSERS], [], [use TrouSerS library libtspi as TSS implementation])
2011-12-18 17:26:38 +00:00
fi
2008-04-28 16:43:30 +00:00
if test x$dumm = xtrue; then
PKG_CHECK_MODULES(gtk, [gtk+-2.0 vte])
AC_SUBST(gtk_CFLAGS)
AC_SUBST(gtk_LIBS)
2009-05-20 12:15:14 +00:00
AC_CHECK_PROGS(RUBY, ruby)
AC_MSG_CHECKING([for Ruby header files])
if test -n "$RUBY"; then
2012-11-08 15:20:41 +00:00
RUBYINCLUDE=
RUBYDIR=`($RUBY -r rbconfig -e 'print RbConfig::CONFIG[["rubyhdrdir"]] || ""') 2>/dev/null`
if test -n "$RUBYDIR" -a -r "$RUBYDIR/ruby.h"; then
RUBYARCH=`($RUBY -r rbconfig -e 'print RbConfig::CONFIG[["arch"]] || ""') 2>/dev/null`
if test -n "$RUBYARCH"; then
AC_MSG_RESULT([$RUBYDIR])
RUBYINCLUDE="-I$RUBYDIR -I$RUBYDIR/$RUBYARCH"
2009-05-20 12:15:14 +00:00
fi
else
2012-11-08 15:20:41 +00:00
RUBYDIR=`($RUBY -r rbconfig -e 'print RbConfig::CONFIG[["archdir"]] || ""') 2>/dev/null`
if test -n "$RUBYDIR" -a -r "$RUBYDIR/ruby.h"; then
AC_MSG_RESULT([$RUBYDIR])
RUBYINCLUDE="-I$RUBYDIR"
fi
fi
if test -z "$RUBYINCLUDE"; then
AC_MSG_ERROR([ruby.h not found])
2009-05-20 12:15:14 +00:00
fi
2012-11-08 15:20:41 +00:00
AC_SUBST(RUBYINCLUDE)
2009-05-20 12:15:14 +00:00
else
AC_MSG_ERROR([don't know how to run ruby])
fi
2012-11-08 18:23:05 +00:00
AC_MSG_CHECKING([for libruby])
saved_LIBS=$LIBS
LIBS=`($RUBY -r rbconfig -e 'print RbConfig::CONFIG[["LIBRUBYARG_SHARED"]] || ""') 2>/dev/null`
AC_TRY_LINK_FUNC(ruby_init,
[AC_MSG_RESULT([$LIBS]); RUBYLIB=$LIBS],
[AC_MSG_ERROR([not found])])
AC_SUBST(RUBYLIB)
2012-11-08 18:24:04 +00:00
AC_CHECK_FUNCS(rb_errinfo)
2012-11-08 18:23:05 +00:00
LIBS=$saved_LIBS
2008-04-28 16:43:30 +00:00
fi
2008-03-28 12:44:01 +00:00
if test x$fast = xtrue; then
2013-02-01 09:55:33 +00:00
AC_CHECK_LIB([neo_cgi],[main],[LIBS="$LIBS"],[AC_MSG_ERROR([ClearSilver library neo_cgi not found!])],[])
AC_CHECK_LIB([neo_utl],[main],[LIBS="$LIBS"],[AC_MSG_ERROR([ClearSilver library neo_utl not found!])],[])
2011-09-01 11:23:37 +00:00
AC_MSG_CHECKING([ClearSilver requires zlib])
saved_CFLAGS=$CFLAGS
saved_LIBS=$LIBS
LIBS="-lneo_cgi -lneo_cs -lneo_utl"
CFLAGS="-I/usr/include/ClearSilver"
2013-02-01 09:55:33 +00:00
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <ClearSilver.h>]],
[[NEOERR *err = cgi_display(NULL, NULL);]])],
2011-09-01 11:23:37 +00:00
[AC_MSG_RESULT([no]); clearsilver_LIBS="$LIBS"],
[AC_MSG_RESULT([yes]); clearsilver_LIBS="$LIBS -lz"]
)
AC_SUBST(clearsilver_LIBS)
LIBS=$saved_LIBS
CFLAGS=$saved_CFLAGS
2013-02-01 10:29:23 +00:00
# autoconf does not like CamelCase!? How to fix this?
# AC_CHECK_HEADER([ClearSilver/ClearSilver.h],,[AC_MSG_ERROR([ClearSilver header file ClearSilver/ClearSilver.h not found!])])
2009-09-07 09:46:16 +00:00
2013-02-01 09:55:33 +00:00
AC_CHECK_LIB([fcgi],[main],[LIBS="$LIBS"],[AC_MSG_ERROR([FastCGI library fcgi not found!])],[])
2008-03-28 12:44:01 +00:00
AC_CHECK_HEADER([fcgiapp.h],,[AC_MSG_ERROR([FastCGI header file fcgiapp.h not found!])])
2007-04-27 14:25:08 +00:00
fi
2008-03-28 12:44:01 +00:00
if test x$mysql = xtrue; then
2009-09-23 10:45:03 +00:00
AC_PATH_PROG([MYSQLCONFIG], [mysql_config], [], [$PATH:/bin:/usr/bin:/usr/local/bin])
if test x$MYSQLCONFIG = x; then
AC_MSG_ERROR([mysql_config not found!])
fi
AC_SUBST(MYSQLLIB, `$MYSQLCONFIG --libs_r`)
AC_SUBST(MYSQLCFLAG, `$MYSQLCONFIG --cflags`)
2008-03-28 12:44:01 +00:00
fi
2006-05-16 14:24:03 +00:00
2008-05-07 14:41:13 +00:00
if test x$sqlite = xtrue; then
2013-02-01 09:55:33 +00:00
AC_CHECK_LIB([sqlite3],[main],[LIBS="$LIBS"],[AC_MSG_ERROR([SQLite library sqlite3 not found])],[])
2008-03-28 12:44:01 +00:00
AC_CHECK_HEADER([sqlite3.h],,[AC_MSG_ERROR([SQLite header sqlite3.h not found!])])
2008-05-07 14:41:13 +00:00
AC_MSG_CHECKING([sqlite3_prepare_v2])
2013-02-01 09:55:33 +00:00
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <sqlite3.h>]],
[[void *test = sqlite3_prepare_v2;]])],
[AC_MSG_RESULT([yes]);
AC_DEFINE([HAVE_SQLITE3_PREPARE_V2], [], [have sqlite3_prepare_v2()])],
[AC_MSG_RESULT([no])]
)
2008-06-30 11:06:18 +00:00
AC_MSG_CHECKING([sqlite3.h version >= 3.3.1])
2013-02-01 09:55:33 +00:00
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <sqlite3.h>]],
[[
#if SQLITE_VERSION_NUMBER < 3003001
#error bad sqlite
#endif]])],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no]); AC_MSG_ERROR([SQLite version >= 3.3.1 required!])]
)
2008-03-28 12:44:01 +00:00
fi
2006-05-16 14:24:03 +00:00
2008-04-28 14:25:19 +00:00
if test x$openssl = xtrue; then
2013-02-01 09:55:33 +00:00
AC_CHECK_LIB([crypto],[main],[LIBS="$LIBS"],[AC_MSG_ERROR([OpenSSL crypto library not found])],[])
2008-04-28 14:25:19 +00:00
AC_CHECK_HEADER([openssl/evp.h],,[AC_MSG_ERROR([OpenSSL header openssl/evp.h not found!])])
fi
2009-06-04 12:23:39 +00:00
if test x$gcrypt = xtrue; then
2013-02-01 09:55:33 +00:00
AC_CHECK_LIB([gcrypt],[main],[LIBS="$LIBS"],[AC_MSG_ERROR([gcrypt library not found])],[-lgpg-error])
2009-08-31 11:14:54 +00:00
AC_CHECK_HEADER([gcrypt.h],,[AC_MSG_ERROR([gcrypt header gcrypt.h not found!])])
2009-06-16 12:23:32 +00:00
AC_MSG_CHECKING([gcrypt CAMELLIA cipher])
2013-02-01 09:55:33 +00:00
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <gcrypt.h>]],
[[enum gcry_cipher_algos alg = GCRY_CIPHER_CAMELLIA128;]])],
2012-07-03 14:40:26 +00:00
[AC_MSG_RESULT([yes]);
AC_DEFINE([HAVE_GCRY_CIPHER_CAMELLIA], [], [have GCRY_CIPHER_CAMELLIA128])],
2009-06-16 12:23:32 +00:00
[AC_MSG_RESULT([no])]
)
2009-06-04 12:23:39 +00:00
fi
2008-06-17 14:17:51 +00:00
if test x$uci = xtrue; then
2013-02-01 09:55:33 +00:00
AC_CHECK_LIB([uci],[main],[LIBS="$LIBS"],[AC_MSG_ERROR([UCI library libuci not found])],[])
2008-06-17 14:17:51 +00:00
AC_CHECK_HEADER([uci.h],,[AC_MSG_ERROR([UCI header uci.h not found!])])
fi
2013-03-02 14:57:00 +00:00
if test x$android_dns = xtrue; then
2013-02-01 09:55:33 +00:00
AC_CHECK_LIB([cutils],[main],[LIBS="$LIBS"],[AC_MSG_ERROR([Android library libcutils not found])],[])
2010-02-17 09:41:55 +00:00
AC_CHECK_HEADER([cutils/properties.h],,[AC_MSG_ERROR([Android header cutils/properties.h not found!])])
2013-02-01 10:29:23 +00:00
# we have to force the use of libdl here because the autodetection
# above does not work correctly when cross-compiling for android.
2010-02-25 10:03:54 +00:00
DLLIB="-ldl"
AC_SUBST(DLLIB)
2010-02-17 09:41:55 +00:00
fi
2010-09-20 14:03:04 +00:00
if test x$maemo = xtrue; then
2010-09-20 15:35:28 +00:00
PKG_CHECK_MODULES(maemo, [glib-2.0 gthread-2.0 libosso osso-af-settings])
AC_SUBST(maemo_CFLAGS)
AC_SUBST(maemo_LIBS)
2010-09-20 14:03:04 +00:00
dbusservicedir="/usr/share/dbus-1/system-services"
AC_SUBST(dbusservicedir)
fi
2011-04-04 06:51:50 +00:00
if test x$eap_sim_pcsc = xtrue; then
PKG_CHECK_MODULES(pcsclite, [libpcsclite])
AC_SUBST(pcsclite_CFLAGS)
AC_SUBST(pcsclite_LIBS)
fi
2008-07-31 11:16:14 +00:00
if test x$nm = xtrue; then
2009-12-08 13:35:16 +00:00
PKG_CHECK_EXISTS([libnm-glib],
2012-05-03 13:16:08 +00:00
[PKG_CHECK_MODULES(nm, [NetworkManager gthread-2.0 libnm-util libnm-glib libnm-glib-vpn])],
[PKG_CHECK_MODULES(nm, [NetworkManager gthread-2.0 libnm_util libnm_glib libnm_glib_vpn])]
2009-12-08 13:35:16 +00:00
)
2008-07-31 11:16:14 +00:00
AC_SUBST(nm_CFLAGS)
AC_SUBST(nm_LIBS)
fi
2012-08-09 12:39:31 +00:00
if test x$xauth_pam = xtrue; then
2013-02-01 09:55:33 +00:00
AC_CHECK_LIB([pam],[main],[LIBS="$LIBS"],[AC_MSG_ERROR([PAM library not found])],[])
2008-08-21 12:10:07 +00:00
AC_CHECK_HEADER([security/pam_appl.h],,[AC_MSG_ERROR([PAM header security/pam_appl.h not found!])])
fi
2010-06-15 17:40:44 +00:00
if test x$capabilities = xnative; then
AC_MSG_NOTICE([Usage of the native Linux capabilities interface is deprecated, use libcap instead])
2013-02-01 10:29:23 +00:00
# Linux requires the following for capset(), Android does not have it,
# but defines capset() in unistd.h instead.
2010-06-15 17:40:44 +00:00
AC_CHECK_HEADERS([sys/capability.h])
AC_CHECK_FUNC(capset,,[AC_MSG_ERROR([capset() not found!])])
2012-07-03 14:40:26 +00:00
AC_DEFINE([CAPABILITIES_NATIVE], [], [have native linux capset()])
2010-06-15 17:40:44 +00:00
fi
2008-08-29 09:24:14 +00:00
if test x$capabilities = xlibcap; then
2013-02-01 09:55:33 +00:00
AC_CHECK_LIB([cap],[main],[LIBS="$LIBS"],[AC_MSG_ERROR([libcap library not found])],[])
2010-06-15 17:40:44 +00:00
AC_CHECK_HEADER([sys/capability.h],
2012-07-03 14:40:26 +00:00
[AC_DEFINE([HAVE_SYS_CAPABILITY_H], [], [have sys/capability.h])],
2010-06-15 17:40:44 +00:00
[AC_MSG_ERROR([libcap header sys/capability.h not found!])])
2012-07-03 14:40:26 +00:00
AC_DEFINE([CAPABILITIES_LIBCAP], [], [have libpcap library])
2008-08-29 09:24:14 +00:00
fi
2009-06-19 15:50:40 +00:00
if test x$integrity_test = xtrue; then
AC_MSG_CHECKING([for dladdr()])
2013-02-01 09:55:33 +00:00
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#define _GNU_SOURCE
#include <dlfcn.h>]],
[[Dl_info info; dladdr(main, &info);]])],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no]);
2009-06-19 15:50:40 +00:00
AC_MSG_ERROR([dladdr() not supported, required by integrity-test!])]
)
AC_MSG_CHECKING([for dl_iterate_phdr()])
2013-02-01 09:55:33 +00:00
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#define _GNU_SOURCE
#include <link.h>]],
[[dl_iterate_phdr((void*)0, (void*)0);]])],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no]);
2009-06-19 15:50:40 +00:00
AC_MSG_ERROR([dl_iterate_phdr() not supported, required by integrity-test!])]
)
fi
2012-07-11 15:37:09 +00:00
if test x$bfd_backtraces = xtrue; then
2013-02-01 09:55:33 +00:00
AC_CHECK_LIB([bfd],[main],[LIBS="$LIBS"],[AC_MSG_ERROR([binutils libbfd not found!])],[])
2012-07-11 15:37:09 +00:00
AC_CHECK_HEADER([bfd.h],[AC_DEFINE([HAVE_BFD_H],,[have binutils bfd.h])],
[AC_MSG_ERROR([binutils bfd.h header not found!])])
BFDLIB="-lbfd"
AC_SUBST(BFDLIB)
fi
2013-04-05 14:26:27 +00:00
if test x$unwind_backtraces = xtrue; then
AC_CHECK_LIB([unwind],[main],[LIBS="$LIBS"],[AC_MSG_ERROR([libunwind not found!])],[])
AC_CHECK_HEADER([libunwind.h],[AC_DEFINE([HAVE_LIBUNWIND_H],,[have libunwind.h])],
[AC_MSG_ERROR([libunwind.h header not found!])])
UNWINDLIB="-lunwind"
AC_SUBST(UNWINDLIB)
fi
2012-07-11 09:16:31 +00:00
AM_CONDITIONAL(USE_DEV_HEADERS, [test "x$dev_headers" != xno])
2012-07-12 06:39:54 +00:00
if test x$dev_headers = xyes; then
dev_headers="$includedir/strongswan"
fi
2012-07-11 09:16:31 +00:00
AC_SUBST(dev_headers)
2012-07-03 14:45:12 +00:00
CFLAGS="$CFLAGS -include `pwd`/config.h"
2012-05-18 12:09:24 +00:00
if test x$tkm = xtrue; then
AC_PATH_PROG([GPRBUILD], [gprbuild], [], [$PATH:/bin:/usr/bin:/usr/local/bin])
2013-11-28 08:37:55 +00:00
if test x$GPRBUILD = x; then
AC_MSG_ERROR([gprbuild not found])