fi
AC_MSG_RESULT($enable_verbose_logging)
-AC_MSG_CHECKING(whether we will try to link in system PolarSSL)
AC_ARG_WITH([system-polarssl],
- [AC_HELP_STRING([--without-system-polarssl], [do not use system PolarSSL])],
- [system_polarssl=$withval],
- [system_polarssl=yes])
-AC_MSG_RESULT($system_polarssl)
-AM_CONDITIONAL(HAVE_LIBPOLARSSL, false)
-if test x$system_polarssl = xyes; then
- AC_MSG_CHECKING([PolarSSL version >= 1.1])
- AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[
-#include <polarssl/version.h>
- ]],
- [[
-#if POLARSSL_VERSION_NUMBER < 0x01010000
-#error invalid version
-#endif
- ]]
- )], [use_system_polarssl=yes], [use_system_polarssl=no])
- AC_MSG_RESULT($use_system_polarssl)
-fi
-if test x$use_system_polarssl = xyes; then
- AC_CHECK_LIB([polarssl], [sha1_hmac])
-fi
+ AS_HELP_STRING([--without-system-polarssl], [do not use system PolarSSL]))
+
+AS_IF([test "x$with_system_polarssl" != "xno"],
+ [AC_CHECK_LIB([polarssl], [sha1_hmac], [
+ AC_MSG_CHECKING([PolarSSL version >= 1.1])
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #include <polarssl/version.h>
+ ]],
+ [[
+ #if POLARSSL_VERSION_NUMBER < 0x01010000
+ #error invalid version
+ #endif
+ ]]
+ )],
+ [have_system_polarssl=yes],
+ [have_system_polarssl=no])
+ AC_MSG_RESULT($have_system_polarssl) ],
+ [have_system_polarssl=no])],
+ [have_system_polarssl=no]
+)
+
+AS_IF([test "x$have_system_polarssl" = "xyes"],
+ [AC_DEFINE(HAVE_LIBPOLARSSL, 1, [If linking against system polarssl])],
+ [AS_IF([test "x$with_system_polarssl" = "xyes"],
+ [AC_MSG_ERROR([use of system polarssl requested but not found])]
+ )] )
+
+AC_MSG_CHECKING(whether we will try to link in system PolarSSL)
+AC_MSG_RESULT($have_system_polarssl)
+AM_CONDITIONAL(HAVE_LIBPOLARSSL, test "x$have_system_polarssl" = "xyes")
AC_MSG_CHECKING(whether we will be linking in Botan 1.10)
AC_ARG_ENABLE(botan1.10,