make curl check saner, use AS_IF

This commit is contained in:
Christian Grothoff 2018-08-16 14:22:01 +02:00
parent a1f289512e
commit f0a796a3f6
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
5 changed files with 44 additions and 47 deletions

View File

@ -148,30 +148,20 @@ AS_IF([test $libgnunetjson != 1],
# libcurl-gnutls
LIBCURL_CHECK_CONFIG(,7.34.0,[curl=true],[curl=false])
if test "x$curl" = xtrue
then
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])
# 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)
if test "$gnurl" = 0
then
AC_MSG_WARN([GNUnet requires libcurl-gnutls >= 7.34])
fi
else
AM_CONDITIONAL(HAVE_LIBCURL, true)
AC_DEFINE([HAVE_LIBCURL],[1],[Have CURL])
fi
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])
# 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
# 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
@ -181,20 +171,18 @@ AC_CHECK_HEADERS([curl/curl.h],,
AC_CHECK_HEADERS([gnurl/curl.h],,
gnurl=false))
# libgnurl
if test "x$gnurl" = "x0"
then
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
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-gnutls 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])])
# Check for GNUnet's libgnunetcurl.
libgnunetcurl=0

View File

@ -85,7 +85,7 @@ fee_withdraw = EUR:0.00
fee_deposit = EUR:0.00
fee_refresh = EUR:0.01
fee_refund = EUR:0.01
rsa_keysize = 1024
rsa_keysize = 2048
[coin_eur_ct_10]
value = EUR:0.10
@ -97,7 +97,7 @@ fee_withdraw = EUR:0.01
fee_deposit = EUR:0.01
fee_refresh = EUR:0.03
fee_refund = EUR:0.01
rsa_keysize = 1024
rsa_keysize = 2048
[coin_eur_1]
value = EUR:1
@ -109,7 +109,7 @@ fee_withdraw = EUR:0.01
fee_deposit = EUR:0.01
fee_refresh = EUR:0.03
fee_refund = EUR:0.01
rsa_keysize = 1024
rsa_keysize = 2048
[coin_eur_5]
value = EUR:5
@ -121,7 +121,7 @@ fee_withdraw = EUR:0.01
fee_deposit = EUR:0.01
fee_refresh = EUR:0.03
fee_refund = EUR:0.01
rsa_keysize = 1024
rsa_keysize = 2048
[coin_eur_10]
value = EUR:10
@ -133,4 +133,4 @@ fee_withdraw = EUR:0.01
fee_deposit = EUR:0.01
fee_refresh = EUR:0.03
fee_refund = EUR:0.01
rsa_keysize = 1024
rsa_keysize = 2048

View File

@ -1,5 +1,5 @@
{
"url": "payto://x-taler-bank/localhost:8082/2",
"salt": "RJG7PDRM3YFFQ9YXHE5034R2HF9X68PQKC2W0CQWV4BQ50RYQT339GWN33601S53C3GGG35DG9C6479H4PGMZ9SVJ7A22RK99S4BN78",
"master_sig": "H9GKSPFDQVCP8NBW0X4ZMWEFHZGZNTWZETWRTMYK3831HYTDKWR7R5KY2YJ7XW6HNZ27Q9NXW2DGJWJ016WBK01AKWA6MRNFVPQ6G2G"
"salt": "121B05SK5B4P0ZXQ748G3HCXA35W3QYQ6KP799TEMSJSVYHCG5CNZWY2CYD5RN4QHYBFWM1M8973W3X9PBKW78D49QV4D7NT7PEE040",
"master_sig": "WJWQBR8M0M9CENCBZVRDT2D6YMCD1AYN1JS54KX0Q7VRMS163800GP25871Y96T0TPF1SN1CPR6TE3KG4VZXW8HJPENVC8PAK01S218"
}

View File

@ -18,8 +18,17 @@ EXTRA_DIST = \
plugindir = $(libdir)/taler
plugin_LTLIBRARIES = \
libtaler_plugin_wire_ebics.la \
libtaler_plugin_wire_taler_bank.la
libtaler_plugin_wire_ebics.la
if HAVE_LIBCURL
plugin_LTLIBRARIES += \
libtaler_plugin_wire_taler_bank.la
else
if HAVE_LIBGNURL
plugin_LTLIBRARIES += \
libtaler_plugin_wire_taler_bank.la
endif
endif
noinst_LTLIBRARIES = \
libtaler_plugin_wire_template.la
@ -44,9 +53,7 @@ libtaler_plugin_wire_ebics_la_LIBADD = \
$(LTLIBINTL)
libtaler_plugin_wire_ebics_la_LDFLAGS = \
$(TALER_PLUGIN_LDFLAGS) \
$(top_builddir)/src/json/libtalerjson.la \
$(top_builddir)/src/util/libtalerutil.la \
-lgnunetjson \
-lgnunetutil $(XLIB)

View File

@ -64,12 +64,14 @@ static struct TestBlock tests[] = {
.round_out = "EUR:0.12",
.currency = "EUR"
},
#if HAVE_LIBCURL
{
.plugin_name = "taler_bank",
.round_in = "KUDOS:0.123456",
.round_out = "KUDOS:0.12",
.currency = "KUDOS"
},
#endif
{
NULL, NULL, NULL, NULL
}