From 7880b48ee867e41193eb0d70476ccad7faf8cd7d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= <revol@free.fr>
Date: Mon, 20 Oct 2014 00:59:52 +0200
Subject: [PATCH 1/2] Add Haiku support

---
 Makefile         | 3 +++
 librtmp/Makefile | 6 ++++++
 2 files changed, 9 insertions(+)

diff --git a/Makefile b/Makefile
index a1595a8..857080d 100644
--- a/Makefile
+++ b/Makefile
@@ -35,12 +35,14 @@ MANDIR=$(DESTDIR)$(mandir)
 LIBS_posix=
 LIBS_darwin=
 LIBS_mingw=-lws2_32 -lwinmm -lgdi32
+LIBS_haiku=-lnetwork
 LIB_RTMP=-Llibrtmp -lrtmp
 LIBS=$(LIB_RTMP) $(CRYPTO_LIB) $(LIBS_$(SYS)) $(XLIBS)
 
 THREADLIB_posix=-lpthread
 THREADLIB_darwin=-lpthread
 THREADLIB_mingw=
+THREADLIB_haiku=
 THREADLIB=$(THREADLIB_$(SYS))
 SLIBS=$(THREADLIB) $(LIBS)
 
@@ -50,6 +52,7 @@ INCRTMP=librtmp/rtmp_sys.h librtmp/rtmp.h librtmp/log.h librtmp/amf.h
 EXT_posix=
 EXT_darwin=
 EXT_mingw=.exe
+EXT_haiku=
 EXT=$(EXT_$(SYS))
 
 PROGS=rtmpdump rtmpgw rtmpsrv rtmpsuck
diff --git a/librtmp/Makefile b/librtmp/Makefile
index 2c1c790..f81851d 100644
--- a/librtmp/Makefile
+++ b/librtmp/Makefile
@@ -29,6 +29,7 @@ LIBZ=-lz
 LIBS_posix=
 LIBS_darwin=
 LIBS_mingw=-lws2_32 -lwinmm -lgdi32
+LIBS_haiku=
 LIB_GNUTLS=-lgnutls -lhogweed -lnettle -lgmp $(LIBZ)
 LIB_OPENSSL=-lssl -lcrypto $(LIBZ)
 LIB_POLARSSL=-lpolarssl $(LIBZ)
@@ -42,26 +43,31 @@ SO_VERSION=1
 SOX_posix=so
 SOX_darwin=dylib
 SOX_mingw=dll
+SOX_haiku=so
 SOX=$(SOX_$(SYS))
 SO_posix=.$(SOX).$(SO_VERSION)
 SO_darwin=.$(SO_VERSION).$(SOX)
 SO_mingw=-$(SO_VERSION).$(SOX)
+SO_haiku=.$(SO_VERSION).$(SOX)
 SO_EXT=$(SO_$(SYS))
 
 SODIR_posix=$(LIBDIR)
 SODIR_darwin=$(LIBDIR)
 SODIR_mingw=$(BINDIR)
+SODIR_haiku=$(LIBDIR)
 SODIR=$(SODIR_$(SYS))
 
 SO_LDFLAGS_posix=-shared -Wl,-soname,$@
 SO_LDFLAGS_darwin=-dynamiclib -twolevel_namespace -undefined dynamic_lookup \
 	-fno-common -headerpad_max_install_names -install_name $(libdir)/$@
 SO_LDFLAGS_mingw=-shared -Wl,--out-implib,librtmp.dll.a
+SO_LDFLAGS_haiku=-shared -Wl,-soname,$@
 SO_LDFLAGS=$(SO_LDFLAGS_$(SYS))
 
 INSTALL_IMPLIB_posix=
 INSTALL_IMPLIB_darwin=
 INSTALL_IMPLIB_mingw=cp librtmp.dll.a $(LIBDIR)
+INSTALL_IMPLIB_haiku=
 INSTALL_IMPLIB=$(INSTALL_IMPLIB_$(SYS))
 
 SHARED=yes
-- 
1.8.3.4


From eab330a936df9ef7325d28e5a412ccc32b0ee761 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= <revol@free.fr>
Date: Mon, 20 Oct 2014 01:12:47 +0200
Subject: [PATCH 2/2] POSIX says fd_set is in sys/select.h

---
 rtmpgw.c   | 1 +
 rtmpsuck.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/rtmpgw.c b/rtmpgw.c
index 3e47602..2745723 100644
--- a/rtmpgw.c
+++ b/rtmpgw.c
@@ -26,6 +26,7 @@
 
 #include <signal.h>
 #include <getopt.h>
+#include <sys/select.h>
 
 #include <assert.h>
 
diff --git a/rtmpsuck.c b/rtmpsuck.c
index e886179..990b477 100644
--- a/rtmpsuck.c
+++ b/rtmpsuck.c
@@ -31,6 +31,7 @@
 
 #include <signal.h>
 #include <getopt.h>
+#include <sys/select.h>
 
 #include <assert.h>
 
-- 
1.8.3.4

