aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-09-07 10:10:17 +0200
committerChristian Grothoff <christian@grothoff.org>2022-09-07 10:10:17 +0200
commit3125f453cbd3114c5b52f1e4f67529448474d828 (patch)
tree216427154f7a8f193a96b3f5f3c13e09b0218de4 /configure.ac
parent977db5a9573d9824fca2b34804ee15d76f8fcbf1 (diff)
modernize libcurl test, as in GNUnet
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac66
1 files changed, 19 insertions, 47 deletions
diff --git a/configure.ac b/configure.ac
index 7286e277..5a212c4b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -186,51 +186,25 @@ AS_IF([test "$qrencode" != 1],
AC_SUBST(QR_CFLAGS)
AC_SUBST(QR_LIBS)
-
-
-# check for libgnurl
-# libgnurl
-LIBGNURL_CHECK_CONFIG(,7.34.0,gnurl=1,gnurl=0)
-AS_IF([test "x$gnurl" = x1],[
- AM_CONDITIONAL(HAVE_LIBGNURL, true)
- AC_DEFINE([HAVE_LIBGNURL],[1],[Have libgnurl])
-],[
- AM_CONDITIONAL(HAVE_LIBGNURL, false)
-])
-
-# libcurl
-LIBCURL_CHECK_CONFIG(,7.34.0,[curl=true],[curl=false])
-AS_IF([test "x$curl" = xtrue],
- [LDFLAGS="-L$with_libcurl/lib $LDFLAGS"
- CPPFLAGS="-I$with_libcurl/include $CPPFLAGS"
- AC_CHECK_HEADERS([curl/curl.h],
- [AC_CHECK_DECLS(CURLINFO_TLS_SESSION,
- [curl=true],
- [curl=false],
- [[#include <curl/curl.h>]])],
- [curl=false])])
- # cURL must support CURLINFO_TLS_SESSION, version >= 7.34
-
-# Check for curl/curl.h and gnurl/curl.h so we can use #ifdef
-# HAVE_CURL_CURL_H later (the above LIBCURL_CHECK_CONFIG accepted
-# *either* header set).
-AC_CHECK_HEADERS([curl/curl.h],,
- curl=false
- AC_CHECK_HEADERS([gnurl/curl.h],,
- gnurl=false))
-
-# libgnurl
-AS_IF([test "x$gnurl" = "x0"],
- [AS_IF([test "x$curl" = "x0"],
- [AC_MSG_NOTICE([NOTICE: libgnurl not found. taler-bank support will not be compiled.])],
- [AC_MSG_NOTICE([WARNING: libgnurl not found, trying to use libcurl instead.])])])
-
-AS_IF([test x$curl = xfalse],
- [AM_CONDITIONAL(HAVE_LIBCURL, false)
- AS_IF([test "x$gnurl" = "x0"],
- [AC_MSG_WARN([GNU Taler requires libcurl-gnutls >= 7.34])])],
- [AM_CONDITIONAL(HAVE_LIBCURL, true)
- AC_DEFINE([HAVE_LIBCURL],[1],[Have CURL])])
+# NOTE: If we find libcurl-gnutls here we set LIBCURL to -lcurl-gnutls
+# This affects the LIBCURL_CHECK_CONFIG call below as it takes LIBCURL into
+# account when checking for curl.
+AC_CHECK_LIB([curl-gnutls],
+ [curl_easy_getinfo],
+ [LIBCURL="-lcurl-gnutls"
+ curl_gnutls=1],
+ [curl_gnutls=0])
+
+LIBCURL_CHECK_CONFIG([], [7.34.0], [],
+ [AC_MSG_ERROR([cURL must have a version >= 7.34.0])])
+
+# Even if curl is found, we check for this constant in order to determine
+# if we can use this feature.
+AC_CHECK_HEADER([curl/curl.h],
+ [AC_CHECK_DECLS([CURLINFO_TLS_SSL_PTR],
+ [],
+ [AC_MSG_ERROR([cURL must support CURLINFO_TLS_SSL_PTR])],
+ [[#include <curl/curl.h>]])])
# Check for Taler's libtalerfakebank
libtalerfakebank=0
@@ -363,8 +337,6 @@ AM_CONDITIONAL([ENABLE_DOC], [test "x$enable_doc" = "xyes"])
AM_CONDITIONAL([HAVE_GNUNETPQ], [false])
AM_CONDITIONAL([HAVE_POSTGRESQL], [false])
AM_CONDITIONAL([HAVE_TALERFAKEBANK], [false])
-AM_CONDITIONAL([HAVE_LIBCURL], [false])
-AM_CONDITIONAL([HAVE_LIBGNURL], [false])
AM_CONDITIONAL([HAVE_TSC], [false])
AM_CONDITIONAL([USE_COVERAGE], [false])
AM_CONDITIONAL([ENABLE_DOC], [true])