aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-06-21 11:06:11 +0000
committerChristian Grothoff <christian@grothoff.org>2015-06-21 11:06:11 +0000
commit511156f37bbd1f0a8ae9deb98d2b3eea7586dfa1 (patch)
treef63412717bad83d51332ebcb241ba532cce847a2
parent5d82ad8f9164461be16f62436542e098934340d4 (diff)
downloadgnunet-511156f37bbd1f0a8ae9deb98d2b3eea7586dfa1.tar.gz
gnunet-511156f37bbd1f0a8ae9deb98d2b3eea7586dfa1.zip
support gnurl's curl.h being in include/gnurl/ OR include/curl/
-rw-r--r--configure.ac32
-rw-r--r--m4/libgnurl.m416
-rw-r--r--po/POTFILES.in2
-rw-r--r--src/gns/gnunet-gns-proxy.c4
-rw-r--r--src/gns/test_gns_proxy.c7
-rw-r--r--src/hostlist/gnunet-daemon-hostlist_client.c5
-rw-r--r--src/pt/test_gns_vpn.c4
-rw-r--r--src/pt/test_gnunet_vpn.c4
-rw-r--r--src/transport/plugin_transport_http.h4
-rw-r--r--src/transport/plugin_transport_http_client.c4
10 files changed, 72 insertions, 10 deletions
diff --git a/configure.ac b/configure.ac
index 8473f8830..37c03f720 100644
--- a/configure.ac
+++ b/configure.ac
@@ -461,18 +461,35 @@ else
461 AM_CONDITIONAL(HAVE_LIBGNURL, false) 461 AM_CONDITIONAL(HAVE_LIBGNURL, false)
462fi 462fi
463 463
464SAVE_CPPFLAGS=$CPPFLAGS
465CPPFLAGS="$LIBGNURL_CPPFLAGS $LIBCURL_CPPFLAGS $CPPFLAGS"
466LIBS="$LIBGNURL $LIBCURL $LIBS"
467
464# libcurl-gnutls 468# libcurl-gnutls
465LIBCURL_CHECK_CONFIG(,7.34.0,[curl=true],[curl=false]) 469LIBCURL_CHECK_CONFIG(,7.34.0,[curl=true],[curl=false])
466if test "x$curl" = xtrue 470if test "x$curl" = xtrue
467then 471then
472
468 AC_CHECK_HEADERS([curl/curl.h], 473 AC_CHECK_HEADERS([curl/curl.h],
469 AC_CHECK_DECLS(CURLINFO_TLS_SESSION,[curl=true],[curl=false],[[#include <curl/curl.h>]]), 474 AC_CHECK_DECLS(CURLINFO_TLS_SESSION,[curl=true],[curl=false],[[#include <curl/curl.h>]]),
470 [curl=false]) 475 [curl=false])
476 AC_CHECK_HEADERS([gnurl/curl.h],
477 AC_CHECK_DECLS(CURLINFO_TLS_SESSION,[curl=true],,[[#include <gnurl/curl.h>]]))
471 # need libcurl-gnutls.so, everything else is not acceptable 478 # need libcurl-gnutls.so, everything else is not acceptable
472 AC_CHECK_LIB([curl-gnutls],[curl_easy_getinfo],,[curl=false]) 479 AC_CHECK_LIB([curl-gnutls],[curl_easy_getinfo],,[curl=false])
473 # cURL must support CURLINFO_TLS_SESSION, version >= 7.34 480 # cURL must support CURLINFO_TLS_SESSION, version >= 7.34
474
475fi 481fi
482
483# Check for curl/curl.h and gnurl/curl.h so we can use #ifdef
484# HAVE_CURL_CURL_H later (the above LIBCURL_CHECK_CONFIG accepted
485# *either* header set).
486AC_CHECK_HEADERS([curl/curl.h],,
487 curl=false
488 AC_CHECK_HEADERS([gnurl/curl.h],,
489 gnurl=false))
490
491
492
476if test x$curl = xfalse 493if test x$curl = xfalse
477then 494then
478 AM_CONDITIONAL(HAVE_LIBCURL, false) 495 AM_CONDITIONAL(HAVE_LIBCURL, false)
@@ -486,10 +503,9 @@ else
486fi 503fi
487 504
488 505
489 506# restore LIBS & CPPFLAGS
490# restore LIBS
491LIBS=$SAVE_LIBS 507LIBS=$SAVE_LIBS
492 508CPPFLAGS=$SAVE_CPPFLAGS
493 509
494AC_CHECK_HEADERS([glpk.h],[glpk=true],[gplk=false]) 510AC_CHECK_HEADERS([glpk.h],[glpk=true],[gplk=false])
495# GLPK must support glpk_init_env, version >= 4.43 511# GLPK must support glpk_init_env, version >= 4.43
@@ -1641,9 +1657,9 @@ then
1641fi 1657fi
1642 1658
1643# libgnurl 1659# libgnurl
1644if test "x$gnurl" = "x0" 1660if test "x$gnurl" = "xfalse"
1645then 1661then
1646 if test "x$curl" = "x0" 1662 if test "x$curl" = "xfalse"
1647 then 1663 then
1648 AC_MSG_NOTICE([NOTICE: libgnurl not found. http client support will not be compiled.]) 1664 AC_MSG_NOTICE([NOTICE: libgnurl not found. http client support will not be compiled.])
1649 AC_MSG_WARN([ERROR: libgnurl not found. hostlist daemon will not be compiled, and you probably WANT the hostlist daemon]) 1665 AC_MSG_WARN([ERROR: libgnurl not found. hostlist daemon will not be compiled, and you probably WANT the hostlist daemon])
diff --git a/m4/libgnurl.m4 b/m4/libgnurl.m4
index 69aa16605..da72e5e87 100644
--- a/m4/libgnurl.m4
+++ b/m4/libgnurl.m4
@@ -159,6 +159,22 @@ x=CURLOPT_STDERR;
159x=CURLOPT_VERBOSE; 159x=CURLOPT_VERBOSE;
160])],libgnurl_cv_lib_gnurl_usable=yes,libgnurl_cv_lib_gnurl_usable=no) 160])],libgnurl_cv_lib_gnurl_usable=yes,libgnurl_cv_lib_gnurl_usable=no)
161 161
162# BEGIN Changes from original libcurl.m4:
163# Give it a 2nd shot using 'gnurl/curl.h'
164 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <gnurl/curl.h>],[
165/* Try and use a few common options to force a failure if we are
166 missing symbols or can't link. */
167int x;
168curl_easy_setopt(NULL,CURLOPT_URL,NULL);
169x=CURL_ERROR_SIZE;
170x=CURLOPT_WRITEFUNCTION;
171x=CURLOPT_FILE;
172x=CURLOPT_ERRORBUFFER;
173x=CURLOPT_STDERR;
174x=CURLOPT_VERBOSE;
175])],libgnurl_cv_lib_gnurl_usable=yes)
176# END Changes from original libcurl.m4:
177
162 CPPFLAGS=$_libgnurl_save_cppflags 178 CPPFLAGS=$_libgnurl_save_cppflags
163 LIBS=$_libgnurl_save_libs 179 LIBS=$_libgnurl_save_libs
164 unset _libgnurl_save_cppflags 180 unset _libgnurl_save_cppflags
diff --git a/po/POTFILES.in b/po/POTFILES.in
index dd166adcc..a9015c08b 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -229,6 +229,7 @@ src/nat/gnunet-nat-server.c
229src/nat/nat_auto.c 229src/nat/nat_auto.c
230src/nat/nat.c 230src/nat/nat.c
231src/nat/nat_mini.c 231src/nat/nat_mini.c
232src/nat/nat_stun.c
232src/nat/nat_test.c 233src/nat/nat_test.c
233src/nse/gnunet-nse.c 234src/nse/gnunet-nse.c
234src/nse/gnunet-nse-profiler.c 235src/nse/gnunet-nse-profiler.c
@@ -458,6 +459,7 @@ src/include/gnunet_common.h
458src/include/gnunet_mq_lib.h 459src/include/gnunet_mq_lib.h
459src/include/gnunet_postgres_lib.h 460src/include/gnunet_postgres_lib.h
460src/include/gnunet_time_lib.h 461src/include/gnunet_time_lib.h
462src/nat/test_stun.h
461src/rps/rps-test_util.h 463src/rps/rps-test_util.h
462src/scalarproduct/scalarproduct.h 464src/scalarproduct/scalarproduct.h
463src/testbed/testbed_api.h 465src/testbed/testbed_api.h
diff --git a/src/gns/gnunet-gns-proxy.c b/src/gns/gnunet-gns-proxy.c
index 08cfdf4df..d5ccd81e7 100644
--- a/src/gns/gnunet-gns-proxy.c
+++ b/src/gns/gnunet-gns-proxy.c
@@ -29,7 +29,11 @@
29 */ 29 */
30#include "platform.h" 30#include "platform.h"
31#include <microhttpd.h> 31#include <microhttpd.h>
32#if HAVE_CURL_CURL_H
32#include <curl/curl.h> 33#include <curl/curl.h>
34#elif HAVE_GNURL_CURL_H
35#include <gnurl/curl.h>
36#endif
33#include <gnutls/gnutls.h> 37#include <gnutls/gnutls.h>
34#include <gnutls/x509.h> 38#include <gnutls/x509.h>
35#include <gnutls/abstract.h> 39#include <gnutls/abstract.h>
diff --git a/src/gns/test_gns_proxy.c b/src/gns/test_gns_proxy.c
index 7411c9bc9..fb6d01fcd 100644
--- a/src/gns/test_gns_proxy.c
+++ b/src/gns/test_gns_proxy.c
@@ -24,7 +24,11 @@
24 * @author Martin Schanzenbach 24 * @author Martin Schanzenbach
25 */ 25 */
26#include "platform.h" 26#include "platform.h"
27#if HAVE_CURL_CURL_H
27#include <curl/curl.h> 28#include <curl/curl.h>
29#elif HAVE_GNURL_CURL_H
30#include <gnurl/curl.h>
31#endif
28#include <microhttpd.h> 32#include <microhttpd.h>
29#include "gnunet_namestore_service.h" 33#include "gnunet_namestore_service.h"
30#include "gnunet_gns_service.h" 34#include "gnunet_gns_service.h"
@@ -246,7 +250,7 @@ static void
246start_curl (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 250start_curl (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
247{ 251{
248 GNUNET_asprintf (&url, 252 GNUNET_asprintf (&url,
249 "http://%s:%d/hello_world", 253 "http://%s:%d/hello_world",
250 TEST_DOMAIN, PORT); 254 TEST_DOMAIN, PORT);
251 curl = curl_easy_init (); 255 curl = curl_easy_init ();
252 curl_easy_setopt (curl, CURLOPT_URL, url); 256 curl_easy_setopt (curl, CURLOPT_URL, url);
@@ -475,4 +479,3 @@ main (int argc, char *const *argv)
475} 479}
476 480
477/* end of test_gns_vpn.c */ 481/* end of test_gns_vpn.c */
478
diff --git a/src/hostlist/gnunet-daemon-hostlist_client.c b/src/hostlist/gnunet-daemon-hostlist_client.c
index 004a77c02..ba7bdb2cc 100644
--- a/src/hostlist/gnunet-daemon-hostlist_client.c
+++ b/src/hostlist/gnunet-daemon-hostlist_client.c
@@ -29,7 +29,12 @@
29#include "gnunet_statistics_service.h" 29#include "gnunet_statistics_service.h"
30#include "gnunet_transport_service.h" 30#include "gnunet_transport_service.h"
31#include "gnunet-daemon-hostlist.h" 31#include "gnunet-daemon-hostlist.h"
32#if HAVE_CURL_CURL_H
32#include <curl/curl.h> 33#include <curl/curl.h>
34#elif HAVE_GNURL_CURL_H
35#include <gnurl/curl.h>
36#endif
37
33 38
34 39
35/** 40/**
diff --git a/src/pt/test_gns_vpn.c b/src/pt/test_gns_vpn.c
index 28e83009f..2ac41d810 100644
--- a/src/pt/test_gns_vpn.c
+++ b/src/pt/test_gns_vpn.c
@@ -24,7 +24,11 @@
24 * @author Martin Schanzenbach 24 * @author Martin Schanzenbach
25 */ 25 */
26#include "platform.h" 26#include "platform.h"
27#if HAVE_CURL_CURL_H
27#include <curl/curl.h> 28#include <curl/curl.h>
29#elif HAVE_GNURL_CURL_H
30#include <gnurl/curl.h>
31#endif
28#include <microhttpd.h> 32#include <microhttpd.h>
29#include "gnunet_identity_service.h" 33#include "gnunet_identity_service.h"
30#include "gnunet_namestore_service.h" 34#include "gnunet_namestore_service.h"
diff --git a/src/pt/test_gnunet_vpn.c b/src/pt/test_gnunet_vpn.c
index 4a223e595..29c087106 100644
--- a/src/pt/test_gnunet_vpn.c
+++ b/src/pt/test_gnunet_vpn.c
@@ -24,7 +24,11 @@
24 * @author Christian Grothoff 24 * @author Christian Grothoff
25 */ 25 */
26#include "platform.h" 26#include "platform.h"
27#if HAVE_CURL_CURL_H
27#include <curl/curl.h> 28#include <curl/curl.h>
29#elif HAVE_GNURL_CURL_H
30#include <gnurl/curl.h>
31#endif
28#include <microhttpd.h> 32#include <microhttpd.h>
29#include "gnunet_vpn_service.h" 33#include "gnunet_vpn_service.h"
30#include "gnunet_testing_lib.h" 34#include "gnunet_testing_lib.h"
diff --git a/src/transport/plugin_transport_http.h b/src/transport/plugin_transport_http.h
index 5655d7d6f..683f33f50 100644
--- a/src/transport/plugin_transport_http.h
+++ b/src/transport/plugin_transport_http.h
@@ -41,7 +41,11 @@
41#include "gnunet_os_lib.h" 41#include "gnunet_os_lib.h"
42#include "gnunet_nat_lib.h" 42#include "gnunet_nat_lib.h"
43#include "microhttpd.h" 43#include "microhttpd.h"
44#if HAVE_CURL_CURL_H
44#include <curl/curl.h> 45#include <curl/curl.h>
46#elif HAVE_GNURL_CURL_H
47#include <gnurl/curl.h>
48#endif
45 49
46 50
47#define DEBUG_HTTP GNUNET_EXTRA_LOGGING 51#define DEBUG_HTTP GNUNET_EXTRA_LOGGING
diff --git a/src/transport/plugin_transport_http_client.c b/src/transport/plugin_transport_http_client.c
index 7d935b4f0..ad669d20e 100644
--- a/src/transport/plugin_transport_http_client.c
+++ b/src/transport/plugin_transport_http_client.c
@@ -49,7 +49,11 @@
49#include "gnunet_protocols.h" 49#include "gnunet_protocols.h"
50#include "gnunet_transport_plugin.h" 50#include "gnunet_transport_plugin.h"
51#include "plugin_transport_http_common.h" 51#include "plugin_transport_http_common.h"
52#if HAVE_CURL_CURL_H
52#include <curl/curl.h> 53#include <curl/curl.h>
54#elif HAVE_GNURL_CURL_H
55#include <gnurl/curl.h>
56#endif
53 57
54 58
55#define LOG(kind,...) GNUNET_log_from(kind, PLUGIN_NAME, __VA_ARGS__) 59#define LOG(kind,...) GNUNET_log_from(kind, PLUGIN_NAME, __VA_ARGS__)