]> git.sesse.net Git - vlc/blobdiff - configure.ac.in
* ALL: WinCE compilation fixes (mostly nonexistent headers). A lot of
[vlc] / configure.ac.in
index 727975e18735b71cd87e92c8874363f3b0425f85..bf09fd5c0e2500b748859719892870b22155419d 100644 (file)
@@ -1,6 +1,6 @@
 dnl Autoconf settings for vlc
 
-AC_INIT(vlc,0.5.0-cvs-am)
+AC_INIT(vlc,0.5.0-cvs)
 
 CONFIGURE_LINE="$0 $*"
 CODENAME="Natalya"
@@ -11,7 +11,7 @@ AC_CANONICAL_SYSTEM
 
 dnl XXX: we don't put any flags here, because automake 1.5 doesn't support
 dnl them. And we need the comma otherwize automake will choke on it.
-AM_INIT_AUTOMAKE(vlc,0.5.0-cvs-am)
+AM_INIT_AUTOMAKE(vlc,0.5.0-cvs)
 AM_CONFIG_HEADER(config.h)
 
 dnl
@@ -49,10 +49,17 @@ dnl Find the right ranlib, even when cross-compiling
 AC_CHECK_TOOL(RANLIB, ranlib, :)
 AC_CHECK_TOOL(STRIP, strip, :)
 
+dnl
 dnl Gettext stuff
+dnl
 ALL_LINGUAS="de en_GB fr ja no ru nl pl se"
 AM_GNU_GETTEXT_VERSION(0.10.40)
 AM_GNU_GETTEXT
+if test "${nls_cv_force_use_gnu_gettext}" = "yes"; then
+  AC_DEFINE(HAVE_INCLUDED_GETTEXT, 1, Define if we use the local libintl)
+  INCLUDES="${INCLUDES} -I\\\$(top_srcdir)/intl"
+fi
+AM_CONDITIONAL(BUILD_INTL, test "${nls_cv_force_use_gnu_gettext}" = "yes")
 
 dnl AM_PROG_LIBTOOL
 AC_PROG_INSTALL
@@ -95,21 +102,34 @@ case "x${target_os}" in
     LDFLAGS_vlc="${LDFLAGS_vlc} -all_load"
     LIBEXT=".dylib"
     ;;
-  x*mingw32*)
-    SYS=mingw32
-    AC_CHECK_TOOL(WINDRES, windres, :)
-    CPPFLAGS_save="${CPPFLAGS_save} -D_OFF_T_ -D_off_t=long"; CPPFLAGS="${CPPFLAGS_save}"
-    LDFLAGS_vlc="${LDFLAGS_vlc} -lws2_32 -lnetapi32 -mwindows -Xlinker --force-exe-suffix"
-    LDFLAGS_ipv4="${LDFLAGS_ipv4} -lws2_32"
-    LDFLAGS_ipv6="${LDFLAGS_ipv6} -lws2_32"
-    LDFLAGS_access_http="${LDFLAGS_http} -lws2_32"
-    LDFLAGS_rc="${LDFLAGS_rc} -lws2_32"
-    LIBEXT=".dll"
-    ;;
-  x*cygwin*)
-    SYS=cygwin
+  x*mingw32* | x*cygwin*)
     AC_CHECK_TOOL(WINDRES, windres, :)
     LIBEXT=".dll"
+
+    case "x${target_os}" in
+      x*mingw32*)
+        SYS=mingw32
+        ;;
+      x*cygwin*)
+        dnl Check if we are using the mno-cygwin mode in which case we are
+        dnl actually dealing with a mingw32 compiler.
+        AC_EGREP_CPP(yes,
+            [#ifdef WIN32
+             yes
+             #endif],
+            SYS=mingw32, SYS=cygwin)
+        ;;
+    esac
+
+    if test "x$SYS" = "xmingw32"; then
+        CPPFLAGS_save="${CPPFLAGS_save} -D_OFF_T_ -D_off_t=long"
+        CPPFLAGS="${CPPFLAGS_save}"
+        LDFLAGS_vlc="${LDFLAGS_vlc} -lws2_32 -lnetapi32 -mwindows"
+        LDFLAGS_ipv4="${LDFLAGS_ipv4} -lws2_32"
+        LDFLAGS_ipv6="${LDFLAGS_ipv6} -lws2_32"
+        LDFLAGS_access_http="${LDFLAGS_http} -lws2_32"
+        LDFLAGS_rc="${LDFLAGS_rc} -lws2_32"
+    fi
     ;;
   x*nto*)
     SYS=nto
@@ -129,7 +149,7 @@ case "x${target_os}" in
     CXXFLAGS_save="${CXXFLAGS_save} -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual"; CXXFLAGS="${CXXFLAGS_save}"
     LDFLAGS_vlc="${LDFLAGS_vlc} -lbe"
     LDFLAGS_plugins="${LDFLAGS_plugins} -nostart"
-    LDFLAGS_beos="${LDFLAGS_beos} -lbe -lgame -lroot -ltracker -lstdc++.r4 -ltranslation"
+    LDFLAGS_beos="${LDFLAGS_beos} -lbe -lmedia -lroot -ltracker -lstdc++.r4 -ltranslation"
     LDFLAGS_ipv4="${LDFLAGS_ipv4} -lbind"
     ;;
   x*)
@@ -143,6 +163,16 @@ AM_CONDITIONAL(HAVE_WIN32, test "x${SYS}" = "xmingw32")
 AC_MSG_CHECKING(for suffix of libraries)
 AC_MSG_RESULT(${LIBEXT})
 
+dnl Check for the need to include the mingwex lib for mingw32
+if test x$SYS = xmingw32
+then
+    AC_CHECK_LIB(mingwex,opendir,
+        AC_CHECK_LIB(mingw32,opendir,LDFLAGS_vlc="${LDFLAGS_vlc}",
+            [LDFLAGS_vlc="${LDFLAGS_vlc} -lmingwex"
+             LDFLAGS_gtk="${LDFLAGS_gtk} -lmingwex"])
+    )
+fi
+
 dnl Check for fnative-struct or mms-bitfields support for mingw32
 if test x$SYS = xmingw32
 then
@@ -184,7 +214,12 @@ dnl The -DSYS_FOO flag
 CPPFLAGS_save="${CPPFLAGS_save} -DSYS_`echo ${SYS} | sed -e 's/-.*//' | tr 'abcdefghijklmnopqrstuvwxyz.' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`"; CPPFLAGS="${CPPFLAGS_save}"
 
 dnl Check for system libs needed
-AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol isatty vasprintf swab sigrelse getpwuid memalign posix_memalign gethostbyname2 atoll strndup)
+AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol isatty vasprintf swab sigrelse getpwuid memalign posix_memalign gethostbyname2 atoll)
+
+dnl Check for strndup
+need_strndup=false
+AC_CHECK_FUNCS(strndup,,[need_strndup=:])
+AM_CONDITIONAL(BUILD_STRNDUP, ${need_strndup})
 
 AC_CHECK_FUNC(connect,,[
   AC_CHECK_LIB(socket,connect,
@@ -281,8 +316,8 @@ AC_EGREP_HEADER(strncasecmp,strings.h,[
             Define if <strings.h> defines strncasecmp.)])
 
 dnl Check for headers
-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(signal.h time.h errno.h 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 sys/ioctl.h sys/stat.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 sys/shm.h)
@@ -290,6 +325,11 @@ AC_CHECK_HEADERS(linux/version.h)
 
 AC_HEADER_TIME
 
+dnl Check for dirent
+need_dirent=false
+AC_CHECK_HEADERS(dirent.h,,[need_dirent=:])
+AM_CONDITIONAL(BUILD_DIRENT, ${need_dirent})
+
 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,
@@ -438,6 +478,15 @@ if test "x${ac_cv_c_omit_frame_pointer}" != "xno"; then
     CFLAGS_i420_yuy2_mmx="${CFLAGS_i420_yuy2_mmx} -fomit-frame-pointer"
 fi
 
+dnl Check for -mdynamic-no-pic
+AC_CACHE_CHECK([if \$CC accepts -mdynamic-no-pic],
+    [ac_cv_c_dynamic_no_pic],
+    [CFLAGS="${CFLAGS_save} -mdynamic-no-pic"
+     AC_TRY_COMPILE([],,ac_cv_c_dynamic_no_pic=yes, ac_cv_c_dynamic_no_pic=no)])
+if test "x${ac_cv_c_dynamic_no_pic}" != "xno"; then
+    CFLAGS_builtins="${CFLAGS_OPTIM} -mdynamic-no-pic"
+fi
+
 dnl Check for Darwin plugin linking flags
 AC_CACHE_CHECK([if \$CC accepts -bundle -undefined error -lcc_dynamic],
     [ac_cv_ld_darwin],
@@ -507,21 +556,21 @@ esac
 dnl
 dnl  default modules
 dnl
-PLUGINS="${PLUGINS} dummy null"
-PLUGINS="${PLUGINS} rc logger access_file memcpy"
+PLUGINS="${PLUGINS} dummy rc logger access_file memcpy"
 PLUGINS="${PLUGINS} es audio mpeg_system ps ts"
 PLUGINS="${PLUGINS} idct idctclassic motion mpeg_video spudec mpeg_audio"
 #PLUGINS="${PLUGINS} a52old imdct downmix"
 PLUGINS="${PLUGINS} lpcm a52"
-PLUGINS="${PLUGINS} deinterlace invert wall transform distort clone crop motionblur"
-PLUGINS="${PLUGINS} float32tos16 float32tos8 float32tou16 float32tou8 a52tospdif fixed32tofloat32 fixed32tos16 s16tofloat32 s16tofloat32swab"
-PLUGINS="${PLUGINS} trivial_resampler ugly_resampler"
+PLUGINS="${PLUGINS} deinterlace invert yuv wall transform distort clone crop motionblur"
+PLUGINS="${PLUGINS} float32tos16 float32tos8 float32tou16 float32tou8 a52tospdif fixed32tofloat32 fixed32tos16 s16tofloat32 s16tofloat32swab s8tofloat32 u8tofloat32"
+PLUGINS="${PLUGINS} trivial_resampler ugly_resampler linear_resampler"
 PLUGINS="${PLUGINS} trivial_channel_mixer"
 PLUGINS="${PLUGINS} trivial_mixer spdif_mixer"
 PLUGINS="${PLUGINS} aout_file"
 #PLUGINS="${PLUGINS} scope"
 PLUGINS="${PLUGINS} i420_rgb i420_yuy2 i422_yuy2 i420_ymga"
 PLUGINS="${PLUGINS} id3"
+PLUGINS="${PLUGINS} wav araw"
 
 dnl
 dnl  Network modules
@@ -724,7 +773,8 @@ then
     then
       AC_CHECK_HEADERS(dvdcss/dvdcss.h,
         [ PLUGINS="${PLUGINS} dvd"
-          LDFLAGS_dvd="${LDFLAGS_dvd} -ldvdcss" ],
+          LDFLAGS_dvd="${LDFLAGS_dvd} -ldvdcss"
+          LDFLAGS_dvdcss="${LDFLAGS_dvdcss} -ldvdcss" ],
         [ AC_MSG_WARN([libdvdcss is no longer provided with vlc; please get libdvdcss from http://www.videolan.org/libdvdcss/ and build it. Then either use --with-dvdcss=<path/where/libdvdcss/was/installed> for dynamic linking (recommended under Unix) or --with-dvdcss-tree=<path/where/libdvdcss/was/built> for static linking (recommended under BeOS, Windows, MacOS X). Alternatively you can use --disable-dvd to disable the DVD plugin.])
           AC_MSG_ERROR([cannot find libdvdcss headers]) ])
     else
@@ -742,6 +792,7 @@ then
         AC_MSG_RESULT(${real_dvdcss_tree}/src/.libs/libdvdcss.a)
         BUILTINS="${BUILTINS} dvd"
         LDFLAGS_dvd="${LDFLAGS_dvd} ${real_dvdcss_tree}/src/.libs/libdvdcss.a"
+        LDFLAGS_dvdcss="${LDFLAGS_dvdcss} ${real_dvdcss_tree}/src/.libs/libdvdcss.a"
         CPPFLAGS_dvd="${CPPFLAGS_dvd} -I${real_dvdcss_tree}/src"
       else
         dnl  The given libdvdcss wasn't built
@@ -764,6 +815,7 @@ then
       AC_MSG_RESULT(yes)
       PLUGINS="${PLUGINS} dvd"
       LDFLAGS_dvd="${LDFLAGS_dvd} -L${with_dvdcss}/lib -ldvdcss"
+      LDFLAGS_dvdcss="${LDFLAGS_dvdcss} -L${with_dvdcss}/lib -ldvdcss"
       CPPFLAGS_dvd="${CPPFLAGS_dvd} -I${with_dvdcss}/include"
     else
       dnl  No libdvdcss could be found, sorry
@@ -796,7 +848,7 @@ then
      AC_TRY_COMPILE([#include <dvdread/dvd_reader.h>],
         [int foo() { return DVD_VIDEO_LB_LEN; }],[
           PLUGINS="${PLUGINS} dvdread"
-          LDFLAGS_dvdread="${LDFLAGS_dvdread} ${LDFLAGS_test} -ldvdread"
+          LDFLAGS_dvdread="${LDFLAGS_dvdread} ${LDFLAGS_test} -ldvdread ${LDFLAGS_dvdcss}"
           CPPFLAGS_dvdread="${CPPFLAGS_dvdread} ${CPPFLAGS_test}"
         ],[
           if test "x${enable_dvdread}" != "x"
@@ -838,7 +890,7 @@ then
   CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_test}"
   AC_CHECK_HEADERS(dvdplay/dvdplay.h, [
       PLUGINS="${PLUGINS} dvdplay"
-      LDFLAGS_dvdplay="${LDFLAGS_dvdplay} ${LDFLAGS_test} -ldvdplay -ldvdread"
+      LDFLAGS_dvdplay="${LDFLAGS_dvdplay} ${LDFLAGS_test} -ldvdplay -ldvdread ${LDFLAGS_dvdcss}"
       CPPFLAGS_dvdplay="${CPPFLAGS_dvdplay} ${CPPFLAGS_test}"
     ],[
     if test "x${enable_dvdplay}" != x
@@ -942,7 +994,7 @@ dnl
 dnl  VCD module
 dnl
 AC_ARG_ENABLE(vcd,
-  [  --enable-vcd            VCD support for Linux, FreeBSD and MacOS X (default enabled)])
+  [  --enable-vcd            VCD support for Linux, FreeBSD, MacOS X and Win32 (default enabled)])
 
 if test "x${enable_vcd}" != "xno"
 then
@@ -955,14 +1007,14 @@ then
     AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
   ])
 
-  if test "x${SYS}" = "xbsdi"
+  if test "x${SYS}" = "xbsdi" -o "x${SYS}" = "xmingw32"
   then
     PLUGINS="${PLUGINS} vcd"
   fi
 
   if test "x${SYS}" = "xdarwin"
   then
-    # No need to add vcd to PLUGINS, Darwin is already based on FreeBSD
+    PLUGINS="${PLUGINS} vcd"
     LDFLAGS_vcd="${LDFLAGS_vcd} -framework IOKit -framework CoreFoundation"
   fi
 fi
@@ -1012,6 +1064,16 @@ then
   PLUGINS="${PLUGINS} avi"
 fi
 
+dnl
+dnl  ASF demux plugin
+dnl
+AC_ARG_ENABLE(asf,
+  [  --enable-asf            ASF demux module (default enabled)])
+if test "x${enable_asf}" != "xno"
+then
+  PLUGINS="${PLUGINS} asf"
+fi
+
 dnl
 dnl  AAC demux plugin
 dnl
@@ -1022,6 +1084,19 @@ then
   PLUGINS="${PLUGINS} aac"
 fi
 
+dnl
+dnl  ogg plugin
+dnl
+AC_ARG_ENABLE(ogg,
+  [  --enable-ogg            Ogg demux support (default enabled)])
+if test "x${enable_ogg}" != "xno"
+then
+  AC_CHECK_HEADERS(ogg/ogg.h, [
+    PLUGINS="${PLUGINS} ogg"
+    LDFLAGS_ogg="${LDFLAGS_ogg} -logg"
+   ],[])
+fi
+
 dnl
 dnl  Codec plugins
 dnl
@@ -1209,6 +1284,61 @@ then
 fi
 
 
+dnl
+dnl  xvid decoder plugin
+dnl
+AC_ARG_ENABLE(xvid,
+[  --enable-xvid           xvid codec (default disabled)])
+if test "x${enable_xvid}" = "xyes"
+then
+  AC_ARG_WITH(xvid,
+    [    --with-xvid=PATH      path to xvid installation],[],[])
+  if test "x${with_xvid}" != "xno" -a "x${with_xvid}" != "x"
+  then
+    CPPFLAGS_xvid="${CPPFLAGS_xvid} -I${with_xvid}/include"
+    LDFLAGS_xvid="${LDFLAGS_xvid} -L${with_xvid}/lib"
+  fi
+  LDFLAGS_xvid="${LDFLAGS_xvid}"
+
+  AC_ARG_WITH(xvid-tree,
+  [    --with-xvid-tree=PATH xvid tree for static linking])
+  if test "x${with_xvid_tree}" != "x"
+  then
+    AC_MSG_CHECKING(for libxvidcore.a in ${with_xvid_tree})
+    real_xvid_tree="`cd ${with_xvid_tree} 2>/dev/null && pwd`"
+    if test "x${real_xvid_tree}" = x
+    then
+      dnl  The given directory can't be found
+      AC_MSG_RESULT(no)
+      AC_MSG_ERROR([cannot cd to ${with_xvid_tree}])
+    fi
+    if test -f "${real_xvid_tree}/build/generic/libxvidcore.a"
+    then
+      dnl  Use a custom xvid
+      AC_MSG_RESULT(${real_xvid_tree}/build/generic/libxvidcore.a)
+      BUILTINS="${BUILTINS} xvid"
+      LDFLAGS_xvid="${LDFLAGS_xvid} ${real_xvid_tree}/build/generic/libxvidcore.a"
+      CPPFLAGS_xvid="${CPPFLAGS_xvid} -I${real_xvid_tree}/src"
+    else
+      dnl  The given libxvidcore wasn't built
+      AC_MSG_RESULT(no)
+      AC_MSG_ERROR([cannot find ${real_xvid_tree}/build/generic/libxvidcore.a, make sure you compiled libxvidcore in ${with_xvid_tree}])
+    fi
+  else
+    CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_xvid}"
+    LDFLAGS="${LDFLAGS_save} ${LDFLAGS_xvid}"
+    AC_CHECK_HEADERS(xvid.h, ,
+      [ AC_MSG_ERROR([Cannot find development headers for libxvidcore...]) ])
+    AC_CHECK_LIB(xvid, xvid_init, [
+      PLUGINS="${PLUGINS} xvid"
+      LDFLAGS_xvid="${LDFLAGS_xvid} -lxvid" ],
+      [ AC_MSG_ERROR([Cannot find libxvidcore library...]) ])
+    LDFLAGS="${LDFLAGS_save}"
+    CPPFLAGS="${CPPFLAGS_save}"
+  fi
+fi
+
+
 
 dnl
 dnl MP4 module
@@ -1306,20 +1436,6 @@ then
   PLUGINS="${PLUGINS} cinepak"
 fi
 
-dnl
-dnl  ogg vorbis plugin
-dnl
-AC_ARG_ENABLE(vorbis,
-  [  --enable-vorbis         Ogg/Vorbis decoder support (default enabled)])
-if test "x${enable_vorbis}" != "xno"
-then
-  AC_CHECK_HEADERS(ogg/ogg.h, [
-    dnl disabled for the moment
-    #PLUGINS="${PLUGINS} ogg vorbis"
-    LDFLAGS_vorbis="${LDFLAGS_vorbis} -lvorbis"
-   ],[])
-fi
-
 dnl
 dnl  DV plugin
 dnl
@@ -1333,6 +1449,19 @@ then
    ],[])
 fi
 
+dnl
+dnl  Vorbis plugin
+dnl
+AC_ARG_ENABLE(vorbis,
+  [  --enable-vorbis            Vorbis decoder support (default enabled)])
+if test "x${enable_vorbis}" != "xno"
+then
+  AC_CHECK_HEADERS(vorbis/codec.h, [
+    PLUGINS="${PLUGINS} vorbis"
+    LDFLAGS_vorbis="${LDFLAGS_vorbis} -lvorbis -logg"
+   ],[])
+fi
+
 dnl
 dnl  Video plugins
 dnl
@@ -1484,22 +1613,23 @@ AC_ARG_ENABLE(directx,
   [  --enable-directx        Win32 DirectX support (default enabled on Win32)])
 if test "x${enable_directx}" != "xno"
 then
-  if test "x${SYS}" = "xmingw32"
+  if test "x${SYS}" = "xmingw32" -o "x${SYS}" = "xcygwin"
   then
     AC_ARG_WITH(directx,
     [    --with-directx=PATH   Win32 DirectX headers])
     if test "x${with_directx}" = "x"
     then
       AC_CHECK_HEADERS(ddraw.h,
-      [ PLUGINS="${PLUGINS} directx"
-        LDFLAGS_directx="${LDFLAGS_directx} -lgdi32" ])
+      [ PLUGINS="${PLUGINS} vout_directx aout_directx"
+        LDFLAGS_vout_directx="${LDFLAGS_directx} -lgdi32" ])
     else
       AC_MSG_CHECKING(for directX headers in ${with_directx})
       if test -f ${with_directx}/ddraw.h
       then
-        PLUGINS="${PLUGINS} directx"
-        LDFLAGS_directx="${LDFLAGS_directx} -lgdi32"
-        CPPFLAGS_directx="${CPPFLAGS_directx} -I${with_directx}"
+        PLUGINS="${PLUGINS} vout_directx aout_directx"
+        LDFLAGS_vout_directx="${LDFLAGS_directx} -lgdi32"
+        CPPFLAGS_vout_directx="${CPPFLAGS_vout_directx} -I${with_directx}"
+        CPPFLAGS_aout_directx="${CPPFLAGS_aout_directx} -I${with_directx}"
         AC_MSG_RESULT(yes)
       else
         AC_MSG_RESULT(no)
@@ -1667,10 +1797,11 @@ dnl  win32 waveOut plugin
 dnl
 AC_ARG_ENABLE(waveout,
   [  --enable-waveout        Win32 waveOut module (default enabled on Win32)])
-if test "x${enable_waveout}" != "xno" -a "x${SYS}" = "xmingw32"
-  then
+if test "x${enable_waveout}" != "xno"; then
+  if test "x${SYS}" = "xmingw32" -o "x${SYS}" = "xcygwin"; then
     PLUGINS="${PLUGINS} waveout"
     LDFLAGS_waveout="-lwinmm"
+  fi
 fi
 
 dnl
@@ -1712,8 +1843,13 @@ then
     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 gthread`"
-    LDFLAGS_gtk="${LDFLAGS_gtk} `${GTK_CONFIG} --libs gtk gthread | sed 's,-rdynamic,,'`"
+    if test "x${SYS}" != "xmingw32"; then
+      CFLAGS_gtk="${CFLAGS_gtk} `${GTK_CONFIG} --cflags gtk gthread`"
+      LDFLAGS_gtk="${LDFLAGS_gtk} `${GTK_CONFIG} --libs gtk gthread | sed 's,-rdynamic,,'`"
+    else
+      CFLAGS_gtk="${CFLAGS_gtk} `${GTK_CONFIG} --cflags gtk`"
+      LDFLAGS_gtk="${LDFLAGS_gtk} `${GTK_CONFIG} --libs gtk | sed 's,-rdynamic,,'`"
+    fi
     # now look for the gtk.h header
     CPPFLAGS="${CPPFLAGS_save} ${CFLAGS_gtk}"
     ac_cv_gtk_headers=yes
@@ -2056,8 +2192,10 @@ AC_ARG_ENABLE(st,
     fi])
 ])
 
-LDFLAGS_vlc="${LDFLAGS_vlc} ${THREAD_LIB}"
-LDFLAGS_plugins="${LDFLAGS_plugins} ${THREAD_LIB}"
+if test "x${SYS}" != "xmingw32"; then
+  LDFLAGS_vlc="${LDFLAGS_vlc} ${THREAD_LIB}"
+  LDFLAGS_plugins="${LDFLAGS_plugins} ${THREAD_LIB}"
+fi
 
 dnl
 dnl  Mozilla plugin
@@ -2091,13 +2229,32 @@ then
 fi
 AM_CONDITIONAL(BUILD_MOZILLA,${mozilla})
 
+dnl
+dnl  test plugins
+dnl
+AC_ARG_ENABLE(testsuite,
+  [  --enable-testsuite      build test modules (default disabled)])
+if test "x${enable_testsuite}" = "xyes"
+then
+  TESTS="test1 test2 test3 test4"
+
+  dnl  we define those so that bootstrap sets the right linker
+  CXXFLAGS_test2="${CXXFLAGS_test2}"
+  OBJCFLAGS_test3="${OBJCFLAGS_test3}"
+  dnl  this one is needed until automake knows what to do
+  LDFLAGS_test3="${LDFLAGS_test3} -lobjc"
+
+  PLUGINS="${PLUGINS} ${TESTS}"
+  #BUILTINS="${BUILTINS} ${TESTS}"
+fi
+
 dnl
 dnl  gtk_main plugin
 dnl
 if test "x${NEED_GTK_MAIN}" != "xno"
 then
     PLUGINS="${PLUGINS} gtk_main"
-    CFLAGS_gtk = "${CFLAGS_gtk} -DNEED_GTK_MAIN"
+    CFLAGS_gtk="${CFLAGS_gtk} -DNEED_GTK_MAIN"
     CFLAGS_gtk_main="${CFLAGS_gtk_main} ${CFLAGS_gtk} ${CFLAGS_familiar}"
     LDFLAGS_gtk_main="${LDFLAGS_gtk_main} ${LDFLAGS_gtk} ${LDFLAGS_familiar}"
 fi
@@ -2123,8 +2280,9 @@ AC_ARG_ENABLE(plugins,
      plugin_support=false
    fi])
 
-dnl Automagically disable plugins if there is no system support for .so files
-dnl don't forget vlc-win32 still can load .so as plugins
+dnl Automagically disable plugins if there is no system support for
+dnl dynamically loadable files (.so, .dll, .dylib).
+dnl don't forget vlc-win32 still can load .dll as plugins
 if test "x${ac_cv_header_dlfcn_h}" = "xno" -a "x${ac_cv_header_image_h}" = "xno" -a "x${SYS}" != "xmingw32"
 then
   echo "*** Your system doesn't have plugin support. All plugins will be built"
@@ -2137,7 +2295,7 @@ if ${plugin_support}
 then
   for plugin in `echo ${PLUGINS}`
   do
-    typeset ${plugin}_plugin=yes
+    eval "${plugin}_plugin=yes"
   done
 else
   BUILTINS="${BUILTINS} ${PLUGINS}"
@@ -2150,7 +2308,7 @@ then
   builtin_support=:
   for builtin in `echo ${BUILTINS}`
   do
-    typeset ${builtin}_builtin=yes
+    eval "${builtin}_builtin=yes"
   done
 fi]
 AM_CONDITIONAL(HAVE_BUILTINS, ${builtin_support})
@@ -2161,7 +2319,7 @@ dnl do not touch this line (bootstrap needs it)
 dnl
 dnl  Stuff used by the program
 dnl
-AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "vlc ${VERSION} ${CODENAME} Copyright 1996-2002 VideoLAN", [Simple version string])
+AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "${VERSION} ${CODENAME}", [Simple version string])
 AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "VideoLAN Client - version ${VERSION} ${CODENAME} - (c) 1996-2002 VideoLAN", [Copyright string])
 AC_DEFINE_UNQUOTED(CONFIGURE_LINE, "${CONFIGURE_LINE}", [The ./configure command line])
 
@@ -2210,6 +2368,7 @@ AC_SUBST(WINDRES)
 AC_SUBST(BCBUILDER)
 AC_SUBST(XPIDL)
 AC_SUBST(LIBEXT)
+AC_SUBST(INCLUDES)
 
 AC_SUBST(CFLAGS_TUNING)
 AC_SUBST(CFLAGS_OPTIM)