diff -Naur fluidsynth-1.1-midi-buffer/fluidsynth/CMakeLists.txt fluidsynth-1.1-midi-buffer-haiku/fluidsynth/CMakeLists.txt
--- fluidsynth-1.1-midi-buffer/fluidsynth/CMakeLists.txt	2011-04-24 20:59:42.047710208 -0300
+++ fluidsynth-1.1-midi-buffer-haiku/fluidsynth/CMakeLists.txt	2011-04-24 21:01:20.278134784 -0300
@@ -166,10 +166,18 @@
     add_definitions ( -mms-bitfields )
   endif  ( MINGW )
 else ( WIN32 )
-# Check PThreads, but not in Windows
-  find_package ( Pthreads REQUIRED )
-  set ( HAVE_LIBPTHREAD ${PTHREADS_FOUND} )
-  set ( LIBFLUID_LIBS "m" )
+
+if (UNIX AND NOT BEOS)
+# Check PThreads, but not in Windows 
+   find_package ( Pthreads REQUIRED )
+   set ( HAVE_LIBPTHREAD ${PTHREADS_FOUND} )
+   set ( LIBFLUID_LIBS "m" )
+endif (UNIX AND NOT BEOS)
+
+if (BEOS)
+set ( LIBFLUID_LIBS "network")
+endif (BEOS)
+
 endif ( WIN32 )
 
 # IBM OS/2
diff -Naur fluidsynth-1.1-midi-buffer/fluidsynth/src/utils/fluid_sys.h fluidsynth-1.1-midi-buffer-haiku/fluidsynth/src/utils/fluid_sys.h
--- fluidsynth-1.1-midi-buffer/fluidsynth/src/utils/fluid_sys.h	2011-04-24 20:59:42.047710208 -0300
+++ fluidsynth-1.1-midi-buffer-haiku/fluidsynth/src/utils/fluid_sys.h	2011-04-24 21:02:01.829685760 -0300
@@ -335,7 +335,7 @@
     sample data.
  */
 
-#if defined(HAVE_SYS_MMAN_H) && !defined(__OS2__)
+#if defined(HAVE_SYS_MMAN_H) && !defined(__OS2__) && !defined(__HAIKU__)
 #define fluid_mlock(_p,_n)      mlock(_p, _n)
 #define fluid_munlock(_p,_n)    munlock(_p,_n)
 #else
