summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-09-07 11:17:33 +0200
committerChristian Grothoff <christian@grothoff.org>2022-09-07 11:17:33 +0200
commitc450de5db5b48433941dc7485ddb61c93be3fcd7 (patch)
tree98390a5fdcda355b5f6c8ea783d2507f3c5740cd
parent17638a71de25c6aad6dc7b742a93afb8c224f077 (diff)
downloadtaler-mdb-c450de5db5b48433941dc7485ddb61c93be3fcd7.tar.gz
taler-mdb-c450de5db5b48433941dc7485ddb61c93be3fcd7.tar.bz2
taler-mdb-c450de5db5b48433941dc7485ddb61c93be3fcd7.zip
update curl checks
-rw-r--r--INSTALL6
-rw-r--r--configure.ac57
-rw-r--r--src/Makefile.am9
3 files changed, 27 insertions, 45 deletions
diff --git a/INSTALL b/INSTALL
index e82fd21..8865734 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,8 +1,8 @@
Installation Instructions
*************************
- Copyright (C) 1994-1996, 1999-2002, 2004-2017, 2020-2021 Free
-Software Foundation, Inc.
+ Copyright (C) 1994-1996, 1999-2002, 2004-2016 Free Software
+Foundation, Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
@@ -225,7 +225,7 @@ order to use an ANSI C compiler:
and if that doesn't work, install pre-built binaries of GCC for HP-UX.
- HP-UX 'make' updates targets which have the same timestamps as their
+ HP-UX 'make' updates targets which have the same time stamps as their
prerequisites, which makes it generally unusable when shipped generated
files such as 'configure' are involved. Use GNU 'make' instead.
diff --git a/configure.ac b/configure.ac
index 0826c4d..35c3037 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,7 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
-AC_PREREQ([2.71])
+AC_PREREQ([2.69])
AC_INIT([taler-mdb],[0.8.2],[taler@gnu.org])
AC_CONFIG_SRCDIR([src/taler-mdb.c])
AC_CONFIG_HEADERS([config.h])
@@ -226,39 +226,28 @@ CFLAGS_SAVE=$CFLAGS
LDFLAGS_SAVE=$LDFLAGS
-# check for libgnurl
-# libgnurl
-LIBGNURL_CHECK_CONFIG(,7.34.0,gnurl=1,gnurl=0)
-LIBCURL_CHECK_CONFIG(,7.34.0,[curl=1],[curl=0])
-
-AS_IF([test "x$curl" = x1],[
- AC_CHECK_HEADER([curl/curl.h],
- AC_CHECK_DECLS(CURLINFO_TLS_SESSION,[curl=1],[curl=0],[[#include <curl/curl.h>]]),
- [curl=0])
- # need libcurl-gnutls.so, everything else is not acceptable
- AC_CHECK_LIB([curl-gnutls],[curl_easy_getinfo],,[curl=0])
- # cURL must support CURLINFO_TLS_SESSION, version >= 7.34
-])
-
-
-# libcurl and libgnurl should be mutually exclusive
-AS_IF([test "$gnurl" = 1],
- [AM_CONDITIONAL(HAVE_LIBGNURL, true)
- AC_DEFINE([HAVE_LIBGNURL],[1],[Have libgnurl])
- AM_CONDITIONAL(HAVE_LIBCURL, false)
- AC_DEFINE([HAVE_LIBCURL],[0],[Lacking libcurl])],
- [AS_IF([test "$curl" = 1],
- [AM_CONDITIONAL(HAVE_LIBGNURL, false)
- AC_DEFINE([HAVE_LIBGNURL],[0],[Lacking libgnurl])
- AM_CONDITIONAL(HAVE_LIBCURL, true)
- AC_DEFINE([HAVE_LIBCURL],[1],[Have libcurl])],
- [AC_MSG_WARN([WARNING: No libgnurl/libcurl, taler-bank support will not be compiled])
- AM_CONDITIONAL(HAVE_LIBGNURL, false)
- AC_DEFINE([HAVE_LIBGNURL],[0],[Lacking libgnurl])
- AM_CONDITIONAL(HAVE_LIBCURL, false)
- AC_DEFINE([HAVE_LIBCURL],[0],[Lacking libcurl])])])
-
-# Restore after gnurl/curl checks messed up these values
+
+# NOTE: If we find libcurl here we set LIBCURL to -lcurl
+# This affects the LIBCURL_CHECK_CONFIG call below as it takes LIBCURL into
+# account when checking for curl.
+AC_CHECK_LIB([curl],
+ [curl_easy_getinfo],
+ [LIBCURL="-lcurl"
+ 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>]])])
+
+# Restore after curl checks messed up these values
CFLAGS=$CFLAGS_SAVE
LDFLAGS=$LDFLAGS_SAVE
LIBS=$LIBS_SAVE
diff --git a/src/Makefile.am b/src/Makefile.am
index 278a77a..c48d4bb 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -31,6 +31,7 @@ taler_mdb_LDADD = \
-lgnunetutil \
-ljansson \
-lnfc \
+ -lcurl \
@QR_LIBS@ \
$(XLIB)
@@ -42,11 +43,3 @@ qr_show_LDADD = \
@QR_LIBS@ \
$(XLIB)
-
-if HAVE_LIBCURL
-taler_mdb_LDADD += -lcurl
-else
-if HAVE_LIBGNURL
-taler_mdb_LDADD += -lgnurl
-endif
-endif