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)
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
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])
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
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
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
*/
#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>
* @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"
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);
}
/* end of test_gns_vpn.c */
-
#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
+
/**
* @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"
* @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"
#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
#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__)