From 00bfb5a5c5ac0c63185dc15b29ed5c73ae1b3583 Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Sat, 15 Aug 2020 10:34:44 +0000
Subject: Haiku doesn't use -ldl, add -lnetwork to CMakeList.txt


diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 053ca1d..fe1a198 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -152,6 +152,8 @@ if (UNIX)
 		set (MOSQ_LIBS ${MOSQ_LIBS} dl m)
     elseif (${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
 	    set (MOSQ_LIBS ${MOSQ_LIBS} m)
+    elseif (${CMAKE_SYSTEM_NAME} MATCHES "Haiku")
+	    set (MOSQ_LIBS ${MOSQ_LIBS} m network)
     elseif(QNX)
         set(MOSQ_LIBS ${MOSQ_LIBS} m socket)
     else(APPLE)
-- 
2.28.0


From 4073677b55e7f4406d7858605d7e08dfa1bf1b21 Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Sat, 15 Aug 2020 11:02:49 +0000
Subject: Use <syslog.h> instead of <sys/syslog.h> on Haiku


diff --git a/src/conf_includedir.c b/src/conf_includedir.c
index b602f96..5e9888a 100644
--- a/src/conf_includedir.c
+++ b/src/conf_includedir.c
@@ -37,7 +37,9 @@ Contributors:
 #  include <ws2tcpip.h>
 #endif
 
-#if !defined(WIN32) && !defined(__CYGWIN__) && !defined(__QNX__)
+#if defined(__HAIKU__)
+#  include <syslog.h>
+#elif !defined(WIN32) && !defined(__CYGWIN__) && !defined(__QNX__)
 #  include <sys/syslog.h>
 #endif
 
-- 
2.28.0

