]> git.sesse.net Git - vlc/blobdiff - configure.in
Patch for using libgpewidget library for full GPE support.
[vlc] / configure.in
index f4465533902bc897500c08f86a957889507a1e36..7b05bd19f6240c297dad942ec0cbc8497c152589 100644 (file)
@@ -4,7 +4,7 @@ AC_CONFIG_HEADER(include/defs.h)
 AC_CANONICAL_SYSTEM
 
 PACKAGE="vlc"
-VERSION="0.3.1"
+VERSION="0.4.4"
 CODENAME=Ourumov
 
 dnl Save CFLAGS and LDFLAGS
@@ -39,7 +39,7 @@ else
 fi
 
 dnl Gettext stuff
-ALL_LINGUAS="de en_GB fr ja no ru nl"
+ALL_LINGUAS="de en_GB fr ja no ru nl pl"
 
 AC_DEFINE_UNQUOTED(VLC_PACKAGE, "$PACKAGE", [Package name])
 AC_DEFINE_UNQUOTED(VLC_VERSION, "$VERSION", [Package version])
@@ -75,10 +75,12 @@ case x"${target_os}" in
   x*mingw32*)
     SYS=mingw32
     AC_CHECK_TOOL(WINDRES, windres, :)
-    save_CFLAGS="${save_CFLAGS} -fnative-struct -D_OFF_T_ -D_off_t=long"
+    save_CFLAGS="${save_CFLAGS} -D_OFF_T_ -D_off_t=long"
     vlc_LDFLAGS="${vlc_LDFLAGS} -mwindows -Xlinker --force-exe-suffix"
     vlc_LDFLAGS="${vlc_LDFLAGS} -lws2_32 -lnetapi32"
     ipv4_LDFLAGS="${ipv4_LDFLAGS} -lws2_32"
+    ipv6_LDFLAGS="${ipv6_LDFLAGS} -lws2_32"
+    http_LDFLAGS="${http_LDFLAGS} -lws2_32"
     rc_LDFLAGS="${rc_LDFLAGS} -lws2_32"
     ;;
   x*nto*)
@@ -91,7 +93,7 @@ case x"${target_os}" in
     save_CFLAGS="${save_CFLAGS} -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual"
     vlc_LDFLAGS="${vlc_LDFLAGS} -lbe"
     plugins_LDFLAGS="${plugins_LDFLAGS} -nostart"
-    beos_LDFLAGS="${beos_LDFLAGS} -lbe -lgame -lroot -ltracker"
+    beos_LDFLAGS="${beos_LDFLAGS} -lbe -lgame -lroot -ltracker -ltranslation -lstdc++.r4"
     ipv4_LDFLAGS="${ipv4_LDFLAGS} -lbind"
     ;;
   x*)
@@ -100,10 +102,7 @@ case x"${target_os}" in
 esac
 
 dnl Flags for plugin compilation
-if test x"${SYS}" = xmingw32
-then
-  plugins_CFLAGS="${plugins_CFLAGS} -fnative-struct"
-else
+if test x"${SYS}" != xmingw32; then
   plugins_CFLAGS="${plugins_CFLAGS} -fPIC"
 fi
 
@@ -111,7 +110,7 @@ dnl The -DSYS_FOO flag
 save_CFLAGS="${save_CFLAGS} -DSYS_`echo ${SYS} | sed -e 's/-.*//' | tr 'abcdefghijklmnopqrstuvwxyz.' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`"
 
 dnl Check for system libs needed
-AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol isatty usleep vasprintf swab sigrelse getpwuid memalign posix_memalign gethostbyname2)
+AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol isatty vasprintf swab sigrelse getpwuid memalign posix_memalign gethostbyname2 atoll)
 
 AC_CHECK_FUNC(connect,,[
   AC_CHECK_LIB(socket,connect,
@@ -124,11 +123,18 @@ AC_CHECK_FUNC(gethostbyname,,[
 AC_CHECK_FUNC(gethostbyname,,[
   AC_CHECK_LIB(bind,gethostbyname,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lbind")
 ])
-AC_CHECK_FUNC(nanosleep,,[
-  AC_CHECK_LIB(rt,nanosleep,vlc_LDFLAGS="${vlc_LDFLAGS} -lrt",[
-    AC_CHECK_LIB(posix4,nanosleep,vlc_LDFLAGS="${vlc_LDFLAGS} -lposix4")
-  ])
+have_nanosleep=0
+AC_CHECK_FUNC(nanosleep,have_nanosleep=1,[
+  AC_CHECK_LIB(rt,nanosleep,
+    [vlc_LDFLAGS="${vlc_LDFLAGS} -lrt"; have_nanosleep=1],
+    [AC_CHECK_LIB(posix4,nanosleep,
+        [vlc_LDFLAGS="${vlc_LDFLAGS} -lposix4"; have_nanosleep=1])]
+  )
 ])
+if test x$have_nanosleep = x1; then
+  AC_DEFINE(HAVE_NANOSLEEP, 1,
+            Define if nanosleep is available.)
+fi
 AC_CHECK_FUNC(inet_aton,,[
   AC_CHECK_LIB(resolv,inet_aton,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lresolv")
 ])
@@ -184,7 +190,7 @@ AC_EGREP_HEADER(strncasecmp,strings.h,[
             Define if <strings.h> defines strncasecmp.)])
 
 dnl Check for headers
-AC_CHECK_HEADERS(getopt.h strings.h)
+AC_CHECK_HEADERS(stdint.h getopt.h strings.h inttypes.h sys/int_types.h)
 AC_CHECK_HEADERS(sys/sockio.h fcntl.h sys/types.h sys/time.h sys/times.h)
 AC_CHECK_HEADERS(dlfcn.h image.h)
 AC_CHECK_HEADERS(arpa/inet.h net/if.h netinet/in.h sys/socket.h)
@@ -193,6 +199,18 @@ AC_CHECK_HEADERS(linux/version.h)
 
 AC_HEADER_TIME
 
+dnl Mac OS X and other OSes don't have declaration for nanosleep
+AC_EGREP_HEADER(nanosleep,time.h,[
+  AC_DEFINE(HAVE_DECL_NANOSLEEP, 1,
+            Define if <time.h> defines nanosleep.)
+])
+
+dnl Make sure we have timespecs
+AC_EGREP_HEADER(timespec,sys/time.h,[
+  AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1,
+            Define if <sys/time.h> defines struct timespec.)
+])
+
 dnl Check for threads library
 AC_CHECK_HEADERS(cthreads.h pthread.h kernel/scheduler.h kernel/OS.h)
 
@@ -313,6 +331,23 @@ if test x"$ac_cv_c_omit_frame_pointer" != x"no"; then
     CFLAGS_OPTIM_NODEBUG="${CFLAGS_OPTIM_NODEBUG} -fomit-frame-pointer"
 fi
 
+dnl Check for fnative-struct or mms-bitfields support for mingw32
+if test x$SYS = xmingw32
+then
+    AC_CACHE_CHECK([if \$CC accepts -mms-bitfields],
+        [ac_cv_c_mms_bitfields],
+        [CFLAGS="${save_CFLAGS} -mms-bitfields"
+         AC_TRY_COMPILE([],,ac_cv_c_mms_bitfields=yes,
+                        ac_cv_c_mms_bitfields=no)])
+    if test x"$ac_cv_c_mms_bitfields" != x"no"; then
+        save_CFLAGS="${save_CFLAGS} -mms-bitfields"
+        plugins_CFLAGS="${plugins_CFLAGS} -mms-bitfields"
+    else
+        save_CFLAGS="${save_CFLAGS} -fnative-struct"
+        plugins_CFLAGS="${plugins_CFLAGS} -fnative-struct"
+    fi
+fi
+
 dnl Check for Darwin plugin linking flags
 AC_CACHE_CHECK([if \$CC accepts -bundle -undefined error -lcc_dynamic],
     [ac_cv_ld_darwin],
@@ -331,6 +366,20 @@ if test x"$ac_cv_ld_plugins" != x"no"; then
     plugins_LDFLAGS="${plugins_LDFLAGS} -shared"
 fi
         
+dnl Check for variadic macros
+AC_CACHE_CHECK([for variadic cpp macros],
+    [ac_cv_cpp_variadic_macros],
+    [CFLAGS="${save_CFLAGS}"
+     AC_TRY_COMPILE(
+         [#include <stdio.h>
+          #define a(b,c...) printf(b,##c)],
+         [a("foo");a("%s","bar");a("%s%s","baz","quux");],
+         ac_cv_cpp_variadic_macros=yes,
+         ac_cv_cpp_variadic_macros=no)])
+if test x"$ac_cv_cpp_variadic_macros" != x"no"; then
+    AC_DEFINE(HAVE_VARIADIC_MACROS, 1, Support for variadic macros)
+fi
+
 dnl Checks for __attribute__(aligned()) directive
 AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
     [ac_cv_c_attribute_aligned],
@@ -392,7 +441,12 @@ dnl
 dnl  default modules
 dnl
 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"
+PLUGINS="${PLUGINS} dummy null rc logger mpeg_es mpeg_ps mpeg_ts mpeg_audio file memcpy lpcm_adec ac3_spdif spudec filter_deinterlace filter_invert filter_wall filter_transform filter_distort filter_clone filter_crop fx_scope"
+
+dnl
+dnl  Network modules
+dnl
+NETWORK_MODULES="udp http rtp ipv4"
 
 dnl
 dnl  Accelerated modules
@@ -403,6 +457,11 @@ THREEDNOW_MODULES="memcpy3dn imdct3dn downmix3dn"
 SSE_MODULES="imdctsse downmixsse"
 ALTIVEC_MODULES="idctaltivec motionaltivec memcpyaltivec"
 
+if test x$SYS != xbeos
+then
+    PLUGINS="${PLUGINS} ${NETWORK_MODULES}"
+fi
+
 AC_CACHE_CHECK([if \$CC groks MMX inline assembly],
     [ac_cv_mmx_inline],
     [AC_TRY_COMPILE(,[void *p;asm volatile("packuswb %%mm1,%%mm2"::"r"(p));],
@@ -510,8 +569,8 @@ dnl
 AC_ARG_WITH(tuning,
 [  --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
+if test "x$with_tuning" != "x"; then
+    TUNING="$with_tuning"
 else
     if test x${target_cpu} = xi686 -o x${target_cpu} = xi586 -o x${target_cpu} = xi486 -o x${target_cpu} = xi386; then TUNING="pentiumpro"
     else
@@ -533,7 +592,7 @@ 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 ],
+[ if test x$enable_optimizations = xno; then OPTIMS=0; fi ],
 [ OPTIMS=1 ])
 
 dnl
@@ -541,7 +600,7 @@ dnl  AltiVec acceleration
 dnl
 AC_ARG_ENABLE(altivec,
 [  --disable-altivec       disable altivec optimizations (default enabled on PPC)],
-[ if test x$enableval = xyes; then ARCH="${ARCH} altivec";
+[ if test x$enable_altivec = xyes; then ARCH="${ARCH} altivec";
     BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ],
 [ if test x${target_cpu} = xpowerpc; then ARCH="${ARCH} altivec";
     BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ])
@@ -552,7 +611,7 @@ dnl
 DEBUG=0
 AC_ARG_ENABLE(debug,
 [  --enable-debug          debug mode (default disabled)],
-[ if test x$enableval = xyes; then DEBUG=1; fi ])
+[ if test x$enable_debug = xyes; then DEBUG=1; fi ])
 
 dnl
 dnl  Enable release-specific flags
@@ -560,7 +619,7 @@ dnl
 RELEASE=0
 AC_ARG_ENABLE(release,
 [  --enable-release        activate extra optimizations (default disabled)],
-[ if test x$enableval = xyes; then RELEASE=1; fi ],
+[ if test x$enable_release = xyes; then RELEASE=1; fi ],
 [ VERSION="${VERSION}_`date +%Y-%m-%d`" ])
 
 dnl
@@ -574,7 +633,7 @@ dnl  DVD module: optionally check for installed libdvdcss
 dnl
 AC_ARG_ENABLE(dvd,
 [  --enable-dvd            DVD input module (default enabled)])
-if test "x$enableval" != "xno"
+if test "x$enable_dvd" != "xno"
 then
   AC_ARG_WITH(dvdcss, 
   [    --with-dvdcss=PATH    libdvdcss headers and libraries])
@@ -645,13 +704,13 @@ if test "x$enable_dvdread" != "xno"
 then
   AC_ARG_WITH(dvdread, 
   [    --with-dvdread=PATH   libdvdread headers and libraries])
-  if test "x$withval" = x
+  if test "x$with_dvdread" = x
   then
     test_LDFLAGS=""
     test_CFLAGS=""
   else
-    test_LDFLAGS="-L${withval}/lib"
-    test_CFLAGS="-I${withval}/include"
+    test_LDFLAGS="-L${with_dvdread}/lib"
+    test_CFLAGS="-I${with_dvdread}/include"
   fi
   CPPFLAGS="$save_CPPFLAGS $test_CFLAGS"
   AC_CHECK_HEADERS(dvdread/dvd_reader.h, [
@@ -669,9 +728,9 @@ then
   ],[
     if test "x$enable_dvdread" != x
     then
-      if test "x$withval" != x
+      if test "x$with_dvdread" != x
       then
-        AC_MSG_ERROR([Cannot find dvdread/dvd_reader.h in ${withval}/include])
+        AC_MSG_ERROR([Cannot find dvdread/dvd_reader.h in ${with_dvdread}/include])
       else
         AC_MSG_ERROR([Cannot find dvdread/dvd_reader.h])
       fi
@@ -680,18 +739,94 @@ then
   CPPFLAGS="$save_CPPFLAGS"
 fi
 
+dnl
+dnl  libdvbpsi ts demux
+dnl
+AC_ARG_ENABLE(dvbpsi,
+[  --enable-dvbpsi        dvbpsi ts demux module (default disabled)])
+if test "x$enable_dvbpsi" != "xno"
+then
+  AC_ARG_WITH(dvbpsi, 
+  [    --with-dvbpsi=PATH    libdvbpsi headers and libraries])
+  AC_ARG_WITH(dvbpsi,
+  [    --with-dvbpsi-tree=PATH libdvbpsi tree for static linking])
+  case "x$with_dvbpsi" in
+  x|xyes)
+    if test "x$with_dvbpsi_tree" = x
+    then
+      AC_CHECK_HEADERS(dvbpsi/dr.h,
+        [ PLUGINS="${PLUGINS} mpeg_ts_dvbpsi"
+          mpeg_ts_dvbpsi_LDFLAGS="${mpeg_ts_dvbpsi_LDFLAGS} -ldvbpsi" ], [],
+        [  AC_MSG_ERROR([cannot find libdvbpsi headers]) ])
+    else
+      AC_MSG_CHECKING(for libdvbpsi.a in ${with_dvbpsi_tree})
+      real_dvbpsi_tree="`cd ${with_dvbpsi_tree} 2>/dev/null && pwd`"
+      if test "x$real_dvbpsi_tree" = x
+      then
+        dnl  The given directory can't be found
+        AC_MSG_RESULT(no)
+        AC_MSG_ERROR([cannot cd to ${with_dvbpsi_tree}])
+      fi
+      if test -f "${real_dvbpsi_tree}/src/.libs/libdvbpsi.a"
+      then
+        dnl  Use a custom libdvbpsi
+        AC_MSG_RESULT(${real_dvbpsi_tree}/src/.libs/libdvbpsi.a)
+        BUILTINS="${BUILTINS} mpeg_ts_dvbpsi"
+        mpeg_ts_dvbpsi_LDFLAGS="${mpeg_ts_dvbpsi_LDFLAGS} ${real_dvbpsi_tree}/src/.libs/libdvbpsi.a"
+        mpeg_ts_dvbpsi_CFLAGS="${mpeg_ts_dvbpsi_CFLAGS} -I${real_dvbpsi_tree}/src"
+      else
+        dnl  The given libdvbpsi wasn't built
+        AC_MSG_RESULT(no)
+        AC_MSG_ERROR([cannot find ${real_dvbpsi_tree}/src/.libs/libdvbpsi.a, make sure you compiled libdvbpsi in ${with_dvbpsi_tree}])
+      fi
+    fi
+  ;;
+  xno)
+    dnl  Compile without dvbpsi (dlopen version, works only under Linux)
+  ;;
+  *)
+    AC_MSG_CHECKING(for dvbpsi headers in ${with_dvbpsi})
+    if test "x$with_dvbpsi" = x
+    then
+      test_LDFLAGS=""
+      test_CFLAGS=""
+    else
+      test_LDFLAGS="-L${with_dvbpsi}/lib"
+      test_CFLAGS="-I${with_dvbpsi}/include"
+    fi
+    CPPFLAGS="$save_CPPFLAGS $test_CFLAGS"
+    AC_CHECK_HEADER([dvbpsi/dr.h],[
+      PLUGINS="${PLUGINS} mpeg_ts_dvbpsi"
+      mpeg_ts_dvbpsi_LDFLAGS="${mpeg_ts_dvbpsi_LDFLAGS} ${test_LDFLAGS} -ldvbpsi"
+      mpeg_ts_dvbpsi_CFLAGS="${mpeg_ts_dvbpsi_CFLAGS} ${test_CFLAGS}"
+      ],[
+      if test "x$enable_dvbpsi" != x
+      then
+        AC_MSG_ERROR([Could not find libdvbpsi on your system: you may get it from www.videolan.org, you'll need at least version 0.1.1])
+      fi
+    ])
+    CPPFLAGS="$save_CPPFLAGS"
+  ;;
+  esac
+fi
+
 dnl
 dnl  VCD module
 dnl
 AC_ARG_ENABLE(vcd,
-  [  --enable-vcd            VCD support for Linux and MacOS X (default enabled)])
+  [  --enable-vcd            VCD support for Linux, FreeBSD and MacOS X (default enabled)])
 
 if test x$enable_vcd != xno
 then
   AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
     PLUGINS="${PLUGINS} vcd"
   ])
-
+  
+  AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
+    PLUGINS="${PLUGINS} vcd"
+    AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
+  ])
+  
   if test "x${SYS}" = "xbsdi"
   then
     PLUGINS="${PLUGINS} vcd"
@@ -699,7 +834,7 @@ then
 
   if test "x${SYS}" = "xdarwin"
   then
-    PLUGINS="${PLUGINS} vcd"
+    # No need to add vcd to PLUGINS, Darwin is already based on FreeBSD
     vcd_LDFLAGS="${vcd_LDFLAGS} -framework IOKit -framework CoreFoundation" 
   fi
 fi
@@ -715,9 +850,18 @@ AC_ARG_ENABLE(satellite,
     fi])
 
 dnl
-dnl  ipv6 plugin
+dnl  ipv6 plugin - not for QNX yet
 dnl
-AC_CHECK_FUNC(inet_pton,[PLUGINS="${PLUGINS} ipv6"])
+if test x$SYS != xnto && test "x$SYS" != "xmingw32"
+then
+  AC_CHECK_FUNC(inet_pton,[PLUGINS="${PLUGINS} ipv6"])
+fi
+if test "x$SYS" = "xmingw32"
+then
+  AC_MSG_CHECKING(for getaddrinfo in ws2tcpip.h)
+  AC_EGREP_HEADER(addrinfo,ws2tcpip.h,[AC_MSG_RESULT(yes)
+    PLUGINS="${PLUGINS} ipv6"],[AC_MSG_RESULT(no)])
+fi
 
 dnl
 dnl  AVI demux plugin
@@ -742,29 +886,58 @@ AC_ARG_ENABLE(mad,
   [  --enable-mad            libmad module (default disabled)])
 if test x$enable_mad = xyes
 then
-  PLUGINS="${PLUGINS} mad"
-  mad_LDFLAGS="${mad_LDFLAGS} -lmad"
   AC_ARG_WITH(mad,
-    [    --with-mad=PATH       path to libmad],
-    [ if test "x$with_val" != "xno" -a "x$with_val" != "x"
-      then
-        mad_CFLAGS="${mad_CFLAGS} -I$with_val/include"
-        mad_LDFLAGS="${mad_LDFLAGS} -L$with_val/lib"
-      fi ])
-  save_CFLAGS=$CFLAGS
-  save_LDFLAGS=$LDFLAGS
-  CFLAGS="$CFLAGS $mad_CFLAGS"
-  LDFLAGS="$LDFLAGS $mad_LDFLAGS"
-  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
+    [    --with-mad=PATH       path to libmad],[],[])
+  if test "x$with_mad" != "xno" -a "x$with_mad" != "x"
+  then
+    mad_CFLAGS="${mad_CFLAGS} -I$with_mad/include"
+    mad_LDFLAGS="${mad_LDFLAGS} -L$with_mad/lib"
+  fi
+
+  AC_ARG_WITH(mad-tree,
+    [    --with-mad-tree=PATH  mad tree for static linking],[],[])
+  if test "x$with_mad_tree" != "xno" -a "x$with_mad_tree" != "x"
+  then
+    real_mad_tree="`cd ${with_mad_tree} 2>/dev/null && pwd`"
+    if test "x$real_mad_tree" = x
+    then
+      dnl  The given directory can't be found
+      AC_MSG_RESULT(no)
+      AC_MSG_ERROR([${with_mad_tree} directory doesn't exist])
+    fi
+    dnl  Use a custom libmad
+    AC_MSG_CHECKING(for mad.h in ${real_mad_tree}/libmad)
+    if test -f ${real_mad_tree}/libmad/mad.h
+    then
+      AC_MSG_RESULT(yes)
+      mad_CFLAGS="${mad_CFLAGS} -I${real_mad_tree}/libmad"
+      mad_LDFLAGS="${mad_LDFLAGS} -L${real_mad_tree}/libmad/.libs"
+      save_LDFLAGS=$LDFLAGS
+      LDFLAGS=$mad_LDFLAGS
+      AC_CHECK_LIB(mad, mad_bit_init, [
+        BUILTINS="${BUILTINS} mad"
+        mad_LDFLAGS="${mad_LDFLAGS} -lmad"
+        ],[ AC_MSG_ERROR([the specified tree hasn't been compiled ])
+      ],[])
+      LDFLAGS=$save_LDFLAGS
+    else
+      AC_MSG_RESULT(no)
+      AC_MSG_ERROR([the specified tree doesn't have mad.h])
+    fi
+  else
+    save_CFLAGS=$CFLAGS
+    save_LDFLAGS=$LDFLAGS
+    CFLAGS="$CFLAGS $mad_CFLAGS"
+    LDFLAGS="$LDFLAGS $mad_LDFLAGS"
+    AC_CHECK_HEADERS(mad.h, ,
+      [ AC_MSG_ERROR([Cannot find development headers for libmad...]) ])
+    AC_CHECK_LIB(mad, mad_bit_init, [
+      PLUGINS="${PLUGINS} mad"
+      mad_LDFLAGS="${mad_LDFLAGS} -lmad" ],
+      [ AC_MSG_ERROR([Cannot find libmad library...]) ])
+    CFLAGS=$save_CFLAGS
+    LDFLAGS=$save_LDFLAGS
+  fi
 fi
 
 dnl
@@ -772,14 +945,20 @@ dnl  ffmpeg decoder plugin
 dnl
 AC_ARG_ENABLE(ffmpeg,
 [  --enable-ffmpeg         ffmpeg codec (default disabled)])
-if test "x$enableval" = "xyes"
+if test "x$enable_ffmpeg" = "xyes"
 then
+  AC_ARG_WITH(ffmpeg,
+    [    --with-ffmpeg=PATH    path to ffmpeg installation],[],[])
+  if test "x$with_ffmpeg" != "xno" -a "x$with_ffmpeg" != "x"
+  then
+    ffmpeg_CFLAGS="${ffmpeg_CFLAGS} -I$with_ffmpeg/include/libffmpeg"
+    ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} -L$with_ffmpeg/lib"
+  fi
+
   AC_ARG_WITH(ffmpeg-tree, 
   [    --with-ffmpeg-tree=PATH ffmpeg tree for static linking])
-  if test "x$with_ffmpeg_tree" = x
+  if test "x$with_ffmpeg_tree" != "x"
   then
-    AC_MSG_ERROR([cannot find ${real_ffmpeg_tree}/libavcodec/libavcodec.a])
-  else
     AC_MSG_CHECKING(for libavcodec.a in ${with_ffmpeg_tree})
     real_ffmpeg_tree="`cd ${with_ffmpeg_tree} 2>/dev/null && pwd`"
     if test "x$real_ffmpeg_tree" = x
@@ -794,12 +973,35 @@ then
       AC_MSG_RESULT(${real_ffmpeg_tree}/libavcodec/libavcodec.a)
       BUILTINS="${BUILTINS} ffmpeg"
       ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} ${real_ffmpeg_tree}/libavcodec/libavcodec.a"
+      if test x$SYS != xbeos
+      then
+        ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} -lm"
+      fi
       ffmpeg_CFLAGS="${ffmpeg_CFLAGS} -I${real_ffmpeg_tree}/libavcodec"
     else
       dnl  The given libavcodec wasn't built
       AC_MSG_RESULT(no)
       AC_MSG_ERROR([cannot find ${real_ffmpeg_tree}/libavcodec/libavcodec.a, make sure you compiled libavcodec in ${with_ffmpeg_tree}])
     fi
+  else
+    save_CFLAGS=$CFLAGS
+    save_LDFLAGS=$LDFLAGS
+    CFLAGS="$CFLAGS $ffmpeg_CFLAGS"
+    LDFLAGS="$LDFLAGS $ffmpeg_LDFLAGS"
+    if test x$SYS != xbeos
+    then
+      ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} -lm"
+    fi
+    AC_CHECK_LIB(avcodec, avcodec_init, [
+      BUILTINS="${BUILTINS} ffmpeg"
+      ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} -lavcodec"
+      if test x$SYS != xbeos
+      then
+        ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} -lm"
+      fi ],
+      [ AC_MSG_ERROR([Cannot find libavcodec library...]) ])
+    CFLAGS=$save_CFLAGS
+    LDFLAGS=$save_LDFLAGS
   fi
 fi
 
@@ -815,12 +1017,54 @@ dnl  a52 AC3 decoder plugin
 dnl
 AC_ARG_ENABLE(a52,
   [  --enable-a52            AC3 support with liba52 (default enabled)])
-if test "x$enableval" != "xno" -a x$SYS != xmingw32
+if test "x$enable_a52" != "xno"
+then
+  AC_ARG_WITH(a52-tree,
+    [    --with-a52-tree=PATH  a52dec tree for static linking ],[],[])
+  if test "x$with_a52_tree" != "xno" -a "x$with_a52_tree" != "x"
   then
+    real_a52_tree="`cd ${with_a52_tree} 2>/dev/null && pwd`"
+    if test "x$real_a52_tree" = x
+    then
+      dnl  The given directory can't be found
+      AC_MSG_RESULT(no)
+      AC_MSG_ERROR([${with_a52_tree} directory doesn't exist])
+    fi
+    dnl  Use a custom a52dec
+    AC_MSG_CHECKING(for a52.h in ${real_a52_tree}/include)
+    if test -f ${real_a52_tree}/include/a52.h
+    then
+      AC_MSG_RESULT(yes)
+      a52_CFLAGS="${a52_CFLAGS} -I${real_a52_tree}"
+      a52_LDFLAGS="${a52_LDFLAGS} -L${real_a52_tree}/liba52/.libs"
+      save_LDFLAGS=$LDFLAGS
+      LDFLAGS="$a52_LDFLAGS $LDFLAGS"
+      AC_CHECK_LIB(a52, a52_free, [
+        BUILTINS="${BUILTINS} a52"
+        a52_LDFLAGS="${a52_LDFLAGS} -la52 -lm"
+        a52_CFLAGS="${a52_CFLAGS} -DUSE_A52DEC_TREE"
+        ],[
+        if test -f ${real_a52_tree}/liba52/.libs/liba52.a
+        then
+          AC_MSG_ERROR([make sure you have at least a52dec-0.7.3])
+        else
+          AC_MSG_ERROR([the specified tree hasn't been compiled])
+        fi
+      ],[-lm])
+      LDFLAGS=$save_LDFLAGS
+    else
+      AC_MSG_RESULT(no)
+      AC_MSG_ERROR([the specified tree doesn't have a52.h])
+    fi
+  else dnl  no with args
     AC_CHECK_HEADERS(a52dec/a52.h, [
-      BUILTINS="${BUILTINS} a52"
-      a52_LDFLAGS="${a52_LDFLAGS} -la52 -lm"
-     ],[])
+      AC_CHECK_LIB(a52, a52_free, [
+        BUILTINS="${BUILTINS} a52"
+        a52_LDFLAGS="${a52_LDFLAGS} -la52 -lm"
+        a52_CFLAGS="${a52_CFLAGS}"
+      ],[],[-lm])
+    ])
+  fi
 fi
 
 dnl
@@ -828,7 +1072,7 @@ dnl  ogg vorbis plugin
 dnl
 AC_ARG_ENABLE(vorbis,
   [  --enable-vorbis         Ogg/Vorbis decoder support (default enabled)])
-if test "x$enableval" != "xno"
+if test "x$enable_vorbis" != "xno"
 then
   AC_CHECK_HEADERS(ogg/ogg.h, [
     dnl disabled for the moment
@@ -909,9 +1153,9 @@ then
   SDL_PATH=$PATH
   AC_ARG_WITH(sdl-config-path,
     [    --with-sdl-config-path=PATH sdl-config path (default search in \$PATH)],
-    [ if test "x$withval" != "xno"
+    [ if test "x$with_sdl_config_path" != "xno"
       then
-        SDL_PATH=$withval:$PATH
+        SDL_PATH="$with_sdl_config_path:$PATH"
       fi ])
   AC_PATH_PROG(SDL12_CONFIG, sdl12-config, no, $SDL_PATH)
   SDL_CONFIG=${SDL12_CONFIG}
@@ -954,12 +1198,45 @@ from http://www.libsdl.org/, or configure with --disable-sdl. Have a nice day.
   fi
 fi
 
+dnl
+dnl  Qt Embedded module
+dnl  (disabled by default)
+dnl
+AC_ARG_ENABLE(qte,
+  [  --enable-qte            QT Embedded support (default disabled)])
+if test "x${enable_qte}" != "xno"
+then
+  AC_ARG_WITH(qte,
+  [    --with-qte=PATH    Qt Embedded headers and libraries])
+  if test "x${with_qte}" = "x"
+  then
+    test_LDFLAGS="-L${QTDIR}/lib"
+    test_CFLAGS="-I${QTDIR}/include"
+  else
+    test_LDFLAGS="-L${with_qte}/lib"
+    test_CFLAGS="-I${with_qte}/include"
+  fi
+
+  CPPFLAGS="${save_CPPFLAGS} ${test_CFLAGS}"
+  AC_CHECK_HEADERS(qt.h, [
+    qte_CFLAGS="${qte_CFLAGS} ${test_CFLAGS} -DQT_QWS_IPAQ -DQWS -fno-exceptions -fno-rtti"
+    qte_LDFLAGS="${qte_LDFLAGS} ${test_LDFLAGS} -lqpe -lqte"
+    if test "x${with_qte}" = "x"
+    then
+      PLUGINS="${PLUGINS} qte"
+    else
+      BUILTINS="${BUILTINS} qte"
+    fi
+  ])
+  CPPFLAGS="${save_CPPFLAGS}"
+fi
+
 dnl
 dnl  Windows DirectX module
 dnl
 AC_ARG_ENABLE(directx,
   [  --enable-directx        Win32 DirectX support (default enabled on Win32)])
-if test "x$enableval" != "xno"
+if test "x$enable_directx" != "xno"
 then
   if test x$SYS = xmingw32
   then
@@ -971,16 +1248,16 @@ then
       [ PLUGINS="${PLUGINS} directx"
         directx_LDFLAGS="${directx_LDFLAGS} -lgdi32" ])
     else
-      AC_MSG_CHECKING(for directX headers in ${withval})
-      if test -f ${withval}/ddraw.h
+      AC_MSG_CHECKING(for directX headers in ${with_directx})
+      if test -f ${with_directx}/ddraw.h
       then
         PLUGINS="${PLUGINS} directx"
-        directx_LDFLAGS="${directx_LDFLAGS} -L${withval}/lib -lgdi32"
-        directx_CFLAGS="${directx_CFLAGS} -I${withval}"
+        directx_LDFLAGS="${directx_LDFLAGS} -L${with_directx}/lib -lgdi32"
+        directx_CFLAGS="${directx_CFLAGS} -I${with_directx}"
         AC_MSG_RESULT(yes)
       else
         AC_MSG_RESULT(no)
-        AC_MSG_ERROR([Cannot find ${withval}/ddraw.h!])
+        AC_MSG_ERROR([Cannot find ${with_directx}/ddraw.h!])
       fi
     fi
   fi
@@ -1019,10 +1296,10 @@ then
   ggi_LDFLAGS="${ggi_LDFLAGS} -lggi"
   AC_ARG_WITH(ggi,
     [    --with-ggi=PATH       path to libggi],
-    [ if test "x$with_val" != "xno" -a "x$with_val" != "x"
+    [ if test "x$with_ggi" != "xno" -a "x$with_ggi" != "x"
       then
-        CFLAGS_GGI="${CFLAGS_GGI} -I$with_val/include"
-        ggi_LDFLAGS="${ggi_LDFLAGS} -L$with_val/lib"
+        CFLAGS_GGI="${CFLAGS_GGI} -I$with_ggi/include"
+        ggi_LDFLAGS="${ggi_LDFLAGS} -L$with_ggi/lib"
       fi ])
 fi
 
@@ -1038,10 +1315,10 @@ then
   glide_CFLAGS="${glide_CFLAGS} -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"
+    [ if test "x$with_glide" != "xno" -a "x$with_glide" != "x"
       then
-        glide_CFLAGS="${glide_CFLAGS} -I$with_val/include"
-        glide_LDFLAGS="${glide_LDFLAGS} -L$with_val/lib"
+        glide_CFLAGS="${glide_CFLAGS} -I$with_glide/include"
+        glide_LDFLAGS="${glide_LDFLAGS} -L$with_glide/lib"
       fi ])
 fi
 
@@ -1133,7 +1410,7 @@ 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
+if test "x$enable_waveout" != "xno" -a x$SYS = xmingw32
   then
     PLUGINS="${PLUGINS} waveout"
     waveout_LDFLAGS="-lwinmm"
@@ -1155,9 +1432,9 @@ 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"
+    [ if test "x$with_gtk_config_path" != "xno"
       then
-        GTK_PATH=$withval:$PATH
+        GTK_PATH="$with_gtk_config_path:$PATH"
       fi ])
   # look for gtk-config
   AC_PATH_PROG(GTK12_CONFIG, gtk12-config, no, $GTK_PATH)
@@ -1190,6 +1467,51 @@ then
   fi
 fi
 
+dnl
+dnl  Familiar module uses Gtk+ library
+dnl
+AC_ARG_ENABLE(familiar,
+  [  --enable-familiar       Familiar Gtk+ support (default disabled)])
+if test "x${enable_familiar}" = "xyes"
+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${with_gtk_config_path}" != "xno"
+      then
+        GTK_PATH="${with_gtk_config_path}:${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-familiar.])
+    fi
+    familiar_CFLAGS="${familiar_CFLAGS} `${GTK_CONFIG} --cflags gtk gthread`"
+    familiar_LDFLAGS="${familiar_LDFLAGS} `${GTK_CONFIG} --libs gtk gthread | sed 's,-rdynamic,,'`"
+    # now look for the gtk.h header
+    CPPFLAGS="${save_CPPFLAGS} ${familiar_CFLAGS}"
+    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} familiar"
+      NEED_GTK_MAIN=yes
+    fi
+    CPPFLAGS="${save_CPPFLAGS}"
+  fi
+fi
+
 dnl
 dnl  Gnome module
 dnl
@@ -1252,6 +1574,34 @@ AC_ARG_ENABLE(kde,
      fi
    fi])
 
+dnl
+dnl  Opie QT embedded module
+dnl
+AC_ARG_ENABLE(opie,
+  [  --enable-opie           Qt embedded interface support (default disabled)],
+  [if test "x${enable_opie}" = "xyes"; then
+     AC_ARG_WITH(qte,
+     [    --with-qte=PATH    Qt Embedded headers and libraries])
+     if test "x${with_qte}" = "x"
+     then
+       test_LDFLAGS="-L${QTDIR}/lib"
+       test_CFLAGS="-I${QTDIR}/include"
+     else
+       test_LDFLAGS="-L${with_qte}/lib"
+       test_CFLAGS="-I${with_qte}/include"
+     fi
+
+     PLUGINS="${PLUGINS} opie"
+     opie_LDFLAGS="${opie_LDFLAGS} ${test_LDFLAGS} -lqpe -lqte"
+     opie_CFLAGS="${opie_CFLAGS} ${test_CFLAGS}-DQT_QWS_IPAQ -DQWS -fno-exceptions -fno-rtti"
+     if test -x ${QTDIR}/bin/moc
+     then
+       MOC=${QTDIR}/bin/moc
+     else
+       MOC=moc
+     fi
+   fi])
+
 dnl
 dnl  MacOS X module
 dnl
@@ -1260,15 +1610,11 @@ AC_ARG_ENABLE(macosx,
   [if test x$enable_macosx = xyes
    then
      BUILTINS="${BUILTINS} macosx"
-     macosx_LDFLAGS="${macosx_LDFLAGS} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework AGL -framework QuickTime -lobjc"
-     macosx_CFLAGS="${macosx_CFLAGS} -ObjC"
-     LDFLAGS="${LDFLAGS} -ObjC"
+     macosx_LDFLAGS="${macosx_LDFLAGS} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework AGL -framework QuickTime -lobjc -ObjC"
    fi],
   [AC_CHECK_HEADERS(Cocoa/Cocoa.h,
      BUILTINS="${BUILTINS} macosx"
-     macosx_LDFLAGS="${macosx_LDFLAGS} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework AGL -framework QuickTime -lobjc"
-     macosx_CFLAGS="${macosx_CFLAGS} -ObjC"
-     LDFLAGS="${LDFLAGS} -ObjC"
+     macosx_LDFLAGS="${macosx_LDFLAGS} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework AGL -framework QuickTime -lobjc -ObjC"
    )])
 
 dnl
@@ -1289,7 +1635,7 @@ dnl  Windows native interface module, built with Borland C++ Builder
 dnl
 AC_ARG_ENABLE(intfwin,
 [  --enable-intfwin        Win32 interface support (default disabled)],
-[ if test "x$enableval" != "xno"
+[ if test "x$enable_intfwin" != "xno"
   then
     AC_ARG_WITH(bcbuilder, 
     [    --with-bcbuilder=PATH Borland C++ Builder installation path])
@@ -1335,7 +1681,7 @@ 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
+  case "x$with_words" in
     xbig)
       ac_cv_c_bigendian=yes
       ;;
@@ -1392,12 +1738,12 @@ dnl
 GPROF=0
 AC_ARG_ENABLE(gprof,
 [  --enable-gprof          gprof profiling (default disabled)],
-[ if test x$enableval = xyes; then GPROF=1; fi ])
+[ if test "x$enable_gprof" = "xyes"; then GPROF=1; fi ])
 
 CPROF=0
 AC_ARG_ENABLE(cprof,
 [  --enable-cprof          cprof profiling (default disabled)],
-[ if test x$enableval = xyes;
+[ if test "x$enable_cprof" = "xyes";
   then
     LDFLAGS="${LDFLAGS} -lcprof"
     CPROF=1
@@ -1409,7 +1755,7 @@ dnl  GNU portable threads
 dnl
 AC_ARG_ENABLE(pth,
   [  --enable-pth            GNU Pth support (default disabled)],
-  [ if test x$enableval = xyes; then
+  [ if test "x$enable_pth" = "xyes"; then
     AC_CHECK_LIB(pth,pth_init)
     AC_EGREP_HEADER(pth_init,pth.h,[
       AC_DEFINE(PTH_INIT_IN_PTH_H, 1,
@@ -1423,7 +1769,7 @@ dnl  State Threads
 dnl
 AC_ARG_ENABLE(st,
   [  --enable-st             State Threads (default disabled)],
-  [ if test x$enableval = xyes; then
+  [ if test "x$enable_st" = "xyes"; then
     AC_CHECK_LIB(st,st_init)
     AC_EGREP_HEADER(st_init,st.h,[
       AC_DEFINE(ST_INIT_IN_ST_H, 1,
@@ -1500,11 +1846,14 @@ AC_SUBST(vlc_CFLAGS)
 AC_SUBST(plugins_CFLAGS)
 AC_SUBST(builtins_CFLAGS)
 
+AC_SUBST(a52_CFLAGS)
 AC_SUBST(arts_CFLAGS)
 AC_SUBST(dvd_CFLAGS)
 AC_SUBST(dvdread_CFLAGS)
+AC_SUBST(mpeg_ts_dvbpsi_CFLAGS)
 AC_SUBST(directx_CFLAGS)
 AC_SUBST(esd_CFLAGS)
+AC_SUBST(familiar_CFLAGS)
 AC_SUBST(ffmpeg_CFLAGS)
 AC_SUBST(glide_CFLAGS)
 AC_SUBST(gnome_CFLAGS)
@@ -1515,7 +1864,9 @@ AC_SUBST(macosx_CFLAGS)
 AC_SUBST(mad_CFLAGS)
 AC_SUBST(memcpyaltivec_CFLAGS)
 AC_SUBST(motionaltivec_CFLAGS)
+AC_SUBST(opie_CFLAGS)
 AC_SUBST(qt_CFLAGS)
+AC_SUBST(qte_CFLAGS)
 AC_SUBST(sdl_CFLAGS)
 AC_SUBST(x11_CFLAGS)
 AC_SUBST(xvideo_CFLAGS)
@@ -1534,18 +1885,22 @@ AC_SUBST(directx_LDFLAGS)
 AC_SUBST(dsp_LDFLAGS)
 AC_SUBST(dvd_LDFLAGS)
 AC_SUBST(dvdread_LDFLAGS)
+AC_SUBST(mpeg_ts_dvbpsi_LDFLAGS)
 AC_SUBST(esd_LDFLAGS)
+AC_SUBST(familiar_LDFLAGS)
 AC_SUBST(filter_distort_LDFLAGS)
 AC_SUBST(ffmpeg_LDFLAGS)
 AC_SUBST(ggi_LDFLAGS)
 AC_SUBST(glide_LDFLAGS)
 AC_SUBST(gnome_LDFLAGS)
 AC_SUBST(gtk_LDFLAGS)
+AC_SUBST(http_LDFLAGS)
 AC_SUBST(idctaltivec_LDFLAGS)
 AC_SUBST(imdct_LDFLAGS)
 AC_SUBST(imdct3dn_LDFLAGS)
 AC_SUBST(imdctsse_LDFLAGS)
 AC_SUBST(ipv4_LDFLAGS)
+AC_SUBST(ipv6_LDFLAGS)
 AC_SUBST(kde_LDFLAGS)
 AC_SUBST(lirc_LDFLAGS)
 AC_SUBST(macosx_LDFLAGS)
@@ -1553,8 +1908,10 @@ AC_SUBST(mad_LDFLAGS)
 AC_SUBST(memcpyaltivec_LDFLAGS)
 AC_SUBST(motionaltivec_LDFLAGS)
 AC_SUBST(ncurses_LDFLAGS)
+AC_SUBST(opie_LDFLAGS)
 AC_SUBST(qnx_LDFLAGS)
 AC_SUBST(qt_LDFLAGS)
+AC_SUBST(qte_LDFLAGS)
 AC_SUBST(rc_LDFLAGS)
 AC_SUBST(sdl_LDFLAGS)
 AC_SUBST(vcd_LDFLAGS)
@@ -1563,7 +1920,7 @@ AC_SUBST(waveout_LDFLAGS)
 AC_SUBST(x11_LDFLAGS)
 AC_SUBST(xvideo_LDFLAGS)
 
-AC_OUTPUT([Makefile.opts po/Makefile.in])
+AC_OUTPUT([Makefile.config Makefile.opts po/Makefile.in])
 
 echo "
 vlc configuration