diff -urN vlc-0.8.6i/configure.ac vlc-0.8.6i-haiku/configure.ac
--- vlc-0.8.6i/configure.ac	2009-02-18 15:15:26.000000000 +0000
+++ vlc-0.8.6i-haiku/configure.ac	2009-02-21 22:47:18.000000000 +0000
@@ -256,6 +256,7 @@
     VLC_ADD_LDFLAGS([vlc logger],[-lbe])
     VLC_ADD_LDFLAGS([beos],[-lbe -lmedia -ltranslation -ltracker -lgame])
     VLC_ADD_LDFLAGS([dvdnav dvdread],[-ldl])
+    VLC_ADD_LDFLAGS([access_file],[-lpoll])
     LDFLAGS_save="${LDFLAGS_save} -lintl"; LDFLAGS="${LDFLAGS_save}"
 
     dnl Check for BONE
@@ -270,11 +271,24 @@
         VLC_ADD_LDFLAGS([beos],[-lzeta])
     fi
     ;;
+  haiku*)
+    SYS=haiku
+    CFLAGS_save="${CFLAGS_save} -Wno-multichar"; CFLAGS="${CFLAGS_save}"
+    CXXFLAGS_save="${CXXFLAGS_save} -Wno-multichar"; CXXFLAGS="${CXXFLAGS_save}"
+    VLC_ADD_CXXFLAGS([haiku],[])
+    VLC_ADD_LDFLAGS([vlc logger],[-lbe])
+    VLC_ADD_LDFLAGS([beos],[-lbe -lmedia -ltranslation -ltracker -lgame])
+    VLC_ADD_LDFLAGS([dvdnav dvdread],[])
+    VLC_ADD_LDFLAGS([access_file],[-lroot])
+    LDFLAGS_save="${LDFLAGS_save} -lintl"; LDFLAGS="${LDFLAGS_save}"
+    VLC_ADD_LDFLAGS([access_file access_ftp access_mms access_output_udp telnet netsync sap ipv4 vlc growl],[-lnetwork])
+    ;;
   *)
     SYS="${target_os}"
     ;;
 esac
 AM_CONDITIONAL(HAVE_BEOS, test "${SYS}" = "beos")
+AM_CONDITIONAL(HAVE_HAIKU, test "${SYS}" = "haiku")
 AM_CONDITIONAL(HAVE_DARWIN, test "${SYS}" = "darwin")
 AM_CONDITIONAL(HAVE_WIN32, test "${SYS}" = "mingw32")
 AM_CONDITIONAL(HAVE_WINCE, test "${SYS}" = "mingwce")
@@ -444,12 +458,26 @@
   ])
 ])
 
+AC_CHECK_FUNCS(connect,,[
+  AC_CHECK_LIB(network,connect,[
+    VLC_ADD_LDFLAGS([vlc ipv4 ipv6 cdda cddax],-lnetwork)
+    LIBS_socket="-lnetwork"
+  ])
+])
+
+
 AC_CHECK_FUNCS(send,,[
   AC_CHECK_LIB(socket,send,[
     VLC_ADD_LDFLAGS([access_http access_mms access_udp access_tcp access_ftp sap access_output_udp stream_out_standard growl],[-lsocket])
   ])
 ])
 
+AC_CHECK_FUNCS(send,,[
+  AC_CHECK_LIB(network,send,[
+    VLC_ADD_LDFLAGS([access_http access_mms access_udp access_tcp access_ftp sap access_output_udp stream_out_standard growl],[-lnetwork])
+  ])
+])
+
 AC_CHECK_FUNCS(gethostbyname,,[
   AC_CHECK_LIB(nsl,gethostbyname,[
     VLC_ADD_LDFLAGS([cdda cddax ipv4 ipv6 vlc],[-lnsl])
@@ -460,11 +488,22 @@
   ])
 ])
 
+AC_CHECK_FUNCS(gethostbyname,,[
+  AC_CHECK_LIB(nsl,gethostbyname,[
+    VLC_ADD_LDFLAGS([cdda cddax ipv4 ipv6 vlc],[-lnsl])
+  ],[
+    AC_CHECK_LIB(network,gethostbyname,[
+      VLC_ADD_LDFLAGS([ipv4 access_mms],[-lnetwork])
+    ])
+  ])
+])
+
 dnl Check for socklen_t
 AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t,
   [AC_TRY_COMPILE(
      [#include <sys/types.h>
-      #include <sys/socket.h>],
+      #include <sys/socket.h>
+      #include <sys/select.h>],
      [socklen_t len = 42; return len;],
      ac_cv_type_socklen_t=yes,
      ac_cv_type_socklen_t=no)])
@@ -497,8 +536,10 @@
 dnl  we purposedly make the test fail on Windows
 LIBS_save="${LIBS}"
 AH_TEMPLATE(HAVE_GETADDRINFO, [Define to 1 if you have the `getaddrinfo' function.])
+AC_SEARCH_LIBS([getaddrinfo], [nsl] [network], [AC_DEFINE(HAVE_GETADDRINFO)],, [${LIBS_socket}])
 AC_SEARCH_LIBS([getaddrinfo], [nsl], [AC_DEFINE(HAVE_GETADDRINFO)],, [${LIBS_socket}])
 
+
 dnl NOTE: we assume getaddrinfo will be present if getnameinfo or gai_strerro
 dnl are
 LIBS="${LIBS_gai}"
@@ -804,8 +845,6 @@
 
 dnl it seems that autoconf do the pkg-config detection only for the first PKG_CHECK_MODULES in the configure.ac ( which is logical) but in our case it is nested in a if so it was not working if you're not on linux or have disable hal.
 
-PKG_PROG_PKG_CONFIG()
-
 dnl Check for hal
 AC_ARG_ENABLE(hal,
   [  --enable-hal            Linux HAL services discovery (default enabled)])
@@ -2742,28 +2781,12 @@
       AC_CHECK_HEADERS(ffmpeg/avutil.h libavutil/avutil.h)
       AC_CHECK_HEADERS(postproc/postprocess.h libpostproc/postprocess.h)
 
-      AC_CHECK_LIB(avutil, av_crc_init, [
-        VLC_ADD_LDFLAGS([ffmpeg],[-lavutil])
-        LDAVUTIL="-lavutil"])
-
-      AC_CHECK_LIB(avcodec, avcodec_init, [
-        VLC_ADD_BUILTINS([ffmpeg])
-        VLC_ADD_LDFLAGS([ffmpeg],[-lavcodec])
-        if test "${enable_sout}" != "no"; then
-            VLC_ADD_BUILTINS([stream_out_switcher])
-        fi],
-         [ AC_MSG_ERROR([Could not find ffmpeg on your system: you may get it from http://ffmpeg.sf.net/ (svn version is recommended). Alternatively you can use --disable-ffmpeg to disable the ffmpeg plugins.]) ], [$LDAVUTIL])
-
-      
-      AC_CHECK_LIB(postproc, pp_postprocess, [
-        VLC_ADD_LDFLAGS([ffmpeg],[-lpostproc])],
-	AC_MSG_ERROR([Could not find libpostproc inside FFmpeg. You should configure FFmpeg with --enable-gpl --enable-pp.]),
-	[$LDAVUTIL])
-
-      AC_CHECK_LIB(avformat, av_open_input_stream, [
-        VLC_ADD_LDFLAGS([ffmpeg],[-lavformat -lz]) ], [], [-lavcodec -lz $LDAVUTIL])
-      LDFLAGS="${LDFLAGS_save}"
-      CPPFLAGS="${CPPFLAGS_save}"
+	VLC_ADD_BUILTINS([ffmpeg])
+	VLC_ADD_LDFLAGS([ffmpeg],[-lavutil]) 
+	LDAVUTIL="-lavutil"
+	VLC_ADD_LDFLAGS([ffmpeg],[-lpostproc])
+	VLC_ADD_LDFLAGS([ffmpeg],[-lavcodec])
+	VLC_ADD_LDFLAGS([ffmpeg],[-lavformat -lz])		
     ])
   fi
  fi 
@@ -4407,7 +4430,7 @@
 AC_ARG_WITH(,[Interface plugins:])
 
 dnl special case for BeOS
-if test "${SYS}" = "beos"
+if test "${SYS}" = "beos" || test "${SYS}" = "haiku"
 then
     VLC_ADD_BUILTINS([beos])
 fi
@@ -4418,8 +4441,7 @@
 AC_ARG_ENABLE(skins2,
   [  --enable-skins2         Skins2 interface module (experimental)])
 if test "${enable_skins2}" = "yes" ||
-  (test "${SYS}" != "darwin" && test "${SYS}" != "beos" &&
-   test "${SYS}" != "mingwce" && test "${enable_skins2}" != "no"); then
+  (test "${SYS}" != "darwin" && test "${SYS}" != "beos" && test "${SYS}" != "haiku" && test "${SYS}" != "mingwce" && test "${enable_skins2}" != "no"); then
 
   dnl test for the required libraries
   skins2_missing_lib="no"
diff -urN vlc-0.8.6i/extras/contrib/src/Makefile vlc-0.8.6i-haiku/extras/contrib/src/Makefile
--- vlc-0.8.6i/extras/contrib/src/Makefile	2009-02-18 15:15:55.000000000 +0000
+++ vlc-0.8.6i-haiku/extras/contrib/src/Makefile	2009-02-18 15:13:25.000000000 +0000
@@ -153,9 +153,9 @@
  ifdef HAVE_BEOS
   ifeq ($(HOST),$(BUILD))
 # Native build: we need perl, autoconf, etc first
-   all: .perl .autoconf .automake .libtool .iconv .intl .freetype .fribidi \
+   all: .libtool .iconv .intl .freetype .fribidi \
 	.a52 .mpeg2 .id3tag .mad .ogg .vorbis .vorbisenc .theora \
-	.FLAC .speex .faad .faac .lame .ebml .matroska .ffmpeg .dvdcss \
+	.faad .lame .ebml .matroska .dvdcss \
 	.dvdnav .dvbpsi .aclocal .libdca
   else
 # Cross compiling: we already have the Linux tools, only build the
diff -urN vlc-0.8.6i/include/vlc_threads.h vlc-0.8.6i-haiku/include/vlc_threads.h
--- vlc-0.8.6i/include/vlc_threads.h	2009-02-18 15:16:01.000000000 +0000
+++ vlc-0.8.6i-haiku/include/vlc_threads.h	2009-02-21 17:59:20.000000000 +0000
@@ -45,7 +45,7 @@
 #elif defined( HAVE_KERNEL_SCHEDULER_H )                             /* BeOS */
 #   include <kernel/OS.h>
 #   include <kernel/scheduler.h>
-#   include <byteorder.h>
+#   include <ByteOrder.h>
 
 #elif defined( PTHREAD_COND_T_IN_PTHREAD_H )  /* pthreads (like Linux & BSD) */
 #   include <pthread.h>
diff -urN vlc-0.8.6i/modules/codec/telx.c vlc-0.8.6i-haiku/modules/codec/telx.c
--- vlc-0.8.6i/modules/codec/telx.c	2009-02-18 15:15:33.000000000 +0000
+++ vlc-0.8.6i-haiku/modules/codec/telx.c	2009-02-18 15:14:10.000000000 +0000
@@ -27,7 +27,7 @@
  *****************************************************************************/
 #include <vlc/vlc.h>
 #include <assert.h>
-#include <stdint.h>
+#include <inttypes.h>
 
 #include <vlc/vout.h>
 #include <vlc/decoder.h>
@@ -450,7 +450,7 @@
     vlc_bool_t b_update = VLC_FALSE;
     char psz_text[512], *pt = psz_text;
     char psz_line[256];
-    int i, total;
+    int i, total, mpag, row, magazine;
 
     if( pp_block == NULL || *pp_block == NULL ) return NULL;
     p_block = *pp_block;
@@ -473,8 +473,7 @@
 /*         continue; */
 /*       } */
 
-        int mpag = (hamming_8_4( packet[4] ) << 4) | hamming_8_4( packet[5] );
-        int row, magazine;
+        mpag = (hamming_8_4( packet[4] ) << 4) | hamming_8_4( packet[5] );
         if ( mpag < 0 )
         {
             /* decode error */
diff -urN vlc-0.8.6i/modules/gui/beos/InterfaceWindow.cpp vlc-0.8.6i-haiku/modules/gui/beos/InterfaceWindow.cpp
--- vlc-0.8.6i/modules/gui/beos/InterfaceWindow.cpp	2009-02-18 15:15:26.000000000 +0000
+++ vlc-0.8.6i-haiku/modules/gui/beos/InterfaceWindow.cpp	2009-02-18 15:13:51.000000000 +0000
@@ -319,10 +319,8 @@
 
     /* Add the Show menu */
     fShowMenu = new BMenu( _("Window") );
-#if 0
     ADD_ELLIPSIS( _("Playlist") );
     fShowMenu->AddItem( new BMenuItem( psz_tmp, new BMessage( OPEN_PLAYLIST ), 'P') );
-#endif
     ADD_ELLIPSIS( _("Messages") );
     fShowMenu->AddItem( new BMenuItem( psz_tmp, new BMessage( OPEN_MESSAGES ), 'M' ) );
     ADD_ELLIPSIS( _("Preferences") );
diff -urN vlc-0.8.6i/src/input/input.c vlc-0.8.6i-haiku/src/input/input.c
--- vlc-0.8.6i/src/input/input.c	2009-02-18 15:15:13.000000000 +0000
+++ vlc-0.8.6i-haiku/src/input/input.c	2009-02-21 18:02:02.000000000 +0000
@@ -1886,7 +1886,7 @@
 {
     vlc_meta_t *p_meta = p_input->p_meta;
     int i;
-
+    char *psz_cat;
     if( !p_meta || p_meta->i_meta == 0 )
         return VLC_SUCCESS;
 
@@ -1917,7 +1917,6 @@
         if( tk->i_meta > 0 )
         {
             msg_Dbg( p_input, "  - track[%d]:", i );
-            char *psz_cat;
             if( asprintf( &psz_cat, "%s %d", _("Stream"), i ) != -1 )
             {
                 for( j = 0; j < tk->i_meta; j++ )
diff -urN vlc-0.8.6i/src/misc/threads.c vlc-0.8.6i-haiku/src/misc/threads.c
--- vlc-0.8.6i/src/misc/threads.c	2009-02-18 15:15:12.000000000 +0000
+++ vlc-0.8.6i-haiku/src/misc/threads.c	2009-02-21 23:12:06.000000000 +0000
@@ -542,6 +542,7 @@
          * function instead of CreateThread, otherwise you'll end up with
          * memory leaks and the signal functions not working (see Microsoft
          * Knowledge Base, article 104641) */
+
         p_this->thread_id =
 #if defined( UNDER_CE )
                 (HANDLE)CreateThread( NULL, 0, (PTHREAD_START) func,
@@ -636,7 +637,6 @@
                          psz_name, psz_file, i_line, strerror(i_ret) );
         vlc_mutex_unlock( &p_this->object_lock );
     }
-
     return i_ret;
 }
 
@@ -689,7 +689,6 @@
         }
     }
 #endif
-
     return 0;
 }
 
diff -urN vlc-0.8.6i/src/misc/vlm.c vlc-0.8.6i-haiku/src/misc/vlm.c
--- vlc-0.8.6i/src/misc/vlm.c	2009-02-18 15:15:12.000000000 +0000
+++ vlc-0.8.6i-haiku/src/misc/vlm.c	2009-02-21 18:53:35.000000000 +0000
@@ -1368,10 +1368,10 @@
 
 vlm_schedule_t *vlm_ScheduleNew( vlm_t *vlm, const char *psz_name )
 {
+    vlm_schedule_t *p_sched = malloc( sizeof( vlm_schedule_t ) );
     if( !psz_name )
         return NULL;
 
-    vlm_schedule_t *p_sched = malloc( sizeof( vlm_schedule_t ) );
     if( !p_sched )
         return NULL;
 
diff -urN vlc-0.8.6i/src/network/httpd.c vlc-0.8.6i-haiku/src/network/httpd.c
--- vlc-0.8.6i/src/network/httpd.c	2009-02-18 15:15:13.000000000 +0000
+++ vlc-0.8.6i-haiku/src/network/httpd.c	2009-02-21 18:25:54.000000000 +0000
@@ -60,6 +60,10 @@
 #define HTTPD_CL_BUFSIZE 10000
 #endif
 
+
+#include<sys/select.h>
+
+
 static void httpd_ClientClean( httpd_client_t *cl );
 
 struct httpd_url_t
@@ -368,6 +372,7 @@
     uint8_t **pp_body, *p_body;
     char *psz_connection = NULL;
     int *pi_body, i_body;
+    uint8_t *psz_args = query->psz_args;
 
     if( answer == NULL || query == NULL )
     {
@@ -402,7 +407,6 @@
         /* msg_Warn not supported */
     }
 
-    uint8_t *psz_args = query->psz_args;
     file->pf_fill( file->p_sys, file, psz_args, pp_body, pi_body );
 
     if( query->i_type == HTTPD_MSG_HEAD && p_body != NULL )
@@ -487,6 +491,7 @@
 {
     httpd_handler_t *handler = (httpd_handler_t*)p_sys;
     char psz_remote_addr[NI_MAXNUMERICHOST];
+    uint8_t *psz_args = query->psz_args;
 
     if( answer == NULL || query == NULL )
     {
@@ -502,7 +507,6 @@
     if( httpd_ClientIP( cl, psz_remote_addr ) == NULL )
         *psz_remote_addr = '\0';
 
-    uint8_t *psz_args = query->psz_args;
     handler->pf_fill( handler->p_sys, handler, query->psz_url, psz_args,
                       query->i_type, query->p_body, query->i_body,
                       psz_remote_addr, NULL,
