]> git.sesse.net Git - vlc/blobdiff - configure.in
* ./configure.in: fixed linking of the ipv4 plugin.
[vlc] / configure.in
index c32be2d967ecb3c0cc3dd3c12b30dedf828a8438..4b415eb8221739d0dc492eb0924c58b71237d5fd 100644 (file)
@@ -34,7 +34,7 @@ dnl Find the right ranlib, even when cross-compiling
 AC_CHECK_TOOL(RANLIB, ranlib, :)
 
 dnl Gettext stuff
-ALL_LINGUAS="de fr ru"
+ALL_LINGUAS="de fr no ru"
 
 AC_DEFINE_UNQUOTED(PACKAGE, "vlc")
 AC_DEFINE_UNQUOTED(VERSION, "$VLC_VERSION")
@@ -44,63 +44,42 @@ dnl AM_PROG_LIBTOOL
 AC_PROG_INSTALL
 
 dnl
-dnl  Endianness check, AC_C_BIGENDIAN doesn't work if we are cross-compiling
-dnl
-dnl  We give the user the opportunity to specify
-dnl  --with-words=big or --with-words=little ; otherwise, try to guess
+dnl  Check the operating system
 dnl
-AC_ARG_WITH(words,
-  [  --with-words=endianness Set endianness (big or little)])
-  case "x$withval" in
-    xbig)
-      ac_cv_c_bigendian=yes
-      ;;
-    xlittle)
-      ac_cv_c_bigendian=no
-      ;;
-    *)
-      dnl  Try to guess endianness by matching patterns on a compiled
-      dnl  binary, by looking for an ASCII or EBCDIC string
-      AC_CACHE_CHECK([whether the byte order is big-endian],
-        [ac_cv_c_bigendian],
-        [ac_cv_c_bigendian=unknown
-        [cat >conftest.c <<EOF
-        short am[] = { 0x4249, 0x4765, 0x6e44, 0x6961, 0x6e53, 0x7953, 0 };
-        short ai[] = { 0x694c, 0x5454, 0x656c, 0x6e45, 0x6944, 0x6e61, 0 };
-        void _a(void) { char*s = (char*)am; s = (char *)ai; }
-        short ei[] = { 0x89D3, 0xe3e3, 0x8593, 0x95c5, 0x89c4, 0x9581, 0 };
-        short em[] = { 0xc2c9, 0xc785, 0x95c4, 0x8981, 0x95e2, 0xa8e2, 0 };
-        void _e(void) { char*s = (char*)em; s = (char*)ei; }
-        int main(void) { _a(); _e(); return 0; }
-EOF
-        ]
-        if test -f conftest.c
-        then 
-          if ${CC-cc} conftest.c -o conftest.o >config.log 2>&1 \
-              && test -f conftest.o
-          then
-            if test `grep -l BIGenDianSyS conftest.o`
-            then
-              ac_cv_c_bigendian=yes
-            fi
-            if test `grep -l LiTTleEnDian conftest.o`
-            then
-              ac_cv_c_bigendian=no
-            fi
-          fi
-        fi
-      ])
-      if test $ac_cv_c_bigendian = xunknown
-      then
-        AC_MSG_ERROR([Could not guess endianness, please use --with-words])
-      fi
-      ;;
-  esac
-dnl  Now we know what to use for endianness, just put it in the header
-if test $ac_cv_c_bigendian = yes
-then
-  AC_DEFINE(WORDS_BIGENDIAN, 1, big endian system)
-fi
+case x"${target_os}" in
+  x)
+    SYS=unknown
+    ;;
+  xlinux*)
+    SYS=linux
+    ;;
+  xbsdi*)
+    SYS=bsdi
+    ;;
+  xdarwin*)
+    SYS=darwin
+    ;;
+  x*mingw32*)
+    SYS=mingw32
+    AC_CHECK_TOOL(WINDRES, windres, :)
+    LIB_IPV4="${LIB_IPV4} -lws2_32"
+    LIB_RC="${LIB_RC} -lws2_32"
+    ;;
+  x*nto*)
+    SYS=nto
+    LIB_X11="${LIB_X11} -lsocket"
+    LIB_XVIDEO="${LIB_XVIDEO} -lsocket"
+    ;;
+  xbeos)
+    SYS=beos
+    LIB="${LIB} -lbe -lbind"
+    LIB_BEOS="${LIB_BEOS} -lbe -lgame -lroot -ltracker"
+    PLDFLAGS="${PLDFLAGS} -nostart"
+    ;;
+  x*)
+    SYS=${target_os}
+    ;;
+esac
 
 dnl Check for system libs needed
 AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol isatty)
@@ -124,6 +103,7 @@ AC_CHECK_FUNCS(swab)
 AC_CHECK_FUNCS([memalign valloc])
 
 AC_CHECK_FUNCS(sigrelse)
+AC_CHECK_FUNCS(getpwuid_r getpwuid)
 
 dnl Check for getopt
 NEED_GETOPT=0
@@ -174,16 +154,35 @@ AC_EGREP_HEADER(strncasecmp,strings.h,[
 dnl Check for headers
 AC_CHECK_HEADERS(getopt.h strings.h)
 AC_CHECK_HEADERS(sys/sockio.h fcntl.h sys/time.h sys/times.h)
-AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h)
 AC_CHECK_HEADERS(dlfcn.h image.h)
 AC_CHECK_HEADERS(arpa/inet.h net/if.h netinet/in.h sys/socket.h)
-AC_CHECK_HEADERS(machine/param.h)
+AC_CHECK_HEADERS(machine/param.h sys/shm.h)
 
 AC_HEADER_TIME
 
 dnl Check for threads library
 AC_CHECK_HEADERS(cthreads.h pthread.h kernel/scheduler.h kernel/OS.h)
 
+dnl Check for DPMS
+if test x$SYS != xmingw32
+then
+  if test x$x_includes = xNONE; then
+    x_includes=/usr/X11R6/include
+  fi
+  if test x$x_libraries = xNONE; then
+    x_libraries=/usr/X11R6/lib
+  fi
+  saved_CPPFLAGS=$CPPFLAGS
+  CPPFLAGS="$CPPFLAGS -I$x_includes"
+  AC_CHECK_HEADERS(X11/extensions/dpms.h, [
+    AC_EGREP_HEADER(DPMSInfo,X11/extensions/dpms.h,[
+      AC_DEFINE(DPMSINFO_IN_DPMS_H, 1,
+                Define if <X11/extensions/dpms.h> defines DPMSInfo.)
+    ])
+  ])
+  CPPFLAGS=$saved_CPPFLAGS
+fi
+
 dnl Check for ntohl, etc.
 AC_CACHE_CHECK([for ntohl in sys/param.h],
     [ac_cv_c_ntohl_sys_param_h],
@@ -386,8 +385,8 @@ esac
 dnl
 dnl  default modules
 dnl
-BUILTINS="${BUILTINS} mpeg_es mpeg_ps mpeg_ts memcpy idct idctclassic motion imdct downmix chroma_i420_rgb chroma_i420_yuy2 chroma_i422_yuy2 chroma_i420_ymga mpeg_adec ac3_adec mpeg_vdec"
-PLUGINS="${PLUGINS} lpcm_adec ac3_spdif spudec filter_deinterlace filter_invert filter_wall filter_transform filter_distort"
+BUILTINS="${BUILTINS} idct idctclassic motion imdct downmix chroma_i420_rgb chroma_i420_yuy2 chroma_i422_yuy2 chroma_i420_ymga mpeg_adec ac3_adec mpeg_vdec"
+PLUGINS="${PLUGINS} dummy null rc logger mpeg_es mpeg_ps mpeg_ts file udp http ipv4 memcpy lpcm_adec ac3_spdif spudec filter_deinterlace filter_invert filter_wall filter_transform filter_distort fx_scope"
 
 dnl
 dnl  Accelerated modules
@@ -432,6 +431,9 @@ if test x"$ac_cv_sse_inline" != x"no"; then
   ACCEL_MODULES="${ACCEL_MODULES} ${SSE_MODULES}"
 fi
 
+# don't try to grok altivec with native mingw32 it doesn't work right now
+# we should be able to remove this test with future versions of mingw32
+if test x$SYS != xmingw32; then
 AC_CACHE_CHECK([if \$CC groks Altivec inline assembly],
     [ac_cv_altivec_inline],
     [AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
@@ -487,50 +489,13 @@ if test x"$ac_cv_ld_altivec" != x"no"; then
   LIB_MOTIONALTIVEC="${LIB_MOTIONALTIVEC} -framework vecLib"
   LIB="${LIB} -framework vecLib"
 fi
-
-dnl
-dnl  Check the operating system
-dnl
-case x"${target_os}" in
-  x)
-    SYS=unknown
-    ;;
-  xlinux*)
-    SYS=linux
-    ;;
-  xbsdi*)
-    SYS=bsdi
-    ;;
-  xdarwin*)
-    SYS=darwin
-    ;;
-  x*mingw32*)
-    SYS=mingw32
-    AC_CHECK_TOOL(WINDRES, windres, :)
-    LIB_MPEG_TS="${LIB_MPEG_TS} -lws2_32"
-    LIB_RC="${LIB_RC} -lws2_32"
-    ;;
-  x*nto*)
-    SYS=nto
-    LIB_X11="${LIB_X11} -lsocket"
-    LIB_XVIDEO="${LIB_XVIDEO} -lsocket"
-    ;;
-  xbeos)
-    SYS=beos
-    LIB="${LIB} -lbe"
-    LIB_BEOS="${LIB_BEOS} -lbe -lgame -lroot -ltracker"
-    PLDFLAGS="${PLDFLAGS} -nostart"
-    ;;
-  x*)
-    SYS=${target_os}
-    ;;
-esac
+fi # end if mingw32
 
 dnl
 dnl  DVD and VCD devices
 dnl
-case $SYS in
-  mingw32)
+case x$SYS in
+  xmingw32)
     DVD_DEVICE="E:"
     VCD_DEVICE="E:"
     ;;
@@ -644,11 +609,14 @@ AC_CHECK_HEADERS(sys/ioctl.h,[
   fi
 ])
 
+AC_ARG_WITH(,[])
+AC_ARG_WITH(,[Optimization options:])
+
 dnl
 dnl  Special arch tuning
 dnl
 AC_ARG_WITH(tuning,
-[  --with-tuning=[arch]    Enable special tuning for an architecture
+[  --with-tuning=ARCH      enable special tuning for an architecture
                           (default i686 on IA-32 and 750 on PPC)])
 if test "x$withval" != "x"; then
     TUNING=$withval
@@ -659,15 +627,6 @@ else
     fi
 fi
 
-dnl
-dnl  Enable release-specific flags
-dnl
-AC_ARG_ENABLE(release,
-[  --enable-release        Activate extra optimizations (default disabled)],
-[ if test x$enableval = xyes; then RELEASE=1; fi ],
-[ VLC_VERSION="${VLC_VERSION}_`date +%Y-%m-%d`";
-  LIBDVDCSS_VERSION="${LIBDVDCSS_VERSION}_`date +%Y-%m-%d`"; ])
-
 dnl
 dnl  x86 accelerations
 dnl
@@ -677,11 +636,19 @@ then
     BUILTINS="${BUILTINS} ${ACCEL_MODULES}"
 fi
 
+dnl
+dnl  Enable/disable optimizations
+dnl
+AC_ARG_ENABLE(optimizations,
+[  --disable-optimizations disable compiler optimizations (default enabled)],
+[ if test x$enableval = xno; then OPTIMS=0; fi ],
+[ OPTIMS=1 ])
+
 dnl
 dnl  AltiVec acceleration
 dnl
 AC_ARG_ENABLE(altivec,
-[  --disable-altivec       Disable altivec optimizations (default enabled on PPC)],
+[  --disable-altivec       disable altivec optimizations (default enabled on PPC)],
 [ if test x$enableval = xyes; then ARCH="${ARCH} altivec";
     BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ],
 [ if test x${target_cpu} = xpowerpc; then ARCH="${ARCH} altivec";
@@ -692,58 +659,23 @@ dnl  Debugging mode
 dnl
 DEBUG=0
 AC_ARG_ENABLE(debug,
-[  --enable-debug          Enable debug mode (default disabled)],
+[  --enable-debug          debug mode (default disabled)],
 [ if test x$enableval = xyes; then DEBUG=1; fi ])
 
 dnl
-dnl  Trace mode
-dnl
-TRACE=0
-AC_ARG_ENABLE(trace,
-[  --enable-trace          Enable trace mode (default disabled)],
-[ if test x$enableval = xyes; then TRACE=1; fi ])
-
-dnl
-dnl  Profiling
-dnl
-GPROF=0
-AC_ARG_ENABLE(gprof,
-[  --enable-gprof          Enable gprof profiling (default disabled)],
-[ if test x$enableval = xyes; then GPROF=1; fi ])
-
-CPROF=0
-AC_ARG_ENABLE(cprof,
-[  --enable-cprof          Enable cprof profiling (default disabled)],
-[ if test x$enableval = xyes;
-  then
-    LIB="${LIB} -lcprof"
-    CPROF=1
-  fi
-])
-
-dnl
-dnl  Enable/disable optimizations
+dnl  Enable release-specific flags
 dnl
-AC_ARG_ENABLE(optimizations,
-[  --disable-optimizations Disable compiler optimizations (default enabled)],
-[ if test x$enableval = xno; then OPTIMS=0; fi ],
-[ OPTIMS=1 ])
+AC_ARG_ENABLE(release,
+[  --enable-release        activate extra optimizations (default disabled)],
+[ if test x$enableval = xyes; then RELEASE=1; fi ],
+[ VLC_VERSION="${VLC_VERSION}_`date +%Y-%m-%d`";
+  LIBDVDCSS_VERSION="${LIBDVDCSS_VERSION}_`date +%Y-%m-%d`"; ])
 
 dnl
-dnl  GNU portable threads
+dnl  Input plugins
 dnl
-AC_ARG_ENABLE(pth,
-  [  --enable-pth            Enable GNU Pth support (default disabled)],
-  [ if test x$enableval = xyes; then
-    AC_CHECK_LIB(pth,pth_init)
-    AC_EGREP_HEADER(pth_init,pth.h,[
-      AC_DEFINE(PTH_INIT_IN_PTH_H, 1,
-                Define if <pth.h> defines pth_init)
-    THREAD_LIB="-lpth"
-    fi])
-])
 
-LIB="${LIB} ${THREAD_LIB}"
+AC_ARG_WITH(,[Input plugins:])
 
 dnl
 dnl  DVD module: check for installed libdvdcss or local libdvdcss
@@ -752,98 +684,124 @@ NEED_LIBDVDCSS=0
 STATIC_LIBDVDCSS=0
 DUMMY_LIBDVDCSS=0
 AC_ARG_WITH(dvdcss,
-  [  --with-dvdcss[=name]    way to use libdvdcss, either 'yes' or 'no',
-                          or 'local-static', 'local-shared', or a path to
-                          another libdvdcss such as '/usr/local'
-                          (default 'local-static')],
+  [  --with-dvdcss[=name]    use libdvdcss, either 'yes', 'no', 'local-static',
+                          'local-shared', or a path to another libdvdcss such
+                          as '/usr/local' (default 'local-static')],
   [ case "x${withval}" in
     xlocal-static|xyes)
       # local libdvdcss, statically linked
+      BUILTINS="${BUILTINS} dvd"
       if test x${CAN_BUILD_LIBDVDCSS} = x1
       then
         NEED_LIBDVDCSS=1
         STATIC_LIBDVDCSS=1
-        BUILTINS="${BUILTINS} dvd"
         CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
         LIB_DVD="${LIB_DVD} lib/libdvdcss.a ${LIB_LIBDVDCSS}"
-        LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} ../../lib/libdvdcss.a ${LIB_LIBDVDCSS}"
-        LIB_DVDREAD="${LIB_DVDREAD} lib/libdvdread.a lib/libdvdcss.a ${LIB_LIBDVDCSS}"
-        LIB_DVDREAD_PLUGIN="${LIB_DVDREAD_PLUGIN} ../../lib/libdvdcss.a ${LIB_LIBDVDCSS}"
       fi
     ;;
     xlocal-shared)
       # local libdvdcss, dynamically linked
+      PLUGINS="${PLUGINS} dvd"
       if test x${CAN_BUILD_LIBDVDCSS} = x1
       then
         NEED_LIBDVDCSS=1
-        BUILTINS="${BUILTINS} dvd"
         CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
-        LIB_DVD="${LIB_DVD} -Llib -ldvdcss"
-        LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} -L../../lib -ldvdcss"
-        LIB_DVDREAD="${LIB_DVD} -Llib -ldvdread -ldvdcss"
-        LIB_DVDREAD_PLUGIN="${LIB_DVDREAD_PLUGIN} -L../../lib -ldvdcss"
+        LIB_DVD="${LIB_DVD} -L../../lib -ldvdcss"
       fi
     ;;
     xno)
       # don't use libdvdcss at all, build a DVD module that can dlopen() it
+      PLUGINS="${PLUGINS} dvd"
       DUMMY_LIBDVDCSS=1
-      BUILTINS="${BUILTINS} dvd"
       SRC_DVD_EXTRA="${SRC_DVD_EXTRA} dummy_dvdcss.c"
       CFLAGS_DVD="${CFLAGS_DVD} -DGOD_DAMN_DMCA"
       CFLAGS_DVD="${CFLAGS_DVD} -DLIBDVDCSS_VERSION=\"${LIBDVDCSS_VERSION}\""
       LIB_DVD="${LIB_DVD} -ldl"
-      LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} -ldl"
-      LIB_DVDREAD="${LIB_DVDREAD} lib/libdvdread.a -ldl"
-      LIB_DVDREAD_PLUGIN="${LIB_DVDREAD_PLUGIN} -ldl"
     ;;
     *)
       # existing libdvdcss
-      BUILTINS="${BUILTINS} dvd"
+      PLUGINS="${PLUGINS} dvd"
       if test "x$withval" != "xyes"
       then
-        LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} -L"$withval"/lib"
-        LIB_DVDREAD_PLUGIN="${LIB_DVDREAD_PLUGIN} -L"$withval"/lib"
+        LIB_DVD="${LIB_DVD} -L"$withval"/lib"
         CFLAGS_DVD="${CFLAGS_DVD} -I"$withval"/include"
       fi
       LIB_DVD="${LIB_DVD} -ldvdcss"
-      LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} -ldvdcss"
-      LIB_DVDREAD="${LIB_DVDREAD} -ldvdread -ldvdcss"
-      LIB_DVDREAD_PLUGIN="${LIB_DVDREAD_PLUGIN} -ldvdread -ldvdcss"
     esac ],
   # user didn't decide, we choose to use local libdvdcss and link statically
   # if libdvdcss is in the archive, or to use the dummy replacement otherwise.
   [ if test x${CAN_BUILD_LIBDVDCSS} = x1
     then
+      BUILTINS="${BUILTINS} dvd"
       NEED_LIBDVDCSS=1
       STATIC_LIBDVDCSS=1
-      BUILTINS="${BUILTINS} dvd"
       CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
       LIB_DVD="${LIB_DVD} lib/libdvdcss.a ${LIB_LIBDVDCSS}"
-      LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} ../../lib/libdvdcss.a ${LIB_LIBDVDCSS}"
-      LIB_DVDREAD="${LIB_DVDREAD} lib/libdvdread.a lib/libdvdcss.a ${LIB_LIBDVDCSS}"
-      LIB_DVDREAD_PLUGIN="${LIB_DVDREAD_PLUGIN} ../../lib/libdvdread.a ../../lib/libdvdcss.a ${LIB_LIBDVDCSS}"
     else
       # XXX: no check for libdl is done, don't try this at home !
+      PLUGINS="${PLUGINS} dvd"
       DUMMY_LIBDVDCSS=1
-      BUILTINS="${BUILTINS} dvd"
       SRC_DVD_EXTRA="${SRC_DVD_EXTRA} dummy_dvdcss.c"
       CFLAGS_DVD="${CFLAGS_DVD} -DGOD_DAMN_DMCA"
       LIB_DVD="${LIB_DVD} -ldl"
-      LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} -ldl"
-      LIB_DVDREAD="${LIB_DVDREAD} lib/libdvdread.a -ldl"
-      LIB_DVDREAD_PLUGIN="${LIB_DVDREAD_PLUGIN} -ldl"
     fi ])
 
 dnl
 dnl DVDREAD module: check for libdvdread plugin
 dnl
-AC_ARG_ENABLE(dvdread,
-[  --enable-dvdread          Enable dvdread support (default disabled)],
-[ if test x$enableval = xyes
-  then
-    BUILTINS="${BUILTINS} dvdread" 
-    CFLAGS_DVDREAD="${CFLAGS_DVD} ${CFLAGS_DVDREAD} -I../../extras/libdvdread"
-  fi ])
+if test x${DUMMY_LIBDVDCSS} = x1; then STATIC_LIBDVDREAD=1; fi
+if test x${STATIC_LIBDVDCSS} = x1; then STATIC_LIBDVDREAD=1; fi
+AC_ARG_WITH(dvdread,
+  [  --with-dvdread[=name]   use libdvdread, same options as dvdcss (default 'no')],
+  [ case "x${withval}" in
+    xlocal-static|xyes)
+      if test x${STATIC_LIBDVDREAD} = x1
+      then
+        BUILTINS="${BUILTINS} dvdread" 
+        CFLAGS_DVDREAD="${CFLAGS_DVDREAD} ${CFLAGS_DVD} -I../../extras/libdvdread"
+        LIB_DVDREAD="${LIB_DVDREAD} lib/libdvdread.a ${LIB_DVD}"
+      else
+        AC_MSG_ERROR([Can't link static dvdread with shared dvdcss])
+      fi
+    ;;
+    xno)
+    ;;
+    x)
+      if test x${STATIC_LIBDVDREAD} = x1
+      then
+        #BUILTINS="${BUILTINS} dvdread" 
+        CFLAGS_DVDREAD="${CFLAGS_DVDREAD} ${CFLAGS_DVD} -I../../extras/libdvdread"
+        LIB_DVDREAD="${LIB_DVDREAD} lib/libdvdread.a ${LIB_DVD}"
+      else
+        #PLUGINS="${PLUGINS} dvdread"
+        CFLAGS_DVDREAD="${CFLAGS_DVDREAD} -I../../extras/libdvdread  ${CFLAGS_DVD}"
+        LIB_DVDREAD="${LIB_DVDREAD} -Llib -ldvdread ${LIB_DVD}"
+      fi 
+    ;;
+    *)
+      if test "x$withval" != "xlocal-shared"
+      then
+        LIB_DVDREAD="${LIB_DVDREAD} -L"$withval"/lib"
+        CFLAGS_DVDREAD="${CFLAGS_DVDREAD} -I"$withval"/include"
+      else
+        LIB_DVDREAD="${LIB_DVDREAD} -L../../lib"
+        CFLAGS_DVDREAD="${CFLAGS_DVDREAD} -I../../extras/libdvdread"
+      fi
+      if test x${STATIC_LIBDVDCSS} = x1
+      then
+        AC_MSG_ERROR([Can't link shared dvdread with static dvdcss])
+      else
+        #PLUGINS="${PLUGINS} dvdread"
+        CFLAGS_DVDREAD="${CFLAGS_DVDREAD} ${CFLAGS_DVD}"
+        LIB_DVDREAD="${LIB_DVDREAD} -ldvdread ${LIB_DVD}"
+      fi
+    esac
+    if test x${DUMMY_LIBDVDCSS} = x1
+    then
+      LIB_LIBDVDREAD="${LIB_LIBDVDREAD} -ldl"
+    else
+      LIB_LIBDVDREAD="${LIB_LIBDVDREAD} -L../../lib -ldvdcss"
+    fi ])
 
 dnl
 dnl  VCD module
@@ -854,200 +812,148 @@ AC_ARG_ENABLE(vcd,
 if test x$enable_vcd != xno
 then
   AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
-    BUILTINS="${BUILTINS} vcd"
+    PLUGINS="${PLUGINS} vcd"
   ])
-fi
-
-if test x$enable_vcd != xno -a "${SYS}" = "bsdi"
-then
-  BUILTINS="${BUILTINS} vcd"
-fi
 
-dnl
-dnl  dummy plugin
-dnl
-AC_ARG_ENABLE(dummy,
-  [  --disable-dummy         dummy module (default enabled)])
+  if test "x${SYS}" = "xbsdi"
+  then
+    PLUGINS="${PLUGINS} vcd"
+  fi
 
-if test x$enable_dummy != xno
-then
-  BUILTINS="${BUILTINS} dummy"
+  if test "x${SYS}" = "xdarwin"
+  then
+    PLUGINS="${PLUGINS} vcd"
+    LIB_VCD="${LIB_VCD} -framework IOKit" 
+  fi
 fi
 
 dnl
-dnl  null plugin
+dnl  ipv6 plugin
 dnl
-AC_ARG_ENABLE(null,
-  [  --disable-null          Null module (default enabled)])
-
-if test x$enable_null != xno
-then
-  BUILTINS="${BUILTINS} null"
-fi
+AC_EGREP_HEADER(in6_addr,netinet/in.h,[
+  PLUGINS="${PLUGINS} ipv6"])
 
 dnl
-dnl  rc plugin
+dnl  Codec plugins
 dnl
-AC_ARG_ENABLE(rc,
-  [  --disable-rc            Remote Control module (default enabled)])
 
-if test x$enable_rc != xno
-then
-  BUILTINS="${BUILTINS} rc"
-fi
+AC_ARG_WITH(,[Codec plugins:])
 
 dnl
 dnl  mad plugin
 dnl
-AC_ARG_WITH(mad,
-  [  --with-mad[=PATH]       libmad module (default disabled)],
-  [ if test "x$with_val" != "xno"; then
-      if test -n $with_val; then
+AC_ARG_ENABLE(mad,
+  [  --enable-mad            libmad module (default disabled)])
+if test x$enable_mad == xyes
+then
+  PLUGINS="${PLUGINS} mad"
+  LIB_MAD="${LIB_MAD} -lmad"
+  AC_ARG_WITH(mad,
+    [    --with-mad=PATH       path to libmad],
+    [ if test "x$with_val" != "xno" -a "x$with_val" != "x"
+      then
         CFLAGS_MAD="${CFLAGS_MAD} -I$with_val/include"
-        LIB_MAD="${LIB_MAD} -L$with_val/lib -lmad"
-      else
-        LIB_MAD="${LIB_MAD} -lmad"
-      fi
-      save_CFLAGS=$CFLAGS
-      save_LDFLAGS=$LDFLAGS
-      CFLAGS="$CFLAGS $CFLAGS_MAD"
-      LDFLAGS="$LDFLAGS $LIB_MAD"
-      AC_CHECK_HEADERS(mad.h, ,
-      [ echo "Cannot find development headers for libmad..."
-        exit 1
-      ])
-      AC_CHECK_LIB(mad, mad_bit_init, ,
-      [ echo "Cannot find libmad library..."
-        exit 1
-      ])
-      CFLAGS=$save_CFLAGS
-      LDFLAGS=$save_LDFLAGS
-      PLUGINS="${PLUGINS} mad"
-    fi ])
+        LIB_MAD="${LIB_MAD} -L$with_val/lib"
+      fi ])
+  save_CFLAGS=$CFLAGS
+  save_LDFLAGS=$LDFLAGS
+  CFLAGS="$CFLAGS $CFLAGS_MAD"
+  LDFLAGS="$LDFLAGS $LIB_MAD"
+  AC_CHECK_HEADERS(mad.h, ,
+  [ echo "Cannot find development headers for libmad..."
+    exit 1
+  ])
+  AC_CHECK_LIB(mad, mad_bit_init, ,
+  [ echo "Cannot find libmad library..."
+    exit 1
+  ])
+  CFLAGS=$save_CFLAGS
+  LDFLAGS=$save_LDFLAGS
+fi
 
 dnl special case for BeOS
 if test x$SYS = xbeos
 then
-    BUILTINS="${BUILTINS} beos"
+    PLUGINS="${PLUGINS} beos"
 
 dnl default case
 else
 
 dnl
-dnl  OSS /dev/dsp module
-dnl  (enabled by default except on win32)
+dnl  a52 AC3 decoder plugin
 dnl
-AC_ARG_ENABLE(dsp,
-  [  --disable-dsp           Linux /dev/dsp support (default enabled)])
-
-if test x$enable_dsp != xno &&
-  (test $SYS != mingw32 || test x$enable_dsp = xyes)
-then
-  if test -c /dev/dsp
+AC_ARG_ENABLE(a52,
+  [  --disable-a52           AC3 support with liba52 (default enabled)])
+if test "x$enableval" != "xno" -a x$SYS != xmingw32
   then
-    PLUGINS="${PLUGINS} dsp"
-  fi
+    AC_CHECK_HEADERS(a52dec/a52.h, [
+      BUILTINS="${BUILTINS} a52"
+      LIB_A52="${LIB_A52} -la52"
+     ],[])
 fi
 
 dnl
-dnl  Esound module
+dnl  Video plugins
 dnl
-AC_ARG_ENABLE(esd,
-  [  --enable-esd            Esound library support (default disabled)],
-  [if test x$enable_esd = xyes
-   then
-     AC_PATH_PROG(ESD_CONFIG, esd-config, no)
-     if test x${ESD_CONFIG} != xno
-     then
-       PLUGINS="${PLUGINS} esd"
-       CFLAGS_ESD="${CFLAGS_ESD} `${ESD_CONFIG} --cflags`"
-       LIB_ESD="${LIB_ESD} `${ESD_CONFIG} --libs`"
-     fi
-   fi])
-
-dnl
-dnl  aRts module
-dnl
-AC_ARG_ENABLE(arts,
-  [  --enable-arts           aRts sound server (default disabled)],
-  [if test x$enable_arts = xyes
-   then
-     AC_PATH_PROG(ARTS_CONFIG, artsc-config, no)
-     if test x${ARTS_CONFIG} != xno
-     then
-       PLUGINS="${PLUGINS} arts"
-       CFLAGS_ARTS="${CFLAGS_ARTS} `${ARTS_CONFIG} --cflags`"
-       LIB_ARTS="${LIB_ARTS} `${ARTS_CONFIG} --libs `"
-     fi
-   fi])
-
-dnl
-dnl  MacOS X module
-dnl
-AC_ARG_ENABLE(macosx,
-  [  --enable-macosx         MacOS X support (default enabled on MacOS X)],
-  [if test x$enable_macosx = xyes
-   then
-     BUILTINS="${BUILTINS} macosx"
-     LIB_MACOSX="${LIB_MACOSX} -framework CoreAudio -framework Cocoa -framework AGL -framework QuickTime -lobjc"
-     CFLAGS_MACOSX="${CFLAGS_MACOSX} -ObjC"
-     LIB="${LIB} -ObjC"
-   fi],
-  [AC_CHECK_HEADERS(Cocoa/Cocoa.h,
-     BUILTINS="${BUILTINS} macosx"
-     LIB_MACOSX="${LIB_MACOSX} -framework CoreAudio -framework Cocoa -framework AGL -framework QuickTime -lobjc"
-     CFLAGS_MACOSX="${CFLAGS_MACOSX} -ObjC"
-     LIB="${LIB} -ObjC"
-   )])
-
-dnl
-dnl  QNX RTOS module
-dnl
-AC_ARG_ENABLE(qnx,
-  [  --disable-qnx           QNX RTOS support (default enabled on QNX RTOS)])
-    if test x$enable_qnx != xno
-    then
-      AC_CHECK_HEADERS(Ph.h, [
-        PLUGINS="${PLUGINS} qnx"
-        LIB_QNX="${LIB_QNX} -lasound -lph"
-      ])
-    fi
 
-dnl
-dnl  Linux framebuffer module
-dnl
-AC_ARG_ENABLE(fb,
-  [  --enable-fb             Linux framebuffer support (default disabled)],
-  [ if test x$enable_fb = xyes
-    then
-      PLUGINS="${PLUGINS} fb"
-    fi ])
+AC_ARG_WITH(,[Video plugins:])
 
 dnl
-dnl  Linux MGA module
+dnl  X11 module
+dnl  (enabled by default except on win32)
 dnl
-AC_ARG_ENABLE(mga,
-  [  --enable-mga            Linux kernel Matrox support (default disabled)],
-  [ if test x$enable_mga = xyes
-    then
-      PLUGINS="${PLUGINS} mga xmga"
-    fi ])
+AC_ARG_ENABLE(x11,
+  [  --disable-x11           X11 support (default enabled)])
+if test x$enable_x11 != xno &&
+  (test x$SYS != xmingw32 || test x$enable_x11 = xyes); then
+  if test x$x_includes = xNONE; then
+    x_includes=/usr/X11R6/include
+  fi
+  if test x$x_libraries = xNONE; then
+    x_libraries=/usr/X11R6/lib
+  fi
+  saved_CPPFLAGS=$CPPFLAGS
+  CPPFLAGS="$CPPFLAGS -I$x_includes"
+  AC_CHECK_HEADERS(X11/Xlib.h, [
+    PLUGINS="${PLUGINS} x11"
+    LIB_X11="${LIB_X11} -L$x_libraries -lX11 -lXext"
+    CFLAGS_X11="${CFLAGS_X11} -I$x_includes"
+  ])
+  CPPFLAGS=$saved_CPPFLAGS
+fi
 
 dnl
-dnl  GGI module
+dnl  XVideo module
+dnl  (enabled by default except on win32)
 dnl
-AC_ARG_WITH(ggi,
-  [  --with-ggi[=name]       GGI support (default disabled)],
-  [ if test "x$withval" != "xno"
-    then
-      PLUGINS="${PLUGINS} ggi"
-      if test "x$withval" != "xyes"
-      then
-        LIB_GGI="${LIB_GGI} -l$withval"
-      else
-        LIB_GGI="${LIB_GGI} -lggi"
-      fi
-    fi ])
+AC_ARG_ENABLE(xvideo,
+  [  --disable-xvideo        XVideo support (default enabled)])
+if test x$enable_xvideo != xno &&
+  (test x$SYS != xmingw32 || test x$enable_xvideo = xyes); then
+  if test x$x_includes = xNONE; then
+    x_includes=/usr/X11R6/include
+  fi
+  if test x$x_libraries = xNONE; then
+    x_libraries=/usr/X11R6/lib
+  fi
+  saved_CPPFLAGS=$CPPFLAGS
+  CPPFLAGS="$CPPFLAGS -I$x_includes"
+  AC_CHECK_HEADERS(X11/extensions/Xv.h, [
+    saved_CFLAGS=$CFLAGS
+    CFLAGS="$CFLAGS -L$x_libraries -lX11 -lXext"
+    AC_CHECK_LIB(Xv_pic,XvSetPortAttribute,
+      # We have Xv_pic, that's good, we can build an xvideo.so plugin !
+      PLUGINS="${PLUGINS} xvideo"
+      LIB_XVIDEO="${LIB_XVIDEO} -L$x_libraries -lX11 -lXext -lXv_pic"
+      CFLAGS_XVIDEO="${CFLAGS_XVIDEO} -I$x_includes",
+      # We don't have Xv_pic, let's make xvideo.a as builtin
+      BUILTINS="${BUILTINS} xvideo"
+      LIB_XVIDEO="${LIB_XVIDEO} -L$x_libraries -lX11 -lXext -lXv"
+      CFLAGS_XVIDEO="${CFLAGS_XVIDEO} -I$x_includes")
+    CFLAGS=$saved_CFLAGS
+  ]
+  CPPFLAGS=$saved_CPPFLAGS)
+fi
 
 dnl
 dnl  SDL module
@@ -1058,7 +964,7 @@ if test "x$enable_sdl" != "xno"
 then
   SDL_PATH=$PATH
   AC_ARG_WITH(sdl-config-path,
-    [  --with-sdl-config-path=path sdl-config path (default search in \$PATH)],
+    [    --with-sdl-config-path=PATH sdl-config path (default search in \$PATH)],
     [ if test "x$withval" != "xno"
       then
         SDL_PATH=$withval:$PATH
@@ -1109,71 +1015,251 @@ dnl
 dnl  Windows DirectX module
 dnl
 AC_ARG_ENABLE(directx,
-  [  --disable-directx       Windows DirectX support (default enabled on WIN32)])
+  [  --enable-directx        Win32 DirectX support (default enabled on Win32)])
 if test "x$enableval" != "xno"
 then
-  if test $SYS = mingw32
+  if test x$SYS = xmingw32
   then
-    AC_ARG_WITH(directx-path
-    [  --with-directx-path=path Windows DirectX headers and libraries])
-    if test "x$with_directx_path" = "x"
+    AC_ARG_WITH(directx, 
+    [    --with-directx=PATH   Win32 DirectX headers and libraries])
+    if test "x$with_directx" = "x"
     then
-      AC_CHECK_HEADERS(directx.h,
+      AC_CHECK_HEADERS(ddraw.h,
       [ PLUGINS="${PLUGINS} directx"
         LIB_DIRECTX="${LIB_DIRECTX} -lgdi32" ])
     else
       AC_MSG_CHECKING(for directX headers in ${withval})
-      if test -f ${withval}/include/directx.h
+      if test -f ${withval}/ddraw.h
       then
         PLUGINS="${PLUGINS} directx"
         LIB_DIRECTX="${LIB_DIRECTX} -L${withval}/lib -lgdi32"
-        INCLUDE="${INCLUDE} -I${withval}/include"
+        INCLUDE="${INCLUDE} -I${withval}"
         AC_MSG_RESULT(yes)
       else
         AC_MSG_RESULT(no)
-        AC_MSG_ERROR([Cannot find ${withval}/include/directx.h!])
+        AC_MSG_ERROR([Cannot find ${withval}/ddraw.h!])
       fi
     fi
   fi
 fi
 
 dnl
-dnl  Windows MFC interface module
+dnl  Linux framebuffer module
 dnl
-AC_ARG_ENABLE(win32,
-  [  --enable-win32          Windows DirectX support (default disabled)],
-  [ if test "x$enableval" != "xno"
+AC_ARG_ENABLE(fb,
+  [  --enable-fb             Linux framebuffer support (default enabled on Linux)])
+    if test x$enable_fb != xno
     then
-      PLUGINS="${PLUGINS} win32"
+      AC_CHECK_HEADERS(linux/fb.h, [
+        PLUGINS="${PLUGINS} fb"
+      ])
+    fi
+
+dnl
+dnl  Linux MGA module
+dnl
+AC_ARG_ENABLE(mga,
+  [  --enable-mga            Linux kernel Matrox support (default disabled)],
+  [ if test x$enable_mga = xyes
+    then
+      PLUGINS="${PLUGINS} mga xmga"
     fi ])
 
+dnl
+dnl  GGI module
+dnl
+AC_ARG_ENABLE(ggi,
+  [  --enable-ggi            GGI support (default disabled)])
+if test x$enable_ggi == xyes
+then
+  PLUGINS="${PLUGINS} ggi"
+  LIB_GGI="${LIB_GGI} -lggi"
+  AC_ARG_WITH(ggi,
+    [    --with-ggi=PATH       path to libggi],
+    [ if test "x$with_val" != "xno" -a "x$with_val" != "x"
+      then
+        CFLAGS_GGI="${CFLAGS_GGI} -I$with_val/include"
+        LIB_GGI="${LIB_GGI} -L$with_val/lib"
+      fi ])
+fi
+
 dnl
 dnl  Glide module
 dnl
-AC_ARG_WITH(glide,
-  [  --with-glide[=name]     Glide (3dfx) support (default disabled)],
-  [ if test "x$withval" != "xno"
-    then
-      PLUGINS="${PLUGINS} glide"
-      if test "x$withval" != "xyes"
+AC_ARG_ENABLE(glide,
+  [  --enable-glide          Glide (3dfx) support (default disabled)])
+if test x$enable_glide == xyes
+then
+  PLUGINS="${PLUGINS} glide"
+  LIB_GLIDE="${LIB_GLIDE} -lglide2x -lm"
+  CFLAGS_GLIDE="${CFLAGS_GLIDE} -I/usr/include/glide"
+  AC_ARG_WITH(glide,
+    [    --with-glide=PATH     path to libglide],
+    [ if test "x$with_val" != "xno" -a "x$with_val" != "x"
       then
-        LIB_GLIDE="${LIB_GLIDE} -l$withval -lm"
-      else
-        LIB_GLIDE="${LIB_GLIDE} -lglide2x -lm"
-      fi
-      CFLAGS_GLIDE="${CFLAGS_GLIDE} -I/usr/include/glide"
-    fi ])
+        CFLAGS_GLIDE="${CFLAGS_GLIDE} -I$with_val/include"
+        LIB_GLIDE="${LIB_GLIDE} -L$with_val/lib"
+      fi ])
+fi
 
 dnl
-dnl  ncurses module
+dnl  Audio plugins
 dnl
-AC_ARG_ENABLE(ncurses,
-  [  --enable-ncurses        ncurses interface support (default disabled)],
-  [if test x$enable_ncurses = xyes; then
-     PLUGINS="${PLUGINS} ncurses"
-     LIB_NCURSES="${LIB_NCURSES} -lncurses"
+
+AC_ARG_WITH(,[Audio plugins:])
+
+dnl
+dnl  OSS /dev/dsp module (enabled by default except on win32)
+dnl
+AC_ARG_ENABLE(dsp,
+  [  --enable-dsp            Linux /dev/dsp support (enabled on Linux)])
+
+if test x$enable_dsp != xno &&
+  (test x$SYS != xmingw32 || test x$enable_dsp = xyes)
+then
+  AC_CHECK_HEADERS(soundcard.h sys/soundcard.h machine/soundcard.h, [
+    PLUGINS="${PLUGINS} dsp"
+    AC_CHECK_LIB(ossaudio,main,LIB_DSP="${LIB_DSP} -lossaudio")
+  ])
+fi
+
+dnl
+dnl  Esound module
+dnl
+AC_ARG_ENABLE(esd,
+  [  --enable-esd            Esound library support (default disabled)],
+  [if test x$enable_esd = xyes
+   then
+     AC_PATH_PROG(ESD_CONFIG, esd-config, no)
+     if test x${ESD_CONFIG} != xno
+     then
+       PLUGINS="${PLUGINS} esd"
+       CFLAGS_ESD="${CFLAGS_ESD} `${ESD_CONFIG} --cflags`"
+       LIB_ESD="${LIB_ESD} `${ESD_CONFIG} --libs`"
+     fi
+   fi])
+
+dnl
+dnl  aRts module
+dnl
+AC_ARG_ENABLE(arts,
+  [  --enable-arts           aRts sound server (default disabled)],
+  [if test x$enable_arts = xyes
+   then
+     AC_PATH_PROG(ARTS_CONFIG, artsc-config, no)
+     if test x${ARTS_CONFIG} != xno
+     then
+       PLUGINS="${PLUGINS} arts"
+       CFLAGS_ARTS="${CFLAGS_ARTS} `${ARTS_CONFIG} --cflags`"
+       LIB_ARTS="${LIB_ARTS} `${ARTS_CONFIG} --libs `"
+     fi
    fi])
 
+dnl
+dnl  ALSA module
+dnl
+AC_ARG_ENABLE(alsa,
+  [  --enable-alsa           ALSA sound support for Linux (default disabled)],
+  [if test x$enable_alsa = xyes
+   then
+     AC_CHECK_HEADER(alsa/asoundlib.h, AC_CHECK_LIB(asound, main, have_alsa="true", have_alsa="false"),have_alsa="false")
+     if test x$have_alsa = xtrue
+     then
+       PLUGINS="${PLUGINS} alsa"
+       LIB_ALSA="${LIB_ALSA} -lasound -lm -ldl"
+     fi
+   fi])
+
+dnl
+dnl  win32 waveOut plugin
+dnl
+AC_ARG_ENABLE(waveout,
+  [  --enable-waveout        Win32 waveOut module (default enabled on Win32)])
+if test "x$enableval" != "xno" -a x$SYS = xmingw32
+  then
+    PLUGINS="${PLUGINS} waveout"
+    LIB_WAVEOUT="-lwinmm"
+fi
+
+dnl
+dnl  Interface plugins
+dnl
+
+AC_ARG_WITH(,[Interface plugins:])
+
+dnl
+dnl  Gtk+ module
+dnl
+AC_ARG_ENABLE(gtk,
+  [  --disable-gtk           Gtk+ support (default enabled)])
+if test x$enable_gtk != xno
+then
+  GTK_PATH=$PATH
+  AC_ARG_WITH(gtk-config-path,
+    [    --with-gtk-config-path=PATH gtk-config path (default search in \$PATH)],
+    [ if test "x$withval" != "xno"
+      then
+        GTK_PATH=$withval:$PATH
+      fi ])
+  # look for gtk-config
+  AC_PATH_PROG(GTK12_CONFIG, gtk12-config, no, $GTK_PATH)
+  GTK_CONFIG=${GTK12_CONFIG}
+  if test x${GTK_CONFIG} = xno
+  then
+    AC_PATH_PROG(GTK_CONFIG, gtk-config, no, $GTK_PATH)
+  fi
+  if test x${GTK_CONFIG} != xno
+  then
+    if expr 1.2.0 \> `$GTK_CONFIG --version` >/dev/null
+    then
+      AC_MSG_ERROR([Your development package for Gtk+ is too old, you need at least version 1.2.0. Please upgrade and try again. Alternatively you can also configure with --disable-gtk.])
+    fi
+    CFLAGS_GTK="${CFLAGS_GTK} `${GTK_CONFIG} --cflags gtk`"
+    LIB_GTK="${LIB_GTK} `${GTK_CONFIG} --libs gtk | sed 's,-rdynamic,,'`"
+    # now look for the gtk.h header
+    saved_CPPFLAGS=$CPPFLAGS
+    CPPFLAGS="$CPPFLAGS $CFLAGS_GTK"
+    ac_cv_gtk_headers=yes
+    AC_CHECK_HEADERS(gtk/gtk.h glib.h gdk/gdk.h, , [
+      ac_cv_gtk_headers=no
+      echo "Cannot find gtk development headers."
+    ])
+    if test "x$ac_cv_gtk_headers" = xyes
+    then
+      PLUGINS="${PLUGINS} gtk"
+      ALIASES="${ALIASES} gvlc"
+    fi
+    CPPFLAGS=$saved_CPPFLAGS
+  fi
+fi
+
+dnl
+dnl  Gnome module
+dnl
+AC_ARG_ENABLE(gnome,
+  [  --enable-gnome          Gnome interface support (default disabled)],
+  [if test x$enable_gnome = xyes; then
+    # look for gnome-config
+    AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
+    if test -x ${GNOME_CONFIG}
+    then
+       CFLAGS_GNOME="${CFLAGS_GNOME} `${GNOME_CONFIG} --cflags gtk gnomeui`"
+       LIB_GNOME="${LIB_GNOME} `${GNOME_CONFIG} --libs gnomeui | sed 's,-rdynamic,,'`"
+    fi
+    # now look for the gnome.h header
+    saved_CPPFLAGS=$CPPFLAGS
+    CPPFLAGS="$CPPFLAGS $CFLAGS_GNOME"
+    AC_CHECK_HEADERS(gnome.h, [
+      PLUGINS="${PLUGINS} gnome"
+      ALIASES="${ALIASES} gnome-vlc"
+     ],[
+      AC_MSG_ERROR([Can't find gnome headers. Please install the gnome
+developement librairie or remove the --enable-gnome option])
+     ])
+  
+    CPPFLAGS=$saved_CPPFLAGS
+  fi])
+
 dnl
 dnl  Qt module
 dnl
@@ -1212,171 +1298,206 @@ AC_ARG_ENABLE(kde,
    fi])
 
 dnl
-dnl  Gnome module
+dnl  MacOS X module
 dnl
-AC_ARG_ENABLE(gnome,
-  [  --enable-gnome          Gnome interface support (default disabled)],
-  [if test x$enable_gnome = xyes; then
-    # look for gnome-config
-    AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
-    if test -x ${GNOME_CONFIG}
+AC_ARG_ENABLE(macosx,
+  [  --enable-macosx         MacOS X support (default enabled on MacOS X)],
+  [if test x$enable_macosx = xyes
+   then
+     BUILTINS="${BUILTINS} macosx"
+     LIB_MACOSX="${LIB_MACOSX} -framework CoreAudio -framework Cocoa -framework AGL -framework QuickTime -lobjc"
+     CFLAGS_MACOSX="${CFLAGS_MACOSX} -ObjC"
+     LIB="${LIB} -ObjC"
+   fi],
+  [AC_CHECK_HEADERS(Cocoa/Cocoa.h,
+     BUILTINS="${BUILTINS} macosx"
+     LIB_MACOSX="${LIB_MACOSX} -framework CoreAudio -framework Cocoa -framework AGL -framework QuickTime -lobjc"
+     CFLAGS_MACOSX="${CFLAGS_MACOSX} -ObjC"
+     LIB="${LIB} -ObjC"
+   )])
+
+dnl
+dnl  QNX RTOS module
+dnl
+AC_ARG_ENABLE(qnx,
+  [  --enable-qnx            QNX RTOS support (default enabled on QNX RTOS)])
+    if test x$enable_qnx != xno
     then
-       CFLAGS_GNOME="${CFLAGS_GNOME} `${GNOME_CONFIG} --cflags gtk gnomeui`"
-       LIB_GNOME="${LIB_GNOME} `${GNOME_CONFIG} --libs gnomeui | sed 's,-rdynamic,,'`"
+      AC_CHECK_HEADERS(Ph.h, [
+        PLUGINS="${PLUGINS} qnx"
+        LIB_QNX="${LIB_QNX} -lasound -lph"
+      ])
     fi
-    # now look for the gnome.h header
-    saved_CPPFLAGS=$CPPFLAGS
-    CPPFLAGS="$CPPFLAGS $CFLAGS_GNOME"
-    AC_CHECK_HEADERS(gnome.h, [
-      PLUGINS="${PLUGINS} gnome"
-      ALIASES="${ALIASES} gnome-vlc"
-     ],[
-      AC_MSG_ERROR([Can't find gnome headers. Please install the gnome
-developement librairie or remove the --enable-gnome option])
-     ])
-  
-    CPPFLAGS=$saved_CPPFLAGS
-  fi])
 
 dnl
-dnl  Gtk+ module
+dnl  Windows MFC interface module
 dnl
-AC_ARG_ENABLE(gtk,
-  [  --disable-gtk           Gtk+ support (default enabled)])
-if test x$enable_gtk != xno
-then
-  GTK_PATH=$PATH
-  AC_ARG_WITH(gtk-config-path,
-    [  --with-gtk-config-path=path gtk-config path (default search in \$PATH)],
-    [ if test "x$withval" != "xno"
-      then
-        GTK_PATH=$withval:$PATH
-      fi ])
-  # look for gtk-config
-  AC_PATH_PROG(GTK_CONFIG, gtk-config, no, $GTK_PATH)
-  if test -x ${GTK_CONFIG}
-  then
-    if expr 1.2.0 \> `$GTK_CONFIG --version` >/dev/null
+AC_ARG_ENABLE(win32,
+  [  --enable-win32          Win32 interface support (default disabled)],
+  [ if test "x$enableval" != "xno"
     then
-      AC_MSG_ERROR([Your development package for Gtk+ is too old, you need at least version 1.2.0. Please upgrade and try again. Alternatively you can also configure with --disable-gtk.])
-    fi
-    CFLAGS_GTK="${CFLAGS_GTK} `${GTK_CONFIG} --cflags gtk`"
-    LIB_GTK="${LIB_GTK} `${GTK_CONFIG} --libs gtk | sed 's,-rdynamic,,'`"
-  fi
-  # now look for the gtk.h header
-  saved_CPPFLAGS=$CPPFLAGS
-  CPPFLAGS="$CPPFLAGS $CFLAGS_GTK"
-  ac_cv_gtk_headers=yes
-  AC_CHECK_HEADERS(gtk/gtk.h glib.h gdk/gdk.h, , [
-    ac_cv_gtk_headers=no
-    echo "Cannot find gtk development headers."
-  ])
-  if test "x$ac_cv_gtk_headers" = xyes
+      PLUGINS="${PLUGINS} win32"
+    fi ])
+
+dnl
+dnl  ncurses module
+dnl
+AC_ARG_ENABLE(ncurses,
+  [  --enable-ncurses        ncurses interface support (default disabled)],
+  [if test x$enable_ncurses = xyes; then
+     PLUGINS="${PLUGINS} ncurses"
+     LIB_NCURSES="${LIB_NCURSES} -lncurses"
+   fi])
+
+dnl
+dnl  Lirc plugin
+dnl
+AC_ARG_ENABLE(lirc,
+  [  --enable-lirc           lirc support (default disabled)])
+if test x$enable_lirc = xyes
+then
+  AC_CHECK_HEADER(lirc/lirc_client.h, AC_CHECK_LIB(lirc_client, lirc_init, have_lirc="true", have_lirc="false"),have_lirc="false")
+  if test x$have_lirc = xtrue
   then
-    PLUGINS="${PLUGINS} gtk"
-    ALIASES="${ALIASES} gvlc"
+    PLUGINS="${PLUGINS} lirc"
+    LIB_LIRC="${LIB_LIRC} -llirc_client"
   fi
-  CPPFLAGS=$saved_CPPFLAGS
 fi
 
+dnl  end of non-BeOS stuff
+fi
+
+AC_ARG_WITH(,[Misc options:])
+
 dnl
-dnl  X11 module
-dnl  (enabled by default except on win32)
+dnl  Endianness check, AC_C_BIGENDIAN doesn't work if we are cross-compiling
 dnl
-AC_ARG_ENABLE(x11,
-  [  --disable-x11           X11 support (default enabled)])
-if test x$enable_x11 != xno &&
-  (test $SYS != mingw32 || test x$enable_x11 = xyes); then
-  if test x$x_includes = xNONE; then
-    x_includes=/usr/X11R6/include
-  fi
-  if test x$x_libraries = xNONE; then
-    x_libraries=/usr/X11R6/lib
-  fi
-  saved_CPPFLAGS=$CPPFLAGS
-  CPPFLAGS="$CPPFLAGS -I$x_includes"
-  AC_CHECK_HEADERS(X11/Xlib.h, [
-    PLUGINS="${PLUGINS} x11"
-    LIB_X11="${LIB_X11} -L$x_libraries -lX11 -lXext"
-    CFLAGS_X11="${CFLAGS_X11} -I$x_includes"
-  ]
-  CPPFLAGS=$saved_CPPFLAGS)
+dnl  We give the user the opportunity to specify
+dnl  --with-words=big or --with-words=little ; otherwise, try to guess
+dnl
+AC_ARG_WITH(words,
+  [  --with-words=endianness set endianness (big or little)])
+  case "x$withval" in
+    xbig)
+      ac_cv_c_bigendian=yes
+      ;;
+    xlittle)
+      ac_cv_c_bigendian=no
+      ;;
+    *)
+      dnl  Try to guess endianness by matching patterns on a compiled
+      dnl  binary, by looking for an ASCII or EBCDIC string
+      AC_CACHE_CHECK([whether the byte order is big-endian],
+        [ac_cv_c_bigendian],
+        [ac_cv_c_bigendian=unknown
+        [cat >conftest.c <<EOF
+        short am[] = { 0x4249, 0x4765, 0x6e44, 0x6961, 0x6e53, 0x7953, 0 };
+        short ai[] = { 0x694c, 0x5454, 0x656c, 0x6e45, 0x6944, 0x6e61, 0 };
+        void _a(void) { char*s = (char*)am; s = (char *)ai; }
+        short ei[] = { 0x89D3, 0xe3e3, 0x8593, 0x95c5, 0x89c4, 0x9581, 0 };
+        short em[] = { 0xc2c9, 0xc785, 0x95c4, 0x8981, 0x95e2, 0xa8e2, 0 };
+        void _e(void) { char*s = (char*)em; s = (char*)ei; }
+        int main(void) { _a(); _e(); return 0; }
+EOF
+        ]
+        if test -f conftest.c
+        then 
+          if ${CC-cc} conftest.c -o conftest.o >config.log 2>&1 \
+              && test -f conftest.o
+          then
+            if test "`strings conftest.o | grep BIGenDianSyS`"
+            then
+              ac_cv_c_bigendian=yes
+            fi
+            if test "`strings conftest.o | grep LiTTleEnDian`"
+            then
+              ac_cv_c_bigendian=no
+            fi
+          fi
+        fi
+      ])
+      if test x$ac_cv_c_bigendian = xunknown
+      then
+        AC_MSG_ERROR([Could not guess endianness, please use --with-words])
+      fi
+      ;;
+  esac
+dnl  Now we know what to use for endianness, just put it in the header
+if test $ac_cv_c_bigendian = yes
+then
+  AC_DEFINE(WORDS_BIGENDIAN, 1, big endian system)
 fi
 
 dnl
-dnl  XVideo module
-dnl  (enabled by default except on win32)
+dnl  DLLs - used for Win32 package build
 dnl
-AC_ARG_ENABLE(xvideo,
-  [  --disable-xvideo        XVideo support (default enabled)])
-if test x$enable_xvideo != xno &&
-  (test $SYS != mingw32 || test x$enable_xvideo = xyes); then
-  if test x$x_includes = xNONE; then
-    x_includes=/usr/X11R6/include
-  fi
-  if test x$x_libraries = xNONE; then
-    x_libraries=/usr/X11R6/lib
+DLL_PATH=.
+AC_ARG_WITH(dll-path,
+  [  --with-dll-path=PATH    path to Win32 DLLs (default search in \$PWD)],
+  [ if test "x$withval" != "xno"
+    then
+      DLL_PATH=$withval
+    fi ])
+
+dnl
+dnl  Profiling
+dnl
+GPROF=0
+AC_ARG_ENABLE(gprof,
+[  --enable-gprof          gprof profiling (default disabled)],
+[ if test x$enableval = xyes; then GPROF=1; fi ])
+
+CPROF=0
+AC_ARG_ENABLE(cprof,
+[  --enable-cprof          cprof profiling (default disabled)],
+[ if test x$enableval = xyes;
+  then
+    LIB="${LIB} -lcprof"
+    CPROF=1
   fi
-  saved_CPPFLAGS=$CPPFLAGS
-  CPPFLAGS="$CPPFLAGS -I$x_includes"
-  AC_CHECK_HEADERS(X11/extensions/Xv.h, [
-    saved_CFLAGS=$CFLAGS
-    CFLAGS="$CFLAGS -L$x_libraries -lX11 -lXext"
-    AC_CHECK_LIB(Xv_pic,XvSetPortAttribute,
-      # We have Xv_pic, that's good, we can build an xvideo.so plugin !
-      PLUGINS="${PLUGINS} xvideo"
-      LIB_XVIDEO="${LIB_XVIDEO} -L$x_libraries -lX11 -lXext -lXv_pic"
-      CFLAGS_XVIDEO="${CFLAGS_XVIDEO} -I$x_includes",
-      # We don't have Xv_pic, let's make xvideo.a as builtin
-      BUILTINS="${BUILTINS} xvideo"
-      LIB_XVIDEO="${LIB_XVIDEO} -L$x_libraries -lX11 -lXext -lXv"
-      CFLAGS_XVIDEO="${CFLAGS_XVIDEO} -I$x_includes")
-    CFLAGS=$saved_CFLAGS
-  ]
-  CPPFLAGS=$saved_CPPFLAGS)
-fi
+])
 
 dnl
-dnl  ALSA module
+dnl  GNU portable threads
 dnl
-AC_ARG_ENABLE(alsa,
-  [  --enable-alsa           Alsa sound drivers support (Only for linux)
-                          (default disabled)],
-  [if test x$enable_alsa = xyes
-   then
-     AC_CHECK_HEADER(alsa/asoundlib.h, AC_CHECK_LIB(asound, main, have_alsa="true", have_alsa="false"),have_alsa="false")
-     if test x$have_alsa = xtrue
-     then
-       PLUGINS="${PLUGINS} alsa"
-       LIB_ALSA="${LIB_ALSA} -lasound -lm -ldl"
-     fi
-   fi])
+AC_ARG_ENABLE(pth,
+  [  --enable-pth            GNU Pth support (default disabled)],
+  [ if test x$enableval = xyes; then
+    AC_CHECK_LIB(pth,pth_init)
+    AC_EGREP_HEADER(pth_init,pth.h,[
+      AC_DEFINE(PTH_INIT_IN_PTH_H, 1,
+                Define if <pth.h> defines pth_init)
+    THREAD_LIB="-lpth"
+    fi])
+])
 
-dnl  end of non-BeOS stuff
-fi
+dnl
+dnl  State Threads
+dnl
+AC_ARG_ENABLE(st,
+  [  --enable-st             State Threads (default disabled)],
+  [ if test x$enableval = xyes; then
+    AC_CHECK_LIB(st,st_init)
+    AC_EGREP_HEADER(st_init,st.h,[
+      AC_DEFINE(ST_INIT_IN_ST_H, 1,
+                Define if <st.h> defines st_init)
+    THREAD_LIB="-lst"
+    fi])
+])
+
+LIB="${LIB} ${THREAD_LIB}"
 
 dnl
 dnl  Plug-ins - this must be AT THE END
 dnl
 AC_ARG_ENABLE(plugins,
-  [  --disable-plugins       Make all plug-ins built-in (default plug-ins enabled)],
+  [  --disable-plugins       make all plug-ins built-in (default plug-ins enabled)],
   [if test x$enable_plugins = xno
    then
      BUILTINS="${BUILTINS} ${PLUGINS}"
      PLUGINS=
    fi])
 
-dnl
-dnl  DLLs - used for Win32 package build
-dnl
-DLL_PATH=.
-AC_ARG_WITH(dll-path,
-  [  --with-dll-path=path    Path to Win32 DLLs (default search in \$PWD)],
-  [ if test "x$withval" != "xno"
-    then
-      DLL_PATH=$withval
-    fi ])
-
 dnl
 dnl  Stuff used by the program
 dnl
@@ -1403,7 +1524,6 @@ AC_SUBST(ALIASES)
 AC_SUBST(INCLUDE)
 AC_SUBST(DEBUG)
 AC_SUBST(ASM)
-AC_SUBST(TRACE)
 AC_SUBST(CPROF)
 AC_SUBST(GPROF)
 AC_SUBST(OPTIMS)
@@ -1427,10 +1547,9 @@ AC_SUBST(LIB_ARTS)
 AC_SUBST(LIB_BEOS)
 AC_SUBST(LIB_DARWIN)
 AC_SUBST(LIB_DIRECTX)
+AC_SUBST(LIB_DSP)
 AC_SUBST(LIB_DVD)
-AC_SUBST(LIB_DVD_PLUGIN)
 AC_SUBST(LIB_DVDREAD)
-AC_SUBST(LIB_DVDREAD_PLUGIN)
 AC_SUBST(LIB_ESD)
 AC_SUBST(LIB_FILTER_DISTORT)
 AC_SUBST(LIB_GGI)
@@ -1441,8 +1560,13 @@ AC_SUBST(LIB_IDCTALTIVEC)
 AC_SUBST(LIB_IMDCT)
 AC_SUBST(LIB_IMDCT3DN)
 AC_SUBST(LIB_IMDCTSSE)
+AC_SUBST(LIB_IPV4)
+AC_SUBST(LIB_IPV6)
 AC_SUBST(LIB_KDE)
+AC_SUBST(LIB_A52)
 AC_SUBST(LIB_LIBDVDCSS)
+AC_SUBST(LIB_LIBDVDREAD)
+AC_SUBST(LIB_LIRC)
 AC_SUBST(LIB_MACOSX)
 AC_SUBST(LIB_MAD)
 AC_SUBST(LIB_MOTIONALTIVEC)
@@ -1452,6 +1576,8 @@ AC_SUBST(LIB_QNX)
 AC_SUBST(LIB_QT)
 AC_SUBST(LIB_RC)
 AC_SUBST(LIB_SDL)
+AC_SUBST(LIB_VCD)
+AC_SUBST(LIB_WAVEOUT)
 AC_SUBST(LIB_WIN32)
 AC_SUBST(LIB_X11)
 AC_SUBST(LIB_XVIDEO)
@@ -1502,7 +1628,6 @@ vlc configuration
 -----------------
 vlc version           : ${VLC_VERSION}
 debug mode            : ${DEBUG}
-trace mode            : ${TRACE}
 cprof/gprof support   : ${CPROF}/${GPROF}
 need builtin getopt   : ${NEED_GETOPT}
 built-in modules      :${BUILTINS}
@@ -1529,9 +1654,9 @@ which modules get compiled as plugins.
 "
 if test x${HAVE_VLC} = x1
 then
-  echo "To build vlc and its plugins, type \`make vlc plugins'."
+  echo "To build vlc and its plugins, type \`make'."
 fi
-if test x${HAVE_LIBDVDCSS} = x1
+if test x${NEED_LIBDVDCSS} = x1
 then
   echo "To build libdvdcss only, type \`make libdvdcss'."
 fi