gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] branch master updated (0a76e006 -> a623db03)


From: gnunet
Subject: [libmicrohttpd] branch master updated (0a76e006 -> a623db03)
Date: Mon, 10 Jan 2022 13:21:37 +0100

This is an automated email from the git hooks/post-receive script.

karlson2k pushed a change to branch master
in repository libmicrohttpd.

    from 0a76e006 Fixed "make distcheck" (finally)
     new d70dd213 configure: minor fixes in ITC type detection
     new f8d5c77f configure: detect unimplemented pipe2() on GNU/kFreeBSD
     new a623db03 Added support for GNU/kFreeBSD in sockets functions

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 configure.ac                 | 58 ++++++++++++++++++++++++++++----------------
 src/microhttpd/mhd_sockets.h | 11 ++++++---
 2 files changed, 44 insertions(+), 25 deletions(-)

diff --git a/configure.ac b/configure.ac
index dbfa0bea..5a6400bb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -430,6 +430,11 @@ AS_CASE(["$host_os"],
      CFLAGS_ac="-no-cpp-precomp -fno-common $CFLAGS_ac"
      mhd_host_os='Darwin'
      AC_MSG_RESULT([[$mhd_host_os]])],
+ [kfreebsd*-gnu],
+ [AC_DEFINE([SOMEBSD],[1],[This is a BSD system])
+     AC_DEFINE_UNQUOTED([FREEBSD],[1],[This is a FreeBSD system])
+     mhd_host_os='FreeBSD kernel with GNU userland'
+     AC_MSG_RESULT([[$mhd_host_os]])],
  [freebsd*],
  [AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
      AC_DEFINE_UNQUOTED(FREEBSD,1,[This is a FreeBSD system])
@@ -1599,7 +1604,7 @@ AS_CASE([[$enable_itc]],
   [[no]], [AC_MSG_ERROR([[inter-thread communication cannot be disabled]])],
     [AC_MSG_ERROR([[unrecognized type "$enable_itc" of inter-thread 
communication specified by "--enable-itc=$enable_itc"]])]
 )
-# AS_UNSET([[use_itc]])
+AS_UNSET([[use_itc]])
 
 AS_IF([[test "x$enable_itc" = "xeventfd" || test "x$enable_itc" = "xauto"]], [
   AS_VAR_IF([[os_is_native_w32]], [["yes"]], [], [
@@ -1611,7 +1616,8 @@ AS_IF([[test "x$enable_itc" = "xeventfd" || test 
"x$enable_itc" = "xauto"]], [
 #include <sys/eventfd.h>
           ]], [[
           int ef = eventfd(0, EFD_CLOEXEC | EFD_NONBLOCK);
-          if (ef) return ef - 1;
+          if (ef < 0) return 1;
+          close (ef);
           ]])
         ], [[mhd_cv_eventfd_usable='yes']], [[mhd_cv_eventfd_usable='no']])
       ])
@@ -1638,18 +1644,20 @@ AC_INCLUDES_DEFAULT
         ], [[
           int arr[2];
           int res;
-          res = pipe(arr)
+          res = pipe(arr);
+          if (res != 0) return 33;
+          close (arr[0]);
+          close (arr[1]);
         ]])
       ], [[mhd_cv_pipe_usable='yes']], [[mhd_cv_pipe_usable='no']])
     ])
-  ])
-  AS_VAR_IF([[mhd_cv_pipe_usable]], [["yes"]], [
-    use_itc='pipe'
-    enable_itc="$use_itc"
-    AC_DEFINE([[_MHD_ITC_PIPE]], [[1]], [Define to use pipe for inter-thread 
communication])
-    AC_CACHE_CHECK([[whether pipe2(2) is usable]], [[mhd_cv_pipe2_usable]], [
-      AC_LINK_IFELSE([
-        AC_LANG_PROGRAM([
+    AS_VAR_IF([[mhd_cv_pipe_usable]], [["yes"]], [
+      use_itc='pipe'
+      enable_itc="$use_itc"
+      AC_DEFINE([[_MHD_ITC_PIPE]], [[1]], [Define to use pipe for inter-thread 
communication])
+      AC_CACHE_CHECK([[whether pipe2(2) is usable]], [[mhd_cv_pipe2_usable]], [
+        AC_RUN_IFELSE([
+          AC_LANG_PROGRAM([
 AC_INCLUDES_DEFAULT
 #ifdef HAVE_FCNTL_H
 #include <fcntl.h>
@@ -1657,17 +1665,25 @@ AC_INCLUDES_DEFAULT
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
-        ], [[
-          int arr[2];
-          int res;
-          res = pipe2(arr, O_CLOEXEC | O_NONBLOCK)
-        ]])
-      ], [[mhd_cv_pipe2_usable='yes']], [[mhd_cv_pipe2_usable='no']])
+          ], [[
+            int arr[2];
+            int res;
+            res = pipe2(arr, O_CLOEXEC | O_NONBLOCK);
+            if (res != 0) return 33;
+            close (arr[0]);
+            close (arr[1]);
+          ]])
+        ], [[mhd_cv_pipe2_usable='yes']], [[mhd_cv_pipe2_usable='no']], [
+          # Cross-compiling
+          AS_CASE([${host_os}], [kfreebsd*-gnu], 
[[mhd_cv_pipe2_usable='assuming no']],
+            [[mhd_cv_pipe2_usable='assuming yes']])
+        ])
+      ])
+      AS_CASE([["X-${mhd_cv_pipe2_usable}"]], [[X*yes]],
+        [AC_DEFINE([[HAVE_PIPE2_FUNC]], [[1]], [Define if you have usable 
pipe2(2) function])])
+    ], [
+      AS_VAR_IF([[enable_itc]], [["pipe"]], [AC_MSG_ERROR([[pipe(3) is not 
usable, consider using other type of inter-thread communication]])])
     ])
-    AS_VAR_IF([[mhd_cv_pipe2_usable]], [["yes"]],
-      [AC_DEFINE([[HAVE_PIPE2_FUNC]], [[1]], [Define if you have usable 
pipe2(2) function])])
-  ], [
-    AS_VAR_IF([[enable_itc]], [["pipe"]], [AC_MSG_ERROR([[pipe(3) is not 
usable, consider using other type of inter-thread communication]])])
   ])
 ])
 
diff --git a/src/microhttpd/mhd_sockets.h b/src/microhttpd/mhd_sockets.h
index d09cc522..fb404891 100644
--- a/src/microhttpd/mhd_sockets.h
+++ b/src/microhttpd/mhd_sockets.h
@@ -126,7 +126,7 @@ typedef intptr_t ssize_t;
 #endif
 
 
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 #include <sys/param.h> /* For __FreeBSD_version */
 #endif /* __FreeBSD__ */
 
@@ -204,7 +204,8 @@ typedef SOCKET MHD_socket;
 #  define USE_ACCEPT4 1
 #endif
 
-#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || \
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \
+  defined(__OpenBSD__) || defined(__NetBSD__) || \
   defined(MHD_WINSOCK_SOCKETS) || defined(__MACH__) || defined(__sun) || \
   defined(SOMEBSD)
 /* Most of OSes inherit nonblocking setting from the listen socket */
@@ -248,8 +249,10 @@ typedef SOCKET MHD_socket;
  */
 #define _MHD_CORK_RESET_PUSH_DATA_ALWAYS 1
 #endif /* __linux__ */
-#if defined(__FreeBSD__) && \
-  ((__FreeBSD__ + 0) >= 5 || (__FreeBSD_version + 0) >= 450000)
+#if (defined(__FreeBSD__) && \
+  ((__FreeBSD__ + 0) >= 5 || (__FreeBSD_version + 0) >= 450000)) || \
+  (defined(__FreeBSD_kernel_version) && \
+  (__FreeBSD_kernel_version + 0) >= 450000)
 /* FreeBSD pushes data to the network with reset of TCP_NOPUSH
  * starting from version 4.5. */
 /**

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]