]> git.ipfire.org Git - thirdparty/strongswan.git/blobdiff - configure.ac
charon-nm: Add support for EAP-TLS
[thirdparty/strongswan.git] / configure.ac
index 26fd707b7b4ac15149aec486210008f034f411fa..b0d5fcb8c78e1919c6ab62703daf5601a8b523a3 100644 (file)
@@ -1,6 +1,6 @@
 #
 # Copyright (C) 2007-2017 Tobias Brunner
-# Copyright (C) 2006-2017 Andreas Steffen
+# Copyright (C) 2006-2019 Andreas Steffen
 # Copyright (C) 2006-2014 Martin Willi
 # HSR Hochschule fuer Technik Rapperswil
 #
@@ -19,7 +19,7 @@
 #  initialize & set some vars
 # ============================
 
-AC_INIT([strongSwan],[5.7.0dr8])
+AC_INIT([strongSwan],[5.8.2])
 AM_INIT_AUTOMAKE(m4_esyscmd([
        echo tar-ustar
        echo subdir-objects
@@ -55,7 +55,7 @@ ARG_WITH_SUBST([piddir],             [/var/run], [set path for PID and UNIX sock
 ARG_WITH_SUBST([ipsecdir],           [${libexecdir%/}/ipsec], [set installation path for ipsec tools])
 ARG_WITH_SUBST([ipseclibdir],        [${libdir%/}/ipsec], [set installation path for ipsec libraries])
 ARG_WITH_SUBST([plugindir],          [${ipseclibdir%/}/plugins], [set the installation path of plugins])
-ARG_WITH_SUBST([imcvdir],            [${ipseclibdir%/}/imcvs], [set the installation path of IMC and IMV dynamic librariers])
+ARG_WITH_SUBST([imcvdir],            [${ipseclibdir%/}/imcvs], [set the installation path of IMC and IMV dynamic libraries])
 ARG_WITH_SUBST([nm-ca-dir],          [/usr/share/ca-certificates], [directory the NM backend uses to look up trusted root certificates])
 ARG_WITH_SUBST([swanctldir],         [${sysconfdir}/swanctl], [base directory for swanctl configuration files and credentials])
 ARG_WITH_SUBST([linux-headers],      [\${top_srcdir}/src/include], [set directory of linux header files to use])
@@ -63,7 +63,7 @@ ARG_WITH_SUBST([routing-table],      [220], [set routing table to use for IPsec
 ARG_WITH_SUBST([routing-table-prio], [220], [set priority for IPsec routing table])
 ARG_WITH_SUBST([ipsec-script],       [ipsec], [change the name of the ipsec script])
 ARG_WITH_SUBST([fips-mode],          [0], [set openssl FIPS mode: disabled(0), enabled(1), Suite B enabled(2)])
-ARG_WITH_SUBST([libfuzzer],          [], [path to libFuzzer.a])
+ARG_WITH_SUBST([libfuzzer],          [], [-fsanitize=fuzzer or path to libFuzzer.a, a local driver is used if not specified])
 ARG_WITH_SET([capabilities],         [no], [set capability dropping library. Currently supported values are "libcap" and "native"])
 ARG_WITH_SET([mpz_powm_sec],         [yes], [use the more side-channel resistant mpz_powm_sec in libgmp, if available])
 ARG_WITH_SET([dev-headers],          [no], [install strongSwan development headers to directory.])
@@ -126,11 +126,13 @@ ARG_DISBL_SET([aes],            [disable AES software implementation plugin.])
 ARG_ENABL_SET([af-alg],         [enable AF_ALG crypto interface to Linux Crypto API.])
 ARG_ENABL_SET([bliss],          [enable BLISS software implementation plugin.])
 ARG_ENABL_SET([blowfish],       [enable Blowfish software implementation plugin.])
+ARG_ENABL_SET([botan],          [enables the Botan crypto plugin.])
 ARG_ENABL_SET([ccm],            [enables the CCM AEAD wrapper crypto plugin.])
 ARG_ENABL_SET([chapoly],        [enables the ChaCha20/Poly1305 AEAD plugin.])
 ARG_DISBL_SET([cmac],           [disable CMAC crypto implementation plugin.])
 ARG_ENABL_SET([ctr],            [enables the Counter Mode wrapper crypto plugin.])
 ARG_DISBL_SET([des],            [disable DES/3DES software implementation plugin.])
+ARG_DISBL_SET([drbg],           [disable the NIST Deterministic Random Bit Generator plugin.])
 ARG_DISBL_SET([fips-prf],       [disable FIPS PRF software implementation plugin.])
 ARG_ENABL_SET([gcm],            [enables the GCM AEAD wrapper crypto plugin.])
 ARG_ENABL_SET([gcrypt],         [enables the libgcrypt plugin.])
@@ -144,6 +146,7 @@ ARG_ENABL_SET([newhope],        [enable New Hope crypto plugin.])
 ARG_DISBL_SET([nonce],          [disable nonce generation plugin.])
 ARG_ENABL_SET([ntru],           [enables the NTRU crypto plugin.])
 ARG_ENABL_SET([openssl],        [enables the OpenSSL crypto plugin.])
+ARG_ENABL_SET([wolfssl],        [enables the wolfSSL crypto plugin.])
 ARG_ENABL_SET([padlock],        [enables VIA Padlock crypto plugin.])
 ARG_DISBL_SET([random],         [disable RNG implementation on top of /dev/(u)random.])
 ARG_DISBL_SET([rc2],            [disable RC2 software implementation plugin.])
@@ -371,33 +374,35 @@ AC_PROG_LEX
 AC_PROG_YACC
 AM_PATH_PYTHON(,,[:])
 AC_PATH_PROG([PERL], [perl], [], [$PATH:/bin:/usr/bin:/usr/local/bin])
+AC_ARG_VAR([PERL], [the Perl interpreter])
 AC_PATH_PROG([GPERF], [gperf], [], [$PATH:/bin:/usr/bin:/usr/local/bin])
+AC_ARG_VAR([GPERF], [the GNU gperf program])
 
-# because gperf is not needed by end-users we just report it but do not abort on failure
-AC_MSG_CHECKING([gperf version >= 3.0.0])
+# because gperf is not needed by end-users we only abort if generated files don't exist
+AC_MSG_CHECKING([gperf len type])
 if test -x "$GPERF"; then
-       if test "`$GPERF --version | $AWK -F' ' '/^GNU gperf/ { print $3 }' | $AWK -F. '{ print $1 }'`" -ge "3"; then
-               GPERF_OUTPUT="`echo foo | ${GPERF}`"
-               AC_COMPILE_IFELSE(
+       GPERF_OUTPUT="`echo foo | ${GPERF}`"
+       AC_COMPILE_IFELSE(
+               [AC_LANG_PROGRAM(
+                       [[#include <string.h>
+                         const char *in_word_set(const char*, size_t); $GPERF_OUTPUT]])],
+               [GPERF_LEN_TYPE=size_t],
+               [AC_COMPILE_IFELSE(
                        [AC_LANG_PROGRAM(
                                [[#include <string.h>
-                                 const char *in_word_set(const char*, size_t); $GPERF_OUTPUT]])],
-                       [GPERF_LEN_TYPE=size_t],
-                       [AC_COMPILE_IFELSE(
-                               [AC_LANG_PROGRAM(
-                                       [[#include <string.h>
-                                         const char *in_word_set(const char*, unsigned); $GPERF_OUTPUT]])],
-                               [GPERF_LEN_TYPE=unsigned],
-                               [AC_MSG_ERROR([unable to determine gperf len type])]
-                       )]
-               )
-               AC_SUBST(GPERF_LEN_TYPE)
-               AC_MSG_RESULT([yes])
-       else
-               AC_MSG_RESULT([no])
-       fi
+                                 const char *in_word_set(const char*, unsigned); $GPERF_OUTPUT]])],
+                       [GPERF_LEN_TYPE=unsigned],
+                       [AC_MSG_ERROR([unable to determine gperf len type])]
+               )]
+       )
+       AC_SUBST(GPERF_LEN_TYPE)
+       AC_MSG_RESULT([$GPERF_LEN_TYPE])
 else
        AC_MSG_RESULT([not found])
+       GPERF_TEST_FILE="$srcdir/src/libstrongswan/crypto/proposal/proposal_keywords_static.c"
+       if test ! -f "$GPERF_TEST_FILE"; then
+               AC_MSG_ERROR([GNU gperf required to generate e.g. $GPERF_TEST_FILE])
+       fi
 fi
 
 # ========================
@@ -443,7 +448,7 @@ if test x$imc_test = xtrue -o x$imv_test = xtrue -o x$imc_scanner = xtrue -o x$i
 fi
 
 if test x$fips_prf = xtrue; then
-       if test x$openssl = xfalse; then
+       if test x$openssl = xfalse -a x$wolfssl = xfalse; then
                sha1=true;
        fi
 fi
@@ -648,7 +653,7 @@ AC_CHECK_FUNC(
 )
 
 AC_CHECK_FUNCS(prctl mallinfo getpass closefrom getpwnam_r getgrnam_r getpwuid_r)
-AC_CHECK_FUNCS(fmemopen funopen mmap memrchr setlinebuf strptime dirfd sigwaitinfo)
+AC_CHECK_FUNCS(fmemopen funopen mmap memrchr setlinebuf strptime dirfd sigwaitinfo explicit_bzero)
 
 AC_CHECK_FUNC([syslog], [
        AC_DEFINE([HAVE_SYSLOG], [], [have syslog(3) and friends])
@@ -1024,22 +1029,24 @@ if test x$tss_tss2 = xtrue; then
        PKG_CHECK_MODULES(tss2_esys, [tss2-esys],
                [tss2_esys=true; AC_DEFINE([TSS2_ESYS], [], [use TSS2 v2 Extended System API])],
                [tss2_esys=false])
-       PKG_CHECK_MODULES(tss2_tabrmd, [tcti-tabrmd],
-               [tss2_tabrmd=true; AC_DEFINE([TSS2_TCTI_TABRMD], [], [use TCTI Access Broker and Resource Mamager])],
-               [tss2_tabrmd=false])
-       PKG_CHECK_MODULES(tss2_socket, [tcti-socket],
-               [tss2_socket=true; AC_DEFINE([TSS2_TCTI_SOCKET], [], [use TCTI Sockets])],
-               [tss2_socket=false])
        if test x$tss2_sys = xtrue; then
                AC_DEFINE([TSS_TSS2_V2], [], [use TSS 2.0 v2 libraries])
                AC_SUBST(tss2_CFLAGS, "$tss2_sys_CFLAGS")
                AC_SUBST(tss2_LIBS, "$tss2_sys_LIBS")
-       elif test x$tss2_tabrmd = xtrue -o x$tss2_socket = xtrue; then
-               AC_DEFINE([TSS_TSS2_V1], [], [use TSS 2.0 v1 libraries])
-               AC_SUBST(tss2_CFLAGS, "$tss2_tabrmd_CFLAGS $tss2_socket_CFLAGS")
-               AC_SUBST(tss2_LIBS, "$tss2_tabrmd_LIBS $tss2_socket_LIBS")
        else
-               AC_MSG_FAILURE([no TSS2 TCTI or SAPI libraries detected])
+               PKG_CHECK_MODULES(tss2_tabrmd, [tcti-tabrmd],
+                       [tss2_tabrmd=true; AC_DEFINE([TSS2_TCTI_TABRMD], [], [use TCTI Access Broker and Resource Manager])],
+                       [tss2_tabrmd=false])
+               PKG_CHECK_MODULES(tss2_socket, [tcti-socket],
+                       [tss2_socket=true; AC_DEFINE([TSS2_TCTI_SOCKET], [], [use TCTI Sockets])],
+                       [tss2_socket=false])
+               if test x$tss2_tabrmd = xtrue -o x$tss2_socket = xtrue; then
+                       AC_DEFINE([TSS_TSS2_V1], [], [use TSS 2.0 v1 libraries])
+                       AC_SUBST(tss2_CFLAGS, "$tss2_tabrmd_CFLAGS $tss2_socket_CFLAGS")
+                       AC_SUBST(tss2_LIBS, "$tss2_tabrmd_LIBS $tss2_socket_LIBS")
+               else
+                       AC_MSG_FAILURE([no TSS2 TCTI or SAPI libraries detected])
+               fi
        fi
 fi
 
@@ -1135,6 +1142,12 @@ if test x$openssl = xtrue; then
        AC_CHECK_HEADER([openssl/evp.h],,[AC_MSG_ERROR([OpenSSL header openssl/evp.h not found!])])
 fi
 
+if test x$wolfssl = xtrue; then
+       PKG_CHECK_MODULES(wolfssl, [wolfssl])
+       AC_SUBST(wolfssl_CFLAGS)
+       AC_SUBST(wolfssl_LIBS)
+fi
+
 if test x$gcrypt = xtrue; then
        AC_CHECK_LIB([gcrypt],[gcry_control],[LIBS="$LIBS"],[AC_MSG_ERROR([gcrypt library not found])],[-lgpg-error])
        AC_CHECK_HEADER([gcrypt.h],,[AC_MSG_ERROR([gcrypt header gcrypt.h not found!])])
@@ -1149,6 +1162,12 @@ if test x$gcrypt = xtrue; then
        )
 fi
 
+if test x$botan = xtrue; then
+       PKG_CHECK_MODULES(botan, [botan-2])
+       AC_SUBST(botan_CFLAGS)
+       AC_SUBST(botan_LIBS)
+fi
+
 if test x$uci = xtrue; then
        AC_CHECK_LIB([uci],[uci_alloc_context],[LIBS="$LIBS"],[AC_MSG_ERROR([UCI library libuci not found])],[])
        AC_CHECK_HEADER([uci.h],,[AC_MSG_ERROR([UCI header uci.h not found!])])
@@ -1181,7 +1200,7 @@ if test x$xauth_pam = xtrue; then
 fi
 
 if test x$connmark = xtrue -o x$forecast = xtrue; then
-       PKG_CHECK_MODULES(libiptc, [libiptc])
+       PKG_CHECK_MODULES(libiptc, [libip4tc])
        AC_SUBST(libiptc_CFLAGS)
        AC_SUBST(libiptc_LIBS)
 fi
@@ -1278,15 +1297,26 @@ if test x$coverage = xtrue; then
 fi
 
 if test x$fuzzing = xtrue; then
-       if test x$libfuzzer = x; then
+       case "$libfuzzer" in
+       "")
                AC_MSG_NOTICE([fuzz targets enabled without libFuzzer, using local driver])
                CFLAGS="${CFLAGS} -fsanitize=address"
                libfuzzer="libFuzzerLocal.a"
-       else
+               ;;
+       "-fsanitize=fuzzer")
+               libfuzzer=""
+               FUZZING_CFLAGS="-fsanitize=fuzzer"
+               AC_SUBST(FUZZING_CFLAGS)
+               ;;
+       *)
                # required for libFuzzer
                FUZZING_LDFLAGS="-stdlib=libc++ -lstdc++"
+               if test "$SANITIZER" = "coverage"; then
+                       FUZZING_LDFLAGS="$FUZZING_LDFLAGS -lm"
+               fi
                AC_SUBST(FUZZING_LDFLAGS)
-       fi
+               ;;
+       esac
 fi
 
 if test x$ruby_gems = xtrue; then
@@ -1302,7 +1332,7 @@ fi
 AM_CONDITIONAL(RUBY_GEMS_INSTALL, [test "x$ruby_gems_install" = xtrue])
 
 if test x$python_eggs = xtrue; then
-       PYTHON_PACKAGE_VERSION=`echo "$PACKAGE_VERSION" | $SED 's/dr/dev/'`
+       PYTHON_PACKAGE_VERSION=`echo "$PACKAGE_VERSION" | $SED 's/dr/.dev/'`
        AC_SUBST([PYTHON_PACKAGE_VERSION])
        if test x$python_eggs_install = xtrue; then
                AC_PATH_PROG([EASY_INSTALL], [easy_install], [], [$PATH:/bin:/usr/bin:/usr/local/bin])
@@ -1315,6 +1345,7 @@ if test x$python_eggs = xtrue; then
        else
                AC_SUBST(PYTHONEGGINSTALLDIR, "--install-dir $pythoneggdir")
        fi
+       AC_PATH_PROG([TOX], [tox], [], [$PATH:/bin:/usr/bin:/usr/local/bin])
        AC_PATH_PROG([PY_TEST], [py.test], [], [$PATH:/bin:/usr/bin:/usr/local/bin])
 fi
 AM_CONDITIONAL(PYTHON_EGGS_INSTALL, [test "x$python_eggs_install" = xtrue])
@@ -1398,7 +1429,9 @@ ADD_PLUGIN([ipseckey],             [c charon])
 ADD_PLUGIN([pem],                  [s charon scepclient pki scripts manager medsrv attest nm cmd aikgen fuzz])
 ADD_PLUGIN([padlock],              [s charon])
 ADD_PLUGIN([openssl],              [s charon scepclient pki scripts manager medsrv attest nm cmd aikgen])
+ADD_PLUGIN([wolfssl],              [s charon scepclient pki scripts manager medsrv attest nm cmd aikgen])
 ADD_PLUGIN([gcrypt],               [s charon scepclient pki scripts manager medsrv attest nm cmd aikgen])
+ADD_PLUGIN([botan],                [s charon scepclient pki scripts manager medsrv attest nm cmd aikgen])
 ADD_PLUGIN([af-alg],               [s charon scepclient pki scripts medsrv attest nm cmd aikgen])
 ADD_PLUGIN([fips-prf],             [s charon nm cmd])
 ADD_PLUGIN([gmp],                  [s charon scepclient pki scripts manager medsrv attest nm cmd aikgen fuzz])
@@ -1413,6 +1446,7 @@ ADD_PLUGIN([ctr],                  [s charon scripts nm cmd])
 ADD_PLUGIN([ccm],                  [s charon scripts nm cmd])
 ADD_PLUGIN([gcm],                  [s charon scripts nm cmd])
 ADD_PLUGIN([ntru],                 [s charon scripts nm cmd])
+ADD_PLUGIN([drbg],                 [s charon pki scripts nm cmd])
 ADD_PLUGIN([newhope],              [s charon scripts nm cmd])
 ADD_PLUGIN([bliss],                [s charon pki scripts nm cmd])
 ADD_PLUGIN([curl],                 [s charon scepclient pki scripts nm cmd])
@@ -1567,7 +1601,9 @@ AM_CONDITIONAL(USE_MYSQL, test x$mysql = xtrue)
 AM_CONDITIONAL(USE_SQLITE, test x$sqlite = xtrue)
 AM_CONDITIONAL(USE_PADLOCK, test x$padlock = xtrue)
 AM_CONDITIONAL(USE_OPENSSL, test x$openssl = xtrue)
+AM_CONDITIONAL(USE_WOLFSSL, test x$wolfssl = xtrue)
 AM_CONDITIONAL(USE_GCRYPT, test x$gcrypt = xtrue)
+AM_CONDITIONAL(USE_BOTAN, test x$botan = xtrue)
 AM_CONDITIONAL(USE_AGENT, test x$agent = xtrue)
 AM_CONDITIONAL(USE_KEYCHAIN, test x$keychain = xtrue)
 AM_CONDITIONAL(USE_PKCS11, test x$pkcs11 = xtrue)
@@ -1580,6 +1616,7 @@ AM_CONDITIONAL(USE_AF_ALG, test x$af_alg = xtrue)
 AM_CONDITIONAL(USE_NTRU, test x$ntru = xtrue)
 AM_CONDITIONAL(USE_NEWHOPE, test x$newhope = xtrue)
 AM_CONDITIONAL(USE_BLISS, test x$bliss = xtrue)
+AM_CONDITIONAL(USE_DRBG, test x$drbg = xtrue)
 
 #  charon plugins
 # ----------------
@@ -1728,7 +1765,8 @@ AM_CONDITIONAL(USE_LEGACY_SYSTEMD, test -n "$systemdsystemunitdir" -a "x$systemd
 AM_CONDITIONAL(USE_RUBY_GEMS, test x$ruby_gems = xtrue)
 AM_CONDITIONAL(USE_PYTHON_EGGS, test x$python_eggs = xtrue)
 AM_CONDITIONAL(USE_PERL_CPAN, test x$perl_cpan = xtrue)
-AM_CONDITIONAL(USE_PY_TEST, test "x$PY_TEST" != x)
+AM_CONDITIONAL(USE_TOX, test "x$TOX" != x)
+AM_CONDITIONAL(USE_PY_TEST, test "x$PY_TEST" != x -a "x$TOX" = x)
 
 # ========================
 #  set global definitions
@@ -1796,7 +1834,7 @@ AC_CONFIG_FILES([
        man/Makefile
        init/Makefile
        init/systemd/Makefile
-       init/systemd-swanctl/Makefile
+       init/systemd-starter/Makefile
        src/Makefile
        src/include/Makefile
        src/libstrongswan/Makefile
@@ -1845,7 +1883,9 @@ AC_CONFIG_FILES([
        src/libstrongswan/plugins/sqlite/Makefile
        src/libstrongswan/plugins/padlock/Makefile
        src/libstrongswan/plugins/openssl/Makefile
+       src/libstrongswan/plugins/wolfssl/Makefile
        src/libstrongswan/plugins/gcrypt/Makefile
+       src/libstrongswan/plugins/botan/Makefile
        src/libstrongswan/plugins/agent/Makefile
        src/libstrongswan/plugins/keychain/Makefile
        src/libstrongswan/plugins/pkcs11/Makefile
@@ -1854,6 +1894,7 @@ AC_CONFIG_FILES([
        src/libstrongswan/plugins/ccm/Makefile
        src/libstrongswan/plugins/gcm/Makefile
        src/libstrongswan/plugins/af_alg/Makefile
+       src/libstrongswan/plugins/drbg/Makefile
        src/libstrongswan/plugins/ntru/Makefile
        src/libstrongswan/plugins/bliss/Makefile
        src/libstrongswan/plugins/bliss/tests/Makefile
@@ -1996,6 +2037,7 @@ AC_CONFIG_FILES([
        src/sw-collector/Makefile
        src/sec-updater/Makefile
        src/swanctl/Makefile
+       src/xfrmi/Makefile
        scripts/Makefile
        testing/Makefile
 ])