diff -ru libdvdnav-original/configure.ac libdvdnav/configure.ac
--- libdvdnav-original/configure.ac	Wed Jul 28 15:20:06 2004
+++ libdvdnav/configure.ac	Wed Jul 28 15:32:39 2004
@@ -8,7 +8,7 @@
 dnl --------------------------------------------------------------
 dnl Require autoconf version 2.53
 dnl --------------------------------------------------------------
-AC_PREREQ(2.53)
+AC_PREREQ(2.52)
 
 dnl --------------------------------------------------------------
 dnl Making releases: DVDNAV_SUB += 1; change LT_* accordingly
@@ -113,6 +113,8 @@
 fi
 AC_SUBST(STATIC)
 
+
+
 dnl --------------------------------------------------------------
 dnl Checks for header files.
 dnl --------------------------------------------------------------
@@ -139,7 +141,7 @@
     THREAD_CFLAGS="-I/usr/local/include -D_THREAD_SAFE"
     CFLAGS="$THREAD_CFLAGS $CFLAGS"
     ;;
-  *mingw32* | *cygwin*)
+  *mingw32* | *cygwin* | *beos*)
     ;;
   *)
     AC_CHECK_LIB(pthread, pthread_create,
@@ -150,26 +152,63 @@
 AC_SUBST(THREAD_LIBS)
 AC_SUBST(THREAD_CFLAGS)
 
+link_dvdcss=no
+dvdcss_path=""
 dnl ---------------------------------------------
-dnl dynamic linker
+dnl dvdcss checking
 dnl ---------------------------------------------
-case $host in
-  *mingw32*)
-    CFLAGS="-idirafter \$(top_srcdir)/msvc/include $CFLAGS"
-    LDFLAGS="-no-undefined $LDFLAGS"
-    ;;
-  *cygwin*)
-    LDFLAGS="-no-undefined $LDFLAGS"
-    ;;
-  *)
-    AC_CHECK_LIB(c, dlopen,
-	         DYNAMIC_LD_LIBS="",
-	         AC_CHECK_LIB(dl, dlopen,
-             	              DYNAMIC_LD_LIBS="-ldl",
-	                      AC_MSG_ERROR(dynamic linker needed)))
-    AC_SUBST(DYNAMIC_LD_LIBS)
-    ;;
-esac
+AC_ARG_WITH( [libdvdcss],
+    [ --with-libdvdcss[=PATH]    force linking against libdvdcss],
+    [if test x"$withval" != xno; then
+       link_dvdcss=yes
+     fi
+     if test x"$withval" != xyes; then
+       dvdcss_path=$withval
+     fi])
+
+if test x"$link_dvdcss" != xyes; then
+dnl dlopen libdvdcss
+  AC_CHECK_FUNC( dlopen,
+    [DL_LIBS="" ].
+    AC_CHECK_LIB( dl, dlopen,
+      [DL_LIBS=-ld ],
+      AC_MSG_ERROR(You need libdl (dlopen))
+    )
+  )
+else
+dnl link with libdvdcss
+  if test -z "$dvdcss_path"; then
+    AC_CHECK_LIB(dvdcss, dvdcss_interface_2,
+      [ CSS_LIBS=-ldvdcss ],
+      AC_MSG_ERROR(You need libdvdcss.so.2 or later)
+    )
+    AC_CHECK_HEADERS(dvdcss/dvdcss.h,
+      [ ],
+      AC_MSG_ERROR(You need libdvdcss (dvdcss.h))
+    )
+  else
+    saved_CFLAGS=$CFLAGS
+    CFLAGS="$CFLAGS -L$dvdcss_path/lib"
+    AC_CHECK_LIB(dvdcss, dvdcss_interface_2,
+      [ CSS_LIBS="-L$dvdcss_path/lib -R$dvdcss_path/lib -ldvdcss"
+        CSS_CFLAGS=-I$dvdcss_path/include ],
+      AC_MSG_ERROR(You need libdvdcss.so.2 or later)
+    )
+    CFLAGS=$saved_CFLAGS
+    dnl -w added to shutup GCC3.1's cpp warning about -I/usr/local
+    saved_CPPFLAGS=$CPPFLAGS
+    CPPFLAGS="-w $CPPFLAGS -I$dvdcss_path/include"
+    AC_CHECK_HEADERS(dvdcss/dvdcss.h,
+      [ ],
+      AC_MSG_ERROR(You need libdvdcss (dvdcss.h))
+    )
+    CPPFLAGS=$saved_CPPFLAGS
+  fi
+fi
+
+AC_SUBST(DL_LIBS)
+AC_SUBST(CSS_LIBS)
+AC_SUBST(CSS_CFLAGS)
 
 dnl ---------------------------------------------
 dnl cflags
diff -ru libdvdnav-original/examples/Makefile.am libdvdnav/examples/Makefile.am
--- libdvdnav-original/examples/Makefile.am	Wed Jul 28 15:20:07 2004
+++ libdvdnav/examples/Makefile.am	Wed Jul 28 15:32:26 2004
@@ -7,7 +7,7 @@
 noinst_PROGRAMS = menus
 
 menus_SOURCES = menus.c
-menus_LDFLAGS = -L$(top_srcdir)/src/
+menus_LDFLAGS = -L$(top_srcdir)/src/ $(CSS_LIBS)
 menus_LDADD   = $(DVDNAV_LIB)
 
 $(DVDNAV_LIB):
diff -ru libdvdnav-original/src/dvdnav_internal.h libdvdnav/src/dvdnav_internal.h
--- libdvdnav-original/src/dvdnav_internal.h	Wed Jul 28 15:20:08 2004
+++ libdvdnav/src/dvdnav_internal.h	Wed Jul 28 15:47:08 2004
@@ -58,6 +58,15 @@
 #include <io.h> /* read() */
 #define lseek64 _lseeki64
 
+#elif defined(__BEOS__)
+
+#include <OS.h>
+typedef sem_id pthread_mutex_t;
+#define pthread_mutex_init(a, b) (*a) = create_sem( 1,"" )
+#define pthread_mutex_lock(a)    acquire_sem( *a )
+#define pthread_mutex_unlock(a)  release_sem( *a )
+#define pthread_mutex_destroy(a) delete_sem( *a )
+
 #else
 
 #include <pthread.h>
diff -ru libdvdnav-original/src/dvdread/bswap.h libdvdnav/src/dvdread/bswap.h
--- libdvdnav-original/src/dvdread/bswap.h	Wed Jul 28 15:20:08 2004
+++ libdvdnav/src/dvdread/bswap.h	Wed Jul 28 15:41:25 2004
@@ -65,7 +65,7 @@
  * functionality! 
  */
 
-#elif defined(__FreeBSD__) || defined(__sun) || defined(__bsdi__) || defined(WIN32) || defined(__CYGWIN__)
+#elif defined(__FreeBSD__) || defined(__sun) || defined(__bsdi__) || defined(WIN32) || defined(__CYGWIN__) || defined(__BEOS__)
 #define B2N_16(x) \
  x = ((((x) & 0xff00) >> 8) | \
       (((x) & 0x00ff) << 8))
diff -ru libdvdnav-original/src/dvdread/dvd_reader.c libdvdnav/src/dvdread/dvd_reader.c
--- libdvdnav-original/src/dvdread/dvd_reader.c	Wed Jul 28 15:20:08 2004
+++ libdvdnav/src/dvdread/dvd_reader.c	Wed Jul 28 16:22:03 2004
@@ -398,8 +398,9 @@
 		return 0;
 	}
 
-#ifndef WIN32 /* don't have fchdir, and getcwd( NULL, ... ) is strange */
-              /* Also WIN32 does not have symlinks, so we don't need this bit of code. */
+#if !defined(WIN32) && !defined(__BEOS__)
+        /* don't have fchdir, and getcwd( NULL, ... ) is strange */
+        /* Also WIN32 does not have symlinks, so we don't need this bit of code. */
 
 	/* Resolve any symlinks and get the absolut dir name. */
 	{
