- Fix #3846. When receiving a create request for an invalid path singal that register...
[oweals/gnunet.git] / configure.ac
index 4972e0f498b03797afa7bb6152d23024b62a0458..a30a540eef285c224529cb6a35e4cf95a5a9f66c 100644 (file)
@@ -380,6 +380,7 @@ then
   bluetooth=1
 fi
 
+
 # check for libpulse(audio) library
 pulse=0
 AC_CHECK_LIB(pulse,pa_stream_peek,
@@ -461,18 +462,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 +504,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
@@ -706,7 +723,7 @@ AC_CHECK_HEADERS([fcntl.h math.h errno.h ctype.h limits.h stdio.h stdlib.h strin
 
 
 # Checks for headers that are only required on some systems or opional (and where we do NOT abort if they are not there)
-AC_CHECK_HEADERS([malloc.h malloc/malloc.h malloc/malloc_np.h langinfo.h sys/param.h sys/mount.h sys/statvfs.h sys/select.h sockLib.h sys/mman.h sys/msg.h sys/vfs.h arpa/inet.h fcntl.h libintl.h netdb.h netinet/in.h sys/ioctl.h sys/socket.h sys/time.h unistd.h kstat.h sys/sysinfo.h kvm.h sys/file.h sys/resource.h ifaddrs.h mach/mach.h stddef.h sys/timeb.h terminos.h argz.h ucred.h sys/ucred.h endian.h sys/endian.h execinfo.h])
+AC_CHECK_HEADERS([malloc.h malloc/malloc.h malloc/malloc_np.h langinfo.h sys/param.h sys/mount.h sys/statvfs.h sys/select.h sockLib.h sys/mman.h sys/msg.h sys/vfs.h arpa/inet.h fcntl.h libintl.h netdb.h netinet/in.h sys/ioctl.h sys/socket.h sys/time.h unistd.h kstat.h sys/sysinfo.h kvm.h sys/file.h sys/resource.h ifaddrs.h mach/mach.h stddef.h sys/timeb.h terminos.h argz.h ucred.h sys/ucred.h endian.h sys/endian.h execinfo.h byteswap.h])
 
 # FreeBSD requires something more funky for netinet/in_systm.h and netinet/ip.h...
 AC_CHECK_HEADERS([sys/types.h netinet/in_systm.h netinet/in.h netinet/ip.h],,,
@@ -868,12 +885,12 @@ AC_ARG_WITH(microhttpd,
         AC_CHECK_HEADERS([microhttpd.h],
          AC_CHECK_DECL(MHD_OPTION_PER_IP_CONNECTION_LIMIT,
             AC_CHECK_LIB([microhttpd], [MHD_get_fdset2],
-              [AC_MSG_CHECKING([for libmicrohttpd >= 0.9.32])
+              [AC_MSG_CHECKING([for libmicrohttpd >= 0.9.42])
               AC_COMPILE_IFELSE([AC_LANG_SOURCE([
                 #include "$native_srcdir/src/include/platform.h"
                 #include <microhttpd.h>
-                #if (MHD_VERSION < 0x0093200)
-                #error needs at least version 0.9.32
+                #if (MHD_VERSION < 0x0094200)
+                #error needs at least version 0.9.42
                 #endif
                 int main () { return 0; }
                ])],
@@ -891,12 +908,12 @@ AC_ARG_WITH(microhttpd,
          AC_CHECK_DECL(MHD_OPTION_PER_IP_CONNECTION_LIMIT,
             AC_CHECK_LIB([microhttpd], [MHD_get_fdset2],
               EXT_LIB_PATH="-L$with_microhttpd/lib $EXT_LIB_PATH"
-              [AC_MSG_CHECKING([for libmicrohttpd >= 0.9.32])
+              [AC_MSG_CHECKING([for libmicrohttpd >= 0.9.42])
                AC_COMPILE_IFELSE([AC_LANG_SOURCE([
                 #include "$native_srcdir/src/include/platform.h"
                 #include <microhttpd.h>
-                #if (MHD_VERSION < 0x0093200)
-                #error needs at least version 0.9.32
+                #if (MHD_VERSION < 0x0094200)
+                #error needs at least version 0.9.42
                 #endif
                 int main () { return 0; }
                ])],
@@ -913,12 +930,12 @@ AC_ARG_WITH(microhttpd,
     AC_CHECK_HEADERS([microhttpd.h],
       AC_CHECK_DECL(MHD_OPTION_PER_IP_CONNECTION_LIMIT,
         AC_CHECK_LIB([microhttpd], [MHD_get_fdset2],
-          [AC_MSG_CHECKING([for libmicrohttpd >= 0.9.32])
+          [AC_MSG_CHECKING([for libmicrohttpd >= 0.9.42])
               AC_COMPILE_IFELSE([AC_LANG_SOURCE([
                 #include "$native_srcdir/src/include/platform.h"
                #include <microhttpd.h>
-                #if (MHD_VERSION < 0x0093200)
-                #error needs at least version 0.9.32
+                #if (MHD_VERSION < 0x0094200)
+                #error needs at least version 0.9.42
                 #endif
                ])],
                [AC_MSG_RESULT(ok)
@@ -1641,9 +1658,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])