package/libmicrohttpd: remove dependency on threads
authorBernd Kuhls <bernd.kuhls@t-online.de>
Fri, 27 Mar 2020 18:50:45 +0000 (19:50 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sun, 29 Mar 2020 13:28:39 +0000 (15:28 +0200)
Upstream added support for non-threaded builds:
https://git.gnunet.org/libmicrohttpd.git/commit/configure.ac?id=0eefd20ba370509d93fb7b0220e6d1c5739efac5

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/janus-gateway/Config.in
package/libmicrohttpd/0001-fix-6135.patch [new file with mode: 0644]
package/libmicrohttpd/Config.in
package/libmicrohttpd/libmicrohttpd.mk

index 9b70fa0cad3e306f1887ef47d9496e554644408b..989ae26055ef348ae40e06f298b9480db727598f 100644 (file)
@@ -77,7 +77,6 @@ comment "RabbitMQ transport needs a toolchain w/ dynamic library, threads"
 
 config BR2_PACKAGE_JANUS_GATEWAY_REST
        bool "REST (HTTP/HTTPS)"
-       depends on BR2_TOOLCHAIN_HAS_THREADS
        select BR2_PACKAGE_LIBMICROHTTPD
 
 comment "REST transport needs a toolchain w/ threads"
diff --git a/package/libmicrohttpd/0001-fix-6135.patch b/package/libmicrohttpd/0001-fix-6135.patch
new file mode 100644 (file)
index 0000000..af41028
--- /dev/null
@@ -0,0 +1,46 @@
+From 6702e6202368720d7a381669c03eedc318f225ca Mon Sep 17 00:00:00 2001
+From: Christian Grothoff <christian@grothoff.org>
+Date: Thu, 26 Mar 2020 19:08:30 +0100
+Subject: [PATCH] fix #6135
+
+Downloaded from upstream commit to fix non-threaded build:
+https://git.gnunet.org/libmicrohttpd.git/commit/?id=6702e6202368720d7a381669c03eedc318f225ca
+
+Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
+---
+ src/microhttpd/internal.h | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/src/microhttpd/internal.h b/src/microhttpd/internal.h
+index 211eed9f..ad16535e 100644
+--- a/src/microhttpd/internal.h
++++ b/src/microhttpd/internal.h
+@@ -1462,12 +1462,6 @@ struct MHD_Daemon
+    */
+   size_t thread_stack_size;
+-  /**
+-   * Our #MHD_OPTION_SERVER_INSANITY level, bits indicating
+-   * which sanity checks are off.
+-   */
+-  enum MHD_DisableSanityCheck insanity_level;
+-
+   /**
+    * Number of worker daemons
+    */
+@@ -1490,6 +1484,12 @@ struct MHD_Daemon
+   MHD_mutex_ cleanup_connection_mutex;
+ #endif
++  /**
++   * Our #MHD_OPTION_SERVER_INSANITY level, bits indicating
++   * which sanity checks are off.
++   */
++  enum MHD_DisableSanityCheck insanity_level;
++
+   /**
+    * Listen socket.
+    */
+-- 
+2.25.0
+
index 7f3c9bb8fda073bc9c8f433c9bd2c04183e6677d..8477ef6668c5c84677cb3ad8ff3ee4dfb8014010 100644 (file)
@@ -1,6 +1,5 @@
 config BR2_PACKAGE_LIBMICROHTTPD
        bool "libmicrohttpd"
-       depends on BR2_TOOLCHAIN_HAS_THREADS
        help
          GNU libmicrohttpd is a small C library that makes it easy to
          run an HTTP server as part of another application.
@@ -21,6 +20,3 @@ comment "libmicrohttpd https support needs a toolchain w/ wchar, dynamic library
        depends on !BR2_USE_WCHAR || BR2_STATIC_LIBS
 
 endif
-
-comment "libmicrohttpd needs a toolchain w/ threads"
-       depends on !BR2_TOOLCHAIN_HAS_THREADS
index f47d7ec2146dc00e632850cfaaf53c85f0b25418..ea2de55804db1ba37edc247e9eab55cd40aec0f2 100644 (file)
@@ -22,4 +22,10 @@ LIBMICROHTTPD_LICENSE = LGPL-2.1+ or eCos
 LIBMICROHTTPD_CONF_OPTS += --disable-https
 endif
 
+ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
+LIBMICROHTTPD_CONF_OPTS += --with-threads=auto
+else
+LIBMICROHTTPD_CONF_OPTS += --with-threads=none
+endif
+
 $(eval $(autotools-package))