From 83995cf89e0515b46d65badd09b641c988a5ea9d Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 4 Sep 2014 12:49:32 +0000 Subject: address Debian #758937: allow use of curl if it is really the gnutls version and libgnurl is unavailable --- configure.ac | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 24915a14e..687ea1e20 100644 --- a/configure.ac +++ b/configure.ac @@ -461,6 +461,27 @@ else AM_CONDITIONAL(HAVE_LIBGNURL, false) fi +# libcurl-gnutls +LIBCURL_CHECK_CONFIG(,7.34.0,[curl=true],[curl=false]) +if test "x$curl" = xtrue +then + AC_CHECK_HEADERS([curl/curl.h], + AC_CHECK_DECLS(CURLINFO_TLS_SESSION,[curl=true],[curl=false],[[#include ]]), + [curl=false]) + # need libcurl-gnutls.so, everything else is not acceptable + AC_CHECK_LIB([curl-gnutls],[curl_easy_getinfo],,[curl=false]) + # cURL must support CURLINFO_TLS_SESSION, version >= 7.34 + +fi +if test x$curl = xfalse +then + AM_CONDITIONAL(HAVE_LIBCURL, false) + AC_MSG_WARN([GNUnet requires libcurl-gnutls >= 7.34]) +else + AM_CONDITIONAL(HAVE_LIBCURL, true) + AC_DEFINE([HAVE_LIBCURL],[1],[Have CURL]) +fi + # libidn AC_MSG_CHECKING([if Libidn can be used]) @@ -1197,7 +1218,7 @@ AC_ARG_ENABLE([malicious], [malicious=0 enable_malicious=no]) AC_MSG_RESULT($enable_malicious) -AM_CONDITIONAL([ENABLE_MALICIOUS], [$malicious]) +AM_CONDITIONAL([ENABLE_MALICIOUS], [1=$malicious]) AC_DEFINE_UNQUOTED([ENABLE_MALICIOUS], [$malicious], [enable compilation of malicious code]) @@ -1552,10 +1573,16 @@ fi # libgnurl if test "x$gnurl" = "x0" then - AC_MSG_NOTICE([NOTICE: libgnurl not found. http client support will not be compiled.]) - AC_MSG_WARN([libgnurl not found. hostlist daemon will not be compiled, and you probably WANT hostlist daemon]) + if test "x$curl" = "x0" + then + AC_MSG_NOTICE([NOTICE: libgnurl not found. http client support will not be compiled.]) + AC_MSG_WARN([ERROR: libgnurl not found. hostlist daemon will not be compiled, and you probably WANT the hostlist daemon]) + else + AC_MSG_NOTICE([WARNING: libgnurl not found, trying to use libcurl-gnutls instead.]) + fi fi + # bluetooth if test "x$bluetooth" = "x0" then -- cgit v1.2.3