From e9a832dffcc9800f0111a2a5584eb3b0b599887d Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Thu, 3 Oct 2019 11:17:18 +0200
Subject: Fix Haiku's defenitions to int types (Fix by PeteCA)


diff --git a/InOut/ipmidi.c b/InOut/ipmidi.c
index 49338f6..1910e2c 100644
--- a/InOut/ipmidi.c
+++ b/InOut/ipmidi.c
@@ -23,6 +23,9 @@
 
 /* Realtime MIDI using ipmidi library */
 
+/* Haiku 'int32' etc definitions in net headers conflict with sysdep.h */
+#define __HAIKU_CONFLICT
+
 #include <sys/types.h>
 #ifdef WIN32
 #include <winsock2.h>
diff --git a/Opcodes/OSC.c b/Opcodes/OSC.c
index 4f77966..4f6e7ab 100644
--- a/Opcodes/OSC.c
+++ b/Opcodes/OSC.c
@@ -22,6 +22,9 @@
     02110-1301 USA
 */
 
+/* Haiku 'int32' etc definitions in net headers conflict with sysdep.h */
+#define __HAIKU_CONFLICT
+
 #include "csdl.h"
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/Opcodes/sockrecv.c b/Opcodes/sockrecv.c
index 757f2cc..4784e92 100644
--- a/Opcodes/sockrecv.c
+++ b/Opcodes/sockrecv.c
@@ -21,6 +21,9 @@
   02110-1301 USA
 */
 
+/* Haiku 'int32' etc definitions in net headers conflict with sysdep.h */
+#define __HAIKU_CONFLICT
+
 #include "csoundCore.h"
 #include <stdlib.h>
 #include <sys/types.h>
diff --git a/Opcodes/socksend.c b/Opcodes/socksend.c
index 273c344..542b2be 100644
--- a/Opcodes/socksend.c
+++ b/Opcodes/socksend.c
@@ -22,6 +22,9 @@
   02110-1301 USA
 */
 
+/* Haiku 'int32' etc definitions in net headers conflict with sysdep.h */
+#define __HAIKU_CONFLICT
+
 #include "csoundCore.h"
 #include <sys/types.h>
 #if defined(WIN32) && !defined(__CYGWIN__)
diff --git a/Top/server.c b/Top/server.c
index ff4be9a..5754e9f 100644
--- a/Top/server.c
+++ b/Top/server.c
@@ -24,6 +24,9 @@
 typedef unsigned int u_int32_t;
 #endif
 
+/* Haiku 'int32' etc definitions in net headers conflict with sysdep.h */
+#define __HAIKU_CONFLICT
+
 #include "csoundCore.h"
 #if defined(WIN32) && !defined(__CYGWIN__)
 #include <winsock2.h>
diff --git a/include/sysdep.h b/include/sysdep.h
index 932b091..40aebb4 100644
--- a/include/sysdep.h
+++ b/include/sysdep.h
@@ -89,8 +89,10 @@ typedef unsigned __int32 uint32;
 typedef unsigned __int16 uint16;
 #else
 #include <stdint.h>
-#ifndef __HAIKU_CONFLICT
-/* Haiku has different typedefs -- only relevant to rthaiku */
+#if defined(__HAIKU__) && defined(__HAIKU_CONFLICT)
+/* Haiku has different typedefs -- relevant to rthaiku and network*/
+#include <SupportDefs.h>
+#else
 typedef int_least32_t int32;
 typedef int_least16_t int16;
 typedef uint_least32_t uint32;
-- 
2.23.0


From ed27266009ae7889140cfc05005956206cbbbb81 Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Thu, 3 Oct 2019 15:19:09 +0200
Subject: Fix install paths


diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2c1db25..b9cb1fa 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -20,10 +20,16 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
 set(APIVERSION "6.0")
 
 # Relative install paths
-set(EXECUTABLE_INSTALL_DIR "bin")
+set (CMAKE_INSTALL_BINDIR=bin)
+set (CMAKE_INSTALL_LIBDIR=lib)
+set (CMAKE_INSTALL_LOCALEDIR=share/locale)
+set (CMAKE_INSTALL_INCLUDEDIR=include/csound)
+set (CMAKE_INSTALL_MODULEDIR=share/cmake/Csound)
 
-set(LOCALE_INSTALL_DIR "share/locale")
-set(HEADER_INSTALL_DIR "include/csound")
+set(EXECUTABLE_INSTALL_DIR ${CMAKE_INSTALL_BINDIR})
+
+set(LOCALE_INSTALL_DIR ${CMAKE_INSTALL_LOCALEDIR})
+set(HEADER_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR})
 
 set(CS_FRAMEWORK_DEST "~/Library/Frameworks" CACHE PATH "Csound framework path")
 include(TestBigEndian)
@@ -191,7 +197,7 @@ if(USE_LIB64)
     set(LIBRARY_INSTALL_DIR "lib64")
     add_definitions("-DLIB64")
 else()
-    set(LIBRARY_INSTALL_DIR "lib")
+    set(LIBRARY_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR})
 endif()
 message(STATUS "LIBRARY INSTALL DIR: ${LIBRARY_INSTALL_DIR}")
 
@@ -1487,4 +1493,4 @@ endif(DOXYGEN_FOUND)
 
 # install CMake module
 install(FILES ${CMAKE_SOURCE_DIR}/cmake/Modules/FindCsound.cmake
-        DESTINATION "${CMAKE_INSTALL_PREFIX}/share/cmake/Csound")
+        DESTINATION "${CMAKE_INSTALL_MODULEDIR}")
-- 
2.23.0

