aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorMartin Schanzenbach <schanzen@gnunet.org>2022-09-07 16:41:40 +0200
committerMartin Schanzenbach <schanzen@gnunet.org>2022-09-07 16:41:40 +0200
commitfcfd6a8d06804db33704940ed0fb7aceb915c4f4 (patch)
treed71a6968423705572a22dbee34e1467acb21a8b2 /configure.ac
parent6745bed70af20a11aee5e0c8f6e7bd8479031e9e (diff)
downloadgnunet-fcfd6a8d06804db33704940ed0fb7aceb915c4f4.tar.gz
gnunet-fcfd6a8d06804db33704940ed0fb7aceb915c4f4.zip
-programatically check GnuTLS support for curl
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac23
1 files changed, 14 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac
index efae64917..4b7f6920c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -722,6 +722,7 @@ AC_MSG_RESULT([$conversation_backend])
722# NOTE: If we find libcurl-gnutls here we set LIBCURL to -lcurl-gnutls 722# NOTE: If we find libcurl-gnutls here we set LIBCURL to -lcurl-gnutls
723# This affects the LIBCURL_CHECK_CONFIG call below as it takes LIBCURL into 723# This affects the LIBCURL_CHECK_CONFIG call below as it takes LIBCURL into
724# account when checking for curl. 724# account when checking for curl.
725LIBCURL="-lcurl"
725AC_CHECK_LIB([curl-gnutls], 726AC_CHECK_LIB([curl-gnutls],
726 [curl_easy_getinfo], 727 [curl_easy_getinfo],
727 [LIBCURL="-lcurl-gnutls" 728 [LIBCURL="-lcurl-gnutls"
@@ -731,6 +732,17 @@ AC_CHECK_LIB([curl-gnutls],
731LIBCURL_CHECK_CONFIG([], [7.34.0], [], 732LIBCURL_CHECK_CONFIG([], [7.34.0], [],
732 [AC_MSG_ERROR([cURL must have a version >= 7.34.0])]) 733 [AC_MSG_ERROR([cURL must have a version >= 7.34.0])])
733 734
735OLD_LDFLAGS=$LDFLAGS
736LDFLAGS="$LDFLAGS $LIBCURL"
737AC_RUN_IFELSE(
738 [AC_LANG_PROGRAM([#include <curl/curl.h>]
739 [[const curl_ssl_backend **avail;]],
740 [[return (CURLSSLSET_OK != curl_global_sslset(CURLSSLBACKEND_GNUTLS, NULL, &avail)) ? 1 : 0;]])],
741 [curl_gnutls=1],
742 [AC_MSG_WARN([cURL does not have GnuTLS backend])])
743LDFLAGS=$OLD_LDFLAGS
744
745
734# Even if curl is found, we check for this constant in order to determine 746# Even if curl is found, we check for this constant in order to determine
735# if we can use this feature. 747# if we can use this feature.
736AC_CHECK_HEADER([curl/curl.h], 748AC_CHECK_HEADER([curl/curl.h],
@@ -1495,16 +1507,9 @@ AS_IF([test "x$png" = "x1"],
1495 [libpng_msg="yes"], 1507 [libpng_msg="yes"],
1496 [libpng_msg="no"]) 1508 [libpng_msg="no"])
1497 1509
1498# We get the supported backend(s) from curl-config unless we linked
1499# against libcurl-gnutls directly, in which case we manually set it just to be
1500# sure curl-config is not linked against another curl.
1501AS_IF([test "x$curl_gnutls" = "x0"], 1510AS_IF([test "x$curl_gnutls" = "x0"],
1502 [AC_CHECK_PROG([CURLCONFIG_BINARY], [curl-config], [curl-config], [None]) 1511 [http_client="curl (OpenSSL)"],
1503 AS_IF([test "x$CURLCONFIG_BINARY" = "xNone"], 1512 [http_client="curl (GnuTLS)"])
1504 AC_SUBST([CURL_SSL_BACKEND],["Unkown SSL backend"]),
1505 AC_SUBST([CURL_SSL_BACKEND],[`curl-config --ssl-backends`]))
1506 http_client="curl ($CURL_SSL_BACKEND)"],
1507 [http_client="curl-gnutls"])
1508 1513
1509# ifconfig 1514# ifconfig
1510AS_IF([test "x$IFCONFIG_BINARY" = "xfalse"], 1515AS_IF([test "x$IFCONFIG_BINARY" = "xfalse"],