+ AS_IF([test "x$enable_polarssl_test_cert" = xyes], [
+ AC_CHECK_LIB([polarssl], [test_srv_crt], [], [AC_MSG_ERROR([could not find test_srv_crt])])
+ AC_DEFINE([USE_POLARSSL_TESTCERT], [], [Use PolarSSL test certificate])
+ ])
+ AS_IF([test "x$enable_polarssl_havege" = xyes], [
+ AC_CHECK_LIB([polarssl], [havege_init], [], [AC_MSG_ERROR([could not find havege_init])])
+ AC_DEFINE([USE_POLARSSL_HAVEGE], [], [Use PolarSSL HAVEGE random generator])
+ ])
+])
+AS_IF([test "x$with_ssl" = xopenssl], [
+ AC_CHECK_HEADERS([openssl/ssl.h], [], [AC_MSG_ERROR([could not find openssl/ssl.h])])
+ AC_CHECK_LIB([crypto], [BN_init], [], [AC_MSG_ERROR([could not find libcrypto])])
+ AC_CHECK_LIB([ssl], [SSL_library_init], [], [AC_MSG_ERROR([could not find libssl])])
+])
+AS_IF([test "x$with_ssl" = xgnutls], [
+ AC_CHECK_HEADERS([gnutls/gnutls.h], [], [AC_MSG_ERROR([could not find gnutls/gnutls.h])])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([@%:@include <gnutls/gnutls.h>],
+ [ #ifdef GNUTLS_E_PREMATURE_TERMINATION
+ #else
+ #error Unsuitable version of GnuTLS
+ #endif
+ ])], [], [AC_MSG_ERROR([Unsuitable version of GnuTL, minimum required is 3.0])])
+ AC_CHECK_LIB([gnutls], [gnutls_priority_init], [], [AC_MSG_ERROR([could not find libgnutls])])
+ AC_CHECK_LIB([nettle], [_nettle_aes_decrypt], [], [AC_MSG_ERROR([could not find libnettle])])
+ AC_DEFINE([USE_GNUTLS], [], [Use GnuTLS])