support gnurl's curl.h being in include/gnurl/ OR include/curl/
authorChristian Grothoff <christian@grothoff.org>
Sun, 21 Jun 2015 11:06:11 +0000 (11:06 +0000)
committerChristian Grothoff <christian@grothoff.org>
Sun, 21 Jun 2015 11:06:11 +0000 (11:06 +0000)
configure.ac
m4/libgnurl.m4
po/POTFILES.in
src/gns/gnunet-gns-proxy.c
src/gns/test_gns_proxy.c
src/hostlist/gnunet-daemon-hostlist_client.c
src/pt/test_gns_vpn.c
src/pt/test_gnunet_vpn.c
src/transport/plugin_transport_http.h
src/transport/plugin_transport_http_client.c

index 8473f8830759efe404d101a8b9ede349e92ec4fd..37c03f720e4129b01fa2baeffec65ac26266361f 100644 (file)
@@ -461,18 +461,35 @@ else
        AM_CONDITIONAL(HAVE_LIBGNURL, false)
 fi
 
+SAVE_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$LIBGNURL_CPPFLAGS $LIBCURL_CPPFLAGS $CPPFLAGS"
+LIBS="$LIBGNURL $LIBCURL $LIBS"
+
 # libcurl-gnutls
 LIBCURL_CHECK_CONFIG(,7.34.0,[curl=true],[curl=false])
 if test "x$curl" = xtrue
 then
+
  AC_CHECK_HEADERS([curl/curl.h],
-   AC_CHECK_DECLS(CURLINFO_TLS_SESSION,[curl=true],[curl=false],[[#include <curl/curl.h>]]),
-   [curl=false])
+  AC_CHECK_DECLS(CURLINFO_TLS_SESSION,[curl=true],[curl=false],[[#include <curl/curl.h>]]),
+  [curl=false])
+ AC_CHECK_HEADERS([gnurl/curl.h],
+  AC_CHECK_DECLS(CURLINFO_TLS_SESSION,[curl=true],,[[#include <gnurl/curl.h>]]))
  # 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
+
+# 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))
+
+
+
 if test x$curl = xfalse
 then
        AM_CONDITIONAL(HAVE_LIBCURL, false)
@@ -486,10 +503,9 @@ else
 fi
 
 
-
-# restore LIBS
+# restore LIBS & CPPFLAGS
 LIBS=$SAVE_LIBS
-
+CPPFLAGS=$SAVE_CPPFLAGS
 
 AC_CHECK_HEADERS([glpk.h],[glpk=true],[gplk=false])
 # GLPK must support glpk_init_env, version >= 4.43
@@ -1641,9 +1657,9 @@ then
 fi
 
 # libgnurl
-if test "x$gnurl" = "x0"
+if test "x$gnurl" = "xfalse"
 then
-  if test "x$curl" = "x0"
+  if test "x$curl" = "xfalse"
   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])
index 69aa16605bbe9882378a004ef66a1e031dc07e6d..da72e5e879a81b71d22bbf1a46d2f4f29af07aa7 100644 (file)
@@ -159,6 +159,22 @@ x=CURLOPT_STDERR;
 x=CURLOPT_VERBOSE;
 ])],libgnurl_cv_lib_gnurl_usable=yes,libgnurl_cv_lib_gnurl_usable=no)
 
+# BEGIN Changes from original libcurl.m4:
+# Give it a 2nd shot using 'gnurl/curl.h'
+           AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <gnurl/curl.h>],[
+/* Try and use a few common options to force a failure if we are
+   missing symbols or can't link. */
+int x;
+curl_easy_setopt(NULL,CURLOPT_URL,NULL);
+x=CURL_ERROR_SIZE;
+x=CURLOPT_WRITEFUNCTION;
+x=CURLOPT_FILE;
+x=CURLOPT_ERRORBUFFER;
+x=CURLOPT_STDERR;
+x=CURLOPT_VERBOSE;
+])],libgnurl_cv_lib_gnurl_usable=yes)
+# END Changes from original libcurl.m4:
+
            CPPFLAGS=$_libgnurl_save_cppflags
            LIBS=$_libgnurl_save_libs
            unset _libgnurl_save_cppflags
index dd166adcc6ab823737746735631e1412d1b6d8a0..a9015c08b819c13fb40bb9a26b2fed8926aea238 100644 (file)
@@ -229,6 +229,7 @@ src/nat/gnunet-nat-server.c
 src/nat/nat_auto.c
 src/nat/nat.c
 src/nat/nat_mini.c
+src/nat/nat_stun.c
 src/nat/nat_test.c
 src/nse/gnunet-nse.c
 src/nse/gnunet-nse-profiler.c
@@ -458,6 +459,7 @@ src/include/gnunet_common.h
 src/include/gnunet_mq_lib.h
 src/include/gnunet_postgres_lib.h
 src/include/gnunet_time_lib.h
+src/nat/test_stun.h
 src/rps/rps-test_util.h
 src/scalarproduct/scalarproduct.h
 src/testbed/testbed_api.h
index 08cfdf4dff9028ac5ea58d9c8ec783da1accf3bf..d5ccd81e726d57a1d168edf63cc67ce559de08ad 100644 (file)
  */
 #include "platform.h"
 #include <microhttpd.h>
+#if HAVE_CURL_CURL_H
 #include <curl/curl.h>
+#elif HAVE_GNURL_CURL_H
+#include <gnurl/curl.h>
+#endif
 #include <gnutls/gnutls.h>
 #include <gnutls/x509.h>
 #include <gnutls/abstract.h>
index 7411c9bc94c570655c7afbfe8bf68984bd6f6146..fb6d01fcd2589d5ed8d82984136b5b212ce393de 100644 (file)
  * @author Martin Schanzenbach
  */
 #include "platform.h"
+#if HAVE_CURL_CURL_H
 #include <curl/curl.h>
+#elif HAVE_GNURL_CURL_H
+#include <gnurl/curl.h>
+#endif
 #include <microhttpd.h>
 #include "gnunet_namestore_service.h"
 #include "gnunet_gns_service.h"
@@ -246,7 +250,7 @@ static void
 start_curl (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
   GNUNET_asprintf (&url,
-                  "http://%s:%d/hello_world",  
+                  "http://%s:%d/hello_world",
                   TEST_DOMAIN, PORT);
   curl = curl_easy_init ();
   curl_easy_setopt (curl, CURLOPT_URL, url);
@@ -475,4 +479,3 @@ main (int argc, char *const *argv)
 }
 
 /* end of test_gns_vpn.c */
-
index 004a77c0234b0687fb0e331c3a334944fc3ba5d1..ba7bdb2cc947acdf77835f007cf33d5fb4875123 100644 (file)
 #include "gnunet_statistics_service.h"
 #include "gnunet_transport_service.h"
 #include "gnunet-daemon-hostlist.h"
+#if HAVE_CURL_CURL_H
 #include <curl/curl.h>
+#elif HAVE_GNURL_CURL_H
+#include <gnurl/curl.h>
+#endif
+
 
 
 /**
index 28e83009f40034b5271b6acb0f95db31886256d9..2ac41d810536d7e1549956a3a11828434b1400c8 100644 (file)
  * @author Martin Schanzenbach
  */
 #include "platform.h"
+#if HAVE_CURL_CURL_H
 #include <curl/curl.h>
+#elif HAVE_GNURL_CURL_H
+#include <gnurl/curl.h>
+#endif
 #include <microhttpd.h>
 #include "gnunet_identity_service.h"
 #include "gnunet_namestore_service.h"
index 4a223e59595b09273412ec56f82597c13e8471d3..29c087106272207d7362bae7751fca3c385ac1e5 100644 (file)
  * @author Christian Grothoff
  */
 #include "platform.h"
+#if HAVE_CURL_CURL_H
 #include <curl/curl.h>
+#elif HAVE_GNURL_CURL_H
+#include <gnurl/curl.h>
+#endif
 #include <microhttpd.h>
 #include "gnunet_vpn_service.h"
 #include "gnunet_testing_lib.h"
index 5655d7d6f577323a88c0e261dc43c101e4e41d1e..683f33f50f5ff3e9cc26599a88f6847c1c7f67f3 100644 (file)
 #include "gnunet_os_lib.h"
 #include "gnunet_nat_lib.h"
 #include "microhttpd.h"
+#if HAVE_CURL_CURL_H
 #include <curl/curl.h>
+#elif HAVE_GNURL_CURL_H
+#include <gnurl/curl.h>
+#endif
 
 
 #define DEBUG_HTTP GNUNET_EXTRA_LOGGING
index 7d935b4f02e61cb769334d1bc7213ff083cd7931..ad669d20e95430e8f4a4371a7c10da66b4dc0f73 100644 (file)
 #include "gnunet_protocols.h"
 #include "gnunet_transport_plugin.h"
 #include "plugin_transport_http_common.h"
+#if HAVE_CURL_CURL_H
 #include <curl/curl.h>
+#elif HAVE_GNURL_CURL_H
+#include <gnurl/curl.h>
+#endif
 
 
 #define LOG(kind,...) GNUNET_log_from(kind, PLUGIN_NAME, __VA_ARGS__)