aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-08-16 14:22:01 +0200
committerChristian Grothoff <christian@grothoff.org>2018-08-16 14:22:01 +0200
commitf0a796a3f6d4329555506b3464b6d174f53fd9cf (patch)
treedc65c5fc2eebab69c0b7d5b0a2b2143a38a080be /configure.ac
parenta1f289512eac8596bff88bbffc69c5a271324120 (diff)
make curl check saner, use AS_IF
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac62
1 files changed, 25 insertions, 37 deletions
diff --git a/configure.ac b/configure.ac
index 84f2d6b03..c46b8babb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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