aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac94
1 files changed, 91 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 92db8add7..5983d4a5a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -121,7 +121,7 @@ AC_SUBST(PKGADD_VENDOR)
dnl
dnl initialize all the info variables
- curl_ssl_msg="no (--with-ssl / --with-gnutls / --with-nss)"
+ curl_ssl_msg="no (--with-{ssl,gnutls,nss,polarssl} )"
curl_ssh_msg="no (--with-libssh2)"
curl_zlib_msg="no (--with-zlib)"
curl_krb4_msg="no (--with-krb4*)"
@@ -1707,6 +1707,94 @@ if test "$OPENSSL_ENABLED" != "1"; then
fi dnl OPENSSL != 1
dnl ----------------------------------------------------
+dnl check for PolarSSL
+dnl ----------------------------------------------------
+
+dnl Default to compiler & linker defaults for PolarSSL files & libraries.
+OPT_POLARSSL=no
+
+_cppflags=$CPPFLAGS
+_ldflags=$LDFLAGS
+AC_ARG_WITH(polarssl,dnl
+AC_HELP_STRING([--with-polarssl=PATH],[where to look for PolarSSL, PATH points to the installation root (default: /usr/local/)])
+AC_HELP_STRING([--without-polarssl], [disable PolarSSL detection]),
+ OPT_POLARSSL=$withval)
+
+if test "$OPENSSL_ENABLED" != "1"; then
+
+ if test X"$OPT_POLARSSL" != Xno; then
+
+ if test "$OPT_POLARSSL" = "yes"; then
+ OPT_POLARSSL=""
+ fi
+
+ if test -z "$OPT_POLARSSL" ; then
+ dnl check for lib first without setting any new path
+
+ AC_CHECK_LIB(polarssl, havege_init,
+ dnl libpolarssl found, set the variable
+ [
+ AC_DEFINE(USE_POLARSSL, 1, [if PolarSSL is enabled])
+ AC_SUBST(USE_POLARSSL, [1])
+ POLARSSL_ENABLED=1
+ USE_POLARSSL="yes"
+ curl_ssl_msg="enabled (PolarSSL)"
+ ])
+ fi
+
+ if test "x$USE_POLARSSL" != "xyes"; then
+ dnl add the path and test again
+ addld=-L$OPT_POLARSSL/lib$libsuff
+ addcflags=-I$OPT_POLARSSL/include
+ polarssllib=$OPT_POLARSSL/lib$libsuff
+
+ LDFLAGS="$LDFLAGS $addld"
+ if test "$addcflags" != "-I/usr/include"; then
+ CPPFLAGS="$CPPFLAGS $addcflags"
+ fi
+
+ AC_CHECK_LIB(polarssl, ssl_init,
+ [
+ AC_DEFINE(USE_POLARSSL, 1, [if PolarSSL is enabled])
+ AC_SUBST(USE_POLARSSL, [1])
+ POLARSSL_ENABLED=1
+ USE_POLARSSL="yes"
+ curl_ssl_msg="enabled (PolarSSL)"
+ ],
+ [
+ CPPFLAGS=$_cppflags
+ LDFLAGS=$_ldflags
+ ])
+ fi
+
+ if test "x$USE_POLARSSL" = "xyes"; then
+ AC_MSG_NOTICE([detected PolarSSL])
+
+ CURL_LIBS="$CURL_LIBS -lpolarssl"
+ LIBS="$LIBS -lpolarssl"
+
+ if test -n "$polarssllib"; then
+ dnl when shared libs were found in a path that the run-time
+ dnl linker doesn't search through, we need to add it to
+ dnl LD_LIBRARY_PATH to prevent further configure tests to fail
+ dnl due to this
+
+ LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$polarssllib"
+ export LD_LIBRARY_PATH
+ AC_MSG_NOTICE([Added $polarssllib to LD_LIBRARY_PATH])
+ fi
+
+ AC_CHECK_LIB(polarssl, x509parse_crl,
+ [AC_DEFINE(HAVE_POLARSSL_GPL, 1, [if GPL version of PolarSSL is detected])
+ AC_SUBST(HAVE_POLARSSL_GPL, [1])
+ ])
+ fi
+
+ fi dnl PolarSSL not disabled
+
+fi dnl OPENSSL != 1
+
+dnl ----------------------------------------------------
dnl NSS. Only check if GnuTLS and OpenSSL are not enabled
dnl ----------------------------------------------------
@@ -1802,9 +1890,9 @@ if test "$OPENSSL_ENABLED" != "1" -a "$GNUTLS_ENABLED" != "1"; then
fi dnl OPENSSL != 1 -a GNUTLS_ENABLED != 1
-if test "x$OPENSSL_ENABLED$GNUTLS_ENABLED$NSS_ENABLED" = "x"; then
+if test "x$OPENSSL_ENABLED$GNUTLS_ENABLED$NSS_ENABLED$POLARSSL_ENABLED" = "x"; then
AC_MSG_WARN([SSL disabled, you will not be able to use HTTPS, FTPS, NTLM and more.])
- AC_MSG_WARN([Use --with-ssl, --with-gnutls or --with-nss to address this.])
+ AC_MSG_WARN([Use --with-ssl, --with-gnutls, --with-polarssl or --with-nss to address this.])
else
# SSL is enabled, genericly
AC_SUBST(SSL_ENABLED)