[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-merchant] branch master updated: modernize libcurl test, as in GN
From: |
gnunet |
Subject: |
[taler-merchant] branch master updated: modernize libcurl test, as in GNUnet |
Date: |
Wed, 07 Sep 2022 10:10:19 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository merchant.
The following commit(s) were added to refs/heads/master by this push:
new 3125f453 modernize libcurl test, as in GNUnet
3125f453 is described below
commit 3125f453cbd3114c5b52f1e4f67529448474d828
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Wed Sep 7 10:10:17 2022 +0200
modernize libcurl test, as in GNUnet
---
configure.ac | 66 +++++++++++++++--------------------------------------
src/lib/Makefile.am | 9 +-------
2 files changed, 20 insertions(+), 55 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])
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index 95e431e5..dec8712f 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -65,16 +65,9 @@ libtalermerchant_la_LIBADD = \
-lgnunetjson \
-lgnunetutil \
-ljansson \
+ -lcurl \
$(XLIB)
-if HAVE_LIBCURL
-libtalermerchant_la_LIBADD += -lcurl
-else
-if HAVE_LIBGNURL
-libtalermerchant_la_LIBADD += -lgnurl
-endif
-endif
-
check_PROGRAMS = \
test_merchant_api_common
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-merchant] branch master updated: modernize libcurl test, as in GNUnet,
gnunet <=