From 1281e33cffdf71de55ff430bbb88b7d773aa0e6f Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Mon, 28 Jun 2021 19:41:02 +1000
Subject: Applying old patches


diff --git a/MediaInfoLib/Project/GNU/Library/libmediainfo.pc.in b/MediaInfoLib/Project/GNU/Library/libmediainfo.pc.in
index e9c36e1..7eaa69a 100644
--- a/MediaInfoLib/Project/GNU/Library/libmediainfo.pc.in
+++ b/MediaInfoLib/Project/GNU/Library/libmediainfo.pc.in
@@ -3,7 +3,7 @@ exec_prefix=@exec_prefix@
 libdir=@libdir@
 includedir=@includedir@
 Unicode=@MediaInfoLib_Unicode@
-Libs_Static=${libdir}/lib@MediaInfoLib_LibName@.a ${libdir}/libzen.a -lpthread -lz@Curl_Lib@
+Libs_Static=${libdir}/lib@MediaInfoLib_LibName@.a ${libdir}/libzen.a -lz@Curl_Lib@
 la_name=lib@MediaInfoLib_LibName@.la
 
 Name: libmediainfo
diff --git a/MediaInfoLib/Source/MediaInfo/MediaInfo_Events.h b/MediaInfoLib/Source/MediaInfo/MediaInfo_Events.h
index 933f76e..6564a75 100644
--- a/MediaInfoLib/Source/MediaInfo/MediaInfo_Events.h
+++ b/MediaInfoLib/Source/MediaInfo/MediaInfo_Events.h
@@ -67,7 +67,7 @@
     || defined(__unix) || defined(__unix__) \
     || defined(____SVR4____) || defined(__LINUX__) || defined(__sgi) \
     || defined(__hpux) || defined(sun) || defined(__SUN__) || defined(_AIX) \
-    || defined(__EMX__) || defined(__VMS) || defined(__BEOS__)
+    || defined(__EMX__) || defined(__VMS) || defined(__BEOS__) || defined(__HAIKU__)
     #ifndef UNIX
         #define UNIX
     #endif
diff --git a/MediaInfoLib/Source/MediaInfoDLL/MediaInfoDLL.h b/MediaInfoLib/Source/MediaInfoDLL/MediaInfoDLL.h
index ec26345..230a4c3 100644
--- a/MediaInfoLib/Source/MediaInfoDLL/MediaInfoDLL.h
+++ b/MediaInfoLib/Source/MediaInfoDLL/MediaInfoDLL.h
@@ -67,7 +67,7 @@
     || defined(__unix) || defined(__unix__)                                 \
     || defined(____SVR4____) || defined(__LINUX__) || defined(__sgi)        \
     || defined(__hpux) || defined(sun) || defined(__SUN__) || defined(_AIX) \
-    || defined(__EMX__) || defined(__VMS) || defined(__BEOS__)
+    || defined(__EMX__) || defined(__VMS) || defined(__BEOS__) || defined(__HAIKU__)
     #ifndef UNIX
         #define UNIX
     #endif
diff --git a/MediaInfoLib/Source/MediaInfoDLL/MediaInfoDLL_Static.h b/MediaInfoLib/Source/MediaInfoDLL/MediaInfoDLL_Static.h
index 3c41e2d..a2a051f 100644
--- a/MediaInfoLib/Source/MediaInfoDLL/MediaInfoDLL_Static.h
+++ b/MediaInfoLib/Source/MediaInfoDLL/MediaInfoDLL_Static.h
@@ -67,7 +67,7 @@
     || defined(__unix) || defined(__unix__)                                 \
     || defined(____SVR4____) || defined(__LINUX__) || defined(__sgi)        \
     || defined(__hpux) || defined(sun) || defined(__SUN__) || defined(_AIX) \
-    || defined(__EMX__) || defined(__VMS) || defined(__BEOS__)
+    || defined(__EMX__) || defined(__VMS) || defined(__BEOS__) || defined(__HAIKU__)
     #ifndef UNIX
         #define UNIX
     #endif
diff --git a/MediaInfoLib/Source/ThirdParty/aes-gladman/brg_endian.h b/MediaInfoLib/Source/ThirdParty/aes-gladman/brg_endian.h
index 4c34f2b..3b878c9 100644
--- a/MediaInfoLib/Source/ThirdParty/aes-gladman/brg_endian.h
+++ b/MediaInfoLib/Source/ThirdParty/aes-gladman/brg_endian.h
@@ -35,7 +35,7 @@ Issue Date: 20/12/2007
 #elif defined( __linux__ ) || defined( __GNUC__ ) || defined( __GNU_LIBRARY__ )
 #  if !defined( __MINGW32__ ) && !defined( _AIX )
 #    include <endian.h>
-#    if !defined( __BEOS__ )
+#    if !defined( __BEOS__ ) && !defined(__HAIKU__)
 #      include <byteswap.h>
 #    endif
 #  endif
diff --git a/ZenLib/Project/GNU/Library/configure b/ZenLib/Project/GNU/Library/configure
index d6e8bb8..cc3694c 100755
--- a/ZenLib/Project/GNU/Library/configure
+++ b/ZenLib/Project/GNU/Library/configure
@@ -15591,10 +15591,10 @@ fi
 
 
 if test "$enable_shared" = "yes"; then
-    ZenLib_LIBS="-L$(pwd)/.libs -lzen -lpthread $ZenLib_LIBS"
+    ZenLib_LIBS="-L$(pwd)/.libs -lzen $ZenLib_LIBS"
 fi
 if test "$enable_static" = "yes"; then
-    ZenLib_LIBS_Static="$(pwd)/.libs/libzen.a -lpthread $ZenLib_LIBS_Static"
+    ZenLib_LIBS_Static="$(pwd)/.libs/libzen.a $ZenLib_LIBS_Static"
 fi
 
 
@@ -15709,7 +15709,7 @@ if test "$GXX" = yes ; then
 	fi
 fi
 
-LDFLAGS="$LDFLAGS -lpthread"
+LDFLAGS="$LDFLAGS"
 
 for ac_func in gmtime_r localtime_r
 do :
diff --git a/ZenLib/Project/GNU/Library/configure.ac b/ZenLib/Project/GNU/Library/configure.ac
index 500101b..a13f0b6 100644
--- a/ZenLib/Project/GNU/Library/configure.ac
+++ b/ZenLib/Project/GNU/Library/configure.ac
@@ -144,10 +144,10 @@ dnl -------------------------------------------------------------------------
 dnl Common
 dnl
 if test "$enable_shared" = "yes"; then
-    ZenLib_LIBS="-L$(pwd)/.libs -lzen -lpthread $ZenLib_LIBS"
+    ZenLib_LIBS="-L$(pwd)/.libs -lzen $ZenLib_LIBS"
 fi
 if test "$enable_static" = "yes"; then
-    ZenLib_LIBS_Static="$(pwd)/.libs/libzen.a -lpthread $ZenLib_LIBS_Static"
+    ZenLib_LIBS_Static="$(pwd)/.libs/libzen.a $ZenLib_LIBS_Static"
 fi
 
 dnl #########################################################################
@@ -252,7 +252,7 @@ fi
 dnl -------------------------------------------------------------------------
 dnl External libs
 dnl
-LDFLAGS="$LDFLAGS -lpthread"
+LDFLAGS="$LDFLAGS"
 
 dnl -------------------------------------------------------------------------
 dnl Check if thread safe variants of time functions are available
diff --git a/ZenLib/Project/GNU/Library/libzen.pc.in b/ZenLib/Project/GNU/Library/libzen.pc.in
index f7bb814..3e9dfa7 100644
--- a/ZenLib/Project/GNU/Library/libzen.pc.in
+++ b/ZenLib/Project/GNU/Library/libzen.pc.in
@@ -4,10 +4,10 @@ libdir=@libdir@
 includedir=@includedir@
 Unicode=@ZenLib_Unicode@
 WstringMissing=@ZenLib_wstring_missing@
-Libs_Static=@libdir@/libzen.a -lpthread
+Libs_Static=@libdir@/libzen.a
 
 Name: libzen
 Version: @PACKAGE_VERSION@
 Description: ZenLib
-Libs: -L${libdir} -lzen -lpthread
+Libs: -L${libdir} -lzen
 Cflags: -I${includedir} @ZenLib_CXXFLAGS@
diff --git a/ZenLib/Source/ZenLib/Conf.h b/ZenLib/Source/ZenLib/Conf.h
index 18264cf..0a7426b 100644
--- a/ZenLib/Source/ZenLib/Conf.h
+++ b/ZenLib/Source/ZenLib/Conf.h
@@ -71,7 +71,7 @@
     || defined(__unix) || defined(__unix__) \
     || defined(____SVR4____) || defined(__LINUX__) || defined(__sgi) \
     || defined(__hpux) || defined(sun) || defined(__SUN__) || defined(_AIX) \
-    || defined(__EMX__) || defined(__VMS) || defined(__BEOS__)
+    || defined(__EMX__) || defined(__VMS) || defined(__BEOS__) || defined(__HAIKU__)
     #ifndef UNIX
         #define UNIX
     #endif
-- 
2.30.2

