+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])
+])