]> git.sesse.net Git - vlc/blobdiff - configure.ac
* marq.c: const strings
[vlc] / configure.ac
index 5d2710e8623c0e82f2fcba62cc391280a20c4c2b..569b6f4c44fa2cced2681cb5d4dc4408b03e75ab 100644 (file)
@@ -171,11 +171,10 @@ case "${host_os}" in
     CFLAGS_save="${CFLAGS_save} -no-cpp-precomp -D_INTL_REDIRECT_MACROS"; CFLAGS="${CFLAGS_save}"
     CXXFLAGS_save="${CXXFLAGS_save} -no-cpp-precomp -D_INTL_REDIRECT_MACROS"; CXXFLAGS="${CXXFLAGS_save}"
     OBJCFLAGS_save="${OBJCFLAGS_save} -no-cpp-precomp -D_INTL_REDIRECT_MACROS -std=gnu99"; OBJCFLAGS="${OBJCFLAGS_save}"
-    VLC_ADD_LDFLAGS([vlc ffmpeg ffmpegaltivec],[-all_load])
+    VLC_ADD_LDFLAGS([libvlc ffmpeg ffmpegaltivec],[-all_load])
     VLC_ADD_LDFLAGS([mkv mp4], [-framework IOKit -framework CoreFoundation])
-    VLC_ADD_CFLAGS([libvlc],[-x objective-c])
-    VLC_ADD_CFLAGS([vlc],[-x objective-c])
-    VLC_ADD_LDFLAGS([vlc],[-Wl,-m -Wl,-multiply_defined -Wl,suppress])
+    VLC_ADD_CFLAGS([libvlc vlc],[-x objective-c])
+    VLC_ADD_LDFLAGS([libvlc vlc],[-Wl,-m -Wl,-multiply_defined -Wl,suppress])
     ;;
   darwin*)
     SYS=darwin
@@ -184,8 +183,7 @@ case "${host_os}" in
     OBJCFLAGS_save="${OBJCFLAGS_save} -D_INTL_REDIRECT_MACROS -std=gnu99"; OBJCFLAGS="${OBJCFLAGS_save}"
     VLC_ADD_LDFLAGS([mp4], [-framework IOKit -framework CoreFoundation])
     VLC_ADD_LDFLAGS([mkv mp4], [-framework IOKit -framework CoreFoundation])
-    VLC_ADD_CFLAGS([libvlc],[-x objective-c])
-    VLC_ADD_CFLAGS([vlc],[-x objective-c])
+    VLC_ADD_CFLAGS([libvlc vlc],[-x objective-c])
     ;;
   *mingw32* | *cygwin* | *wince* | *mingwce* | *pe*)
     AC_CHECK_TOOL(WINDRES, windres, :)
@@ -212,15 +210,15 @@ case "${host_os}" in
     if test "${SYS}" = "mingw32"; then
         # add ws2_32 for closesocket, select, recv
         CPPFLAGS_save="${CPPFLAGS_save} -D_OFF_T_ -D_off_t=long"; CPPFLAGS="${CPPFLAGS_save}"
-        VLC_ADD_LDFLAGS([vlc],[-lws2_32 -lnetapi32 -lwinmm -mwindows])
+        VLC_ADD_LDFLAGS([libvlc],[-lws2_32 -lnetapi32 -lwinmm -mwindows])
         VLC_ADD_LDFLAGS([cdda vcdx cddax],[-lwinmm])
         VLC_ADD_LDFLAGS([access_http access_mms access_udp access_tcp access_ftp access_output_udp sap slp http stream_out_standard stream_out_rtp vod_rtsp telnet netsync growl],[-lws2_32])
     fi
     if test "${SYS}" = "mingwce"; then
         # add ws2 for closesocket, select, recv
         CPPFLAGS_save="${CPPFLAGS_save} -D_OFF_T_ -D_off_t=long"; CPPFLAGS="${CPPFLAGS_save}"
-        VLC_ADD_CPPFLAGS([vlc],[-Dmain(a,b)=maince(a,b)])
-        VLC_ADD_LDFLAGS([vlc],[-lws2 -e WinMainCRTStartup])
+        VLC_ADD_CPPFLAGS([libvlc vlc],[-Dmain(a,b)=maince(a,b)])
+        VLC_ADD_LDFLAGS([libvlc vlc],[-lws2 -e WinMainCRTStartup])
         VLC_ADD_LDFLAGS([access_http access_mms access_udp access_tcp access_ftp access_output_udp sap http netsync],[-lws2])
    fi
     ;;
@@ -242,16 +240,16 @@ case "${host_os}" in
     CFLAGS_save="${CFLAGS_save} -Wno-multichar"; CFLAGS="${CFLAGS_save}"
     CXXFLAGS_save="${CXXFLAGS_save} -Wno-multichar"; CXXFLAGS="${CXXFLAGS_save}"
     VLC_ADD_CXXFLAGS([beos],[])
-    VLC_ADD_LDFLAGS([vlc logger],[-lbe])
+    VLC_ADD_LDFLAGS([vlc libvlc logger],[-lbe])
     VLC_ADD_LDFLAGS([beos],[-lbe -lmedia -ltranslation -ltracker -lgame])
     VLC_ADD_LDFLAGS([dvdnav dvdread],[-ldl])
     VLC_ADD_LDFLAGS([access_file],[-lpoll])
     LDFLAGS_save="${LDFLAGS_save} -lintl"; LDFLAGS="${LDFLAGS_save}"
     dnl Check for BONE
     if test -f /boot/beos/system/lib/libbind.so; then
-        VLC_ADD_LDFLAGS([access_file access_ftp access_mms access_output_udp telnet netsync sap vlc growl],[-lbind -lsocket])
+        VLC_ADD_LDFLAGS([access_file access_ftp access_mms access_output_udp telnet netsync sap libvlc growl],[-lbind -lsocket])
     else
-        VLC_ADD_LDFLAGS([access_file access_ftp access_mms access_output_udp telnet netsync sap vlc growl],[-lnet])
+        VLC_ADD_LDFLAGS([access_file access_ftp access_mms access_output_udp telnet netsync sap libvlc growl],[-lnet])
     fi
 
     dnl Ugly check for Zeta
@@ -281,7 +279,7 @@ m4_defun([AC_PROG_F77],[])
 AC_PROG_LIBTOOL
 
 AC_ARG_ENABLE(libtool,
-    [  --enable-libtool        use libtool (default disabled)])
+    [  --enable-libtool        use libtool (default enabled)])
 AM_CONDITIONAL(USE_LIBTOOL, [test "x${enable_libtool}" != "xno"])
 
 
@@ -315,9 +313,9 @@ AS_IF([test "${nls_cv_force_use_gnu_gettext}" = "yes"], [
   ])
 ], [
   AS_IF([test "${enable_libtool}" != "no"], [
-    VLC_ADD_LDFLAGS([vlc], [${LTLIBINTL}])
+    VLC_ADD_LDFLAGS([libvlc vlc], [${LTLIBINTL}])
   ], [
-    VLC_ADD_LDFLAGS([vlc], [${LIBINTL}])
+    VLC_ADD_LDFLAGS([libvlc vlc], [${LIBINTL}])
   ])
 ])
 AC_SUBST(INCLUDED_LIBINTL)
@@ -330,19 +328,19 @@ if test "${SYS}" != "mingwce"; then
 AS_IF([test "$am_cv_func_iconv" != "yes"],
        [AC_MSG_ERROR([libiconv is needed for VLC to work properly])])
 fi
-VLC_ADD_CFLAGS([vlc],[${INCICONV}])
+VLC_ADD_CFLAGS([libvlc],[${INCICONV}])
 AS_IF([test "${enable_libtool}" != "no"], [
-  VLC_ADD_LDFLAGS([vlc],[${LIBICONV}])
+  VLC_ADD_LDFLAGS([libvlc vlc],[${LIBICONV}])
 ],[
-  VLC_ADD_LDFLAGS([vlc],[${LTLIBICONV}])
+  VLC_ADD_LDFLAGS([libvlc vlc],[${LTLIBICONV}])
 ])
 
 dnl Check for the need to include the mingwex lib for mingw32
 if test "${SYS}" = "mingw32"
 then
     AC_CHECK_LIB(mingwex,opendir,
-        AC_CHECK_LIB(mingw32,opendir,VLC_ADD_LDFLAGS([vlc],[]),
-            [VLC_ADD_LDFLAGS([vlc gtk],[-lmingwex])])
+        AC_CHECK_LIB(mingw32,opendir,VLC_ADD_LDFLAGS([libvlc],[]),
+            [VLC_ADD_LDFLAGS([libvlc gtk],[-lmingwex])])
     )
 fi
 
@@ -444,7 +442,7 @@ fi
 
 AC_CHECK_FUNCS(connect,,[
   AC_CHECK_LIB(socket,connect,[
-    VLC_ADD_LDFLAGS([vlc cdda cddax],-lsocket)
+    VLC_ADD_LDFLAGS([libvlc cdda cddax],-lsocket)
     LIBS_socket="-lsocket"
   ])
 ])
@@ -457,7 +455,7 @@ AC_CHECK_FUNCS(send,,[
 
 AC_CHECK_FUNCS(gethostbyname,,[
   AC_CHECK_LIB(nsl,gethostbyname,[
-    VLC_ADD_LDFLAGS([cdda cddax vlc],[-lnsl])
+    VLC_ADD_LDFLAGS([cdda cddax libvlc],[-lnsl])
   ],[
     AC_CHECK_LIB(bind,gethostbyname,[
       VLC_ADD_LDFLAGS([access_mms],[-lbind])
@@ -545,7 +543,7 @@ fi
 
 AC_CHECK_FUNCS(inet_aton,,[
   AC_CHECK_LIB(resolv,inet_aton,[
-    VLC_ADD_LDFLAGS([vlc],[-lresolv])
+    VLC_ADD_LDFLAGS([libvlc],[-lresolv])
   ])
 ])
 
@@ -558,7 +556,7 @@ AC_CHECK_FUNCS(getopt_long,[AC_DEFINE(HAVE_GETOPT_LONG,1,long getopt support)],
 [ # FreeBSD has a gnugetopt library for this:
   AC_CHECK_LIB([gnugetopt],[getopt_long],
     [AC_DEFINE(HAVE_GETOPT_LONG,1,getopt support)
-     VLC_ADD_LDFLAGS([vlc],[-lgnugetopt])],
+     VLC_ADD_LDFLAGS([libvlc],[-lgnugetopt])],
     [need_getopt=:])])
 fi
 AM_CONDITIONAL(BUILD_GETOPT, ${need_getopt})
@@ -569,7 +567,7 @@ AC_CHECK_LIB(m,cos,[
   VLC_ADD_LDFLAGS([adjust wave ripple psychedelic gradient a52tofloat32 dtstofloat32 x264 goom visual panoramix rotate noise],[-lm])
 ])
 AC_CHECK_LIB(m,pow,[
-  VLC_ADD_LDFLAGS([ffmpeg ffmpegaltivec stream_out_transrate i420_rgb faad twolame equalizer param_eq vlc vorbis freetype mod mpc dmo quicktime realaudio galaktos opengl],[-lm])
+  VLC_ADD_LDFLAGS([ffmpeg ffmpegaltivec stream_out_transrate i420_rgb faad twolame equalizer param_eq libvlc vorbis freetype mod mpc dmo quicktime realaudio galaktos opengl],[-lm])
 ])
 AC_CHECK_LIB(m,sqrt,[
   VLC_ADD_LDFLAGS([headphone_channel_mixer normvol speex mono colorthres],[-lm])
@@ -599,7 +597,7 @@ if test "${ac_cv_have_plugins}" = "no"; then
    [ac_cv_my_have_shl_load=yes,
     AC_CHECK_LIB(dld, shl_load,
      [ac_cv_my_have_shl_load=yes
-      VLC_ADD_LDFLAGS([vlc],[-ldld])])])
+      VLC_ADD_LDFLAGS([libvlc],[-ldld])])])
   if test "${ac_cv_my_have_shl_load}" = "yes"; then
     AC_DEFINE(HAVE_DL_SHL_LOAD, 1, [Define if you have the shl_load API])
     ac_cv_have_plugins=yes
@@ -609,7 +607,7 @@ fi
 # Whatever style
 if test "${ac_cv_have_plugins}" = "no"; then
   AC_CHECK_LIB(dld, dld_link,
-   [VLC_ADD_LDFLAGS([vlc],[-ldld])
+   [VLC_ADD_LDFLAGS([libvlc],[-ldld])
     AC_DEFINE(HAVE_DL_DLD_LINK, 1, [Define if you have the GNU dld library])
     ac_cv_have_plugins=yes])
 fi
@@ -618,7 +616,7 @@ fi
 if test "${ac_cv_have_plugins}" = "no"; then
   if test "${SYS}" = "mingw32" -o "${SYS}" = "cygwin"; then
     AC_CHECK_LIB(kernel32, main,
-     [VLC_ADD_LDFLAGS([vlc],[-lkernel32])
+     [VLC_ADD_LDFLAGS([libvlc],[-lkernel32])
       AC_DEFINE(HAVE_DL_WINDOWS, 1, [Define if you have Windows' LoadLibrary])
       ac_cv_have_plugins=yes])
   fi
@@ -648,10 +646,10 @@ if test "${ac_cv_have_plugins}" = "no"; then
     ac_cv_my_have_dlopen=yes,
     AC_CHECK_LIB(dl, dlopen,
       ac_cv_my_have_dlopen=yes
-      VLC_ADD_LDFLAGS([vlc],[-ldl]),
+      VLC_ADD_LDFLAGS([libvlc],[-ldl]),
       AC_CHECK_LIB(svld, dlopen,
         ac_cv_my_have_dlopen=yes
-        VLC_ADD_LDFLAGS([vlc],[-lsvld]))))
+        VLC_ADD_LDFLAGS([libvlc],[-lsvld]))))
   if test "${ac_cv_my_have_dlopen}" = "yes"; then
     AC_DEFINE(HAVE_DL_DLOPEN, 1, [Define if you have the dlopen API])
     ac_cv_have_plugins=yes
@@ -716,24 +714,24 @@ AC_ARG_ENABLE(st,
     fi
 ])
 
-VLC_ADD_LDFLAGS([vlc plugin],[${THREAD_LIB}])
+VLC_ADD_LDFLAGS([libvlc plugin],[${THREAD_LIB}])
 
 dnl Don't link with rt when using GNU-pth
 if test "${THREAD_LIB}" != "-lpth" && test "${THREAD_LIB}" != "-lst"; then
   AC_CHECK_LIB(rt, clock_nanosleep, [
-    VLC_ADD_LDFLAGS([vlc],[-lrt])
+    VLC_ADD_LDFLAGS([libvlc],[-lrt])
     AC_DEFINE(HAVE_CLOCK_NANOSLEEP, 1, [Define to 1 if you have clock_nanosleep.])
   ], [
     dnl HP/UX port
-    AC_CHECK_LIB(rt,sem_init, [VLC_ADD_LDFLAGS([vlc],[-lrt])])
+    AC_CHECK_LIB(rt,sem_init, [VLC_ADD_LDFLAGS([libvlc],[-lrt])])
   ])
 
   have_nanosleep=false
   AC_CHECK_FUNCS(nanosleep,have_nanosleep=:,[
     AC_CHECK_LIB(rt,nanosleep,
-      [VLC_ADD_LDFLAGS([vlc],[-lrt]) have_nanosleep=:],
+      [VLC_ADD_LDFLAGS([libvlc],[-lrt]) have_nanosleep=:],
       [AC_CHECK_LIB(posix4,nanosleep,
-          [VLC_ADD_LDFLAGS([vlc],[-lposix4]) have_nanosleep=:])]
+          [VLC_ADD_LDFLAGS([libvlc],[-lposix4]) have_nanosleep=:])]
     )
   ])
   if ${have_nanosleep}; then
@@ -829,14 +827,14 @@ then
     [ AC_DEFINE( HAVE_HAL_1, [] , [Define if you have the new HAL library API])
       AC_DEFINE( HAVE_HAL, [], [Define if you have the HAL library] )
       VLC_ADD_PLUGINS([hal probe_hal]) 
-      VLC_ADD_LDFLAGS([vlc hal probe_hal],[$HAL_LIBS])
-      VLC_ADD_CFLAGS([vlc hal probe_hal],[$HAL_CFLAGS])],   
+      VLC_ADD_LDFLAGS([libvlc hal probe_hal],[$HAL_LIBS])
+      VLC_ADD_CFLAGS([libvlc hal probe_hal],[$HAL_CFLAGS])],   
     dnl No hal 0.5 Test for 0.2
     [ PKG_CHECK_MODULES( HAL, hal >= 0.2.97, 
        [AC_DEFINE(HAVE_HAL, [], [Define if you have the HAL library])
         VLC_ADD_PLUGINS([hal])
-        VLC_ADD_LDFLAGS([vlc hal],[$HAL_LIBS])
-        VLC_ADD_CFLAGS([vlc hal],[$HAL_CFLAGS])],
+        VLC_ADD_LDFLAGS([libvlc hal],[$HAL_LIBS])
+        VLC_ADD_CFLAGS([libvlc hal],[$HAL_CFLAGS])],
        [AC_MSG_WARN(HAL library not found)])
     ]
   )
@@ -854,8 +852,8 @@ then
       AC_DEFINE( HAVE_DBUS_2, 1, [Define if you have the D-BUS library API >= 0.92] )
       AC_DEFINE( HAVE_DBUS_1, 1, [Define if you have the D-BUS library API >= 0.30] )
       AC_DEFINE( HAVE_DBUS, 1, [Define if you have the D-BUS library] )
-      VLC_ADD_LDFLAGS([screensaver vlc],[$DBUS_LIBS])
-      VLC_ADD_CFLAGS([screensaver vlc],[$DBUS_CFLAGS])
+      VLC_ADD_LDFLAGS([screensaver libvlc],[$DBUS_LIBS])
+      VLC_ADD_CFLAGS([screensaver libvlc],[$DBUS_CFLAGS])
       dnl Check for dbus control interface
         AC_ARG_ENABLE(dbus-control, [  --enable-dbus-control   D-BUS control interface (default disabled)])
         if test "${enable_dbus_control}" = "yes"
@@ -936,9 +934,10 @@ RDC_PROG_CC_FLAGS_IFELSE([-pipe])
 
 dnl This helps detect broken plugins with undefined symbols
 dnl Better fail loudly at build-time than silenty at run-time.
-RDC_PROG_LINK_FLAGS_IFELSE([-Wl,-z,defs], [
-  VLC_ADD_LDFLAGS([plugin],[-Wl,-z,defs])
-])
+dnl Unfortunately, this sucks on FreeBSD (won't even link with -lc)
+dnl RDC_PROG_LINK_FLAGS_IFELSE([-Wl,-z,defs], [
+dnl   VLC_ADD_LDFLAGS([plugin],[-Wl,-z,defs])
+dnl ])
 
 dnl Check for various optimization flags
 AC_CACHE_CHECK([if \$CC accepts -Os],
@@ -1274,7 +1273,7 @@ if test "${ac_cv_altivec_inline}" != "no"; then
     VLC_ADD_CFLAGS([motionaltivec],[${ac_cv_altivec_inline}])
     VLC_ADD_CFLAGS([memcpyaltivec],[${ac_cv_altivec_inline}])
     VLC_ADD_CFLAGS([i420_yuy2_altivec],[${ac_cv_altivec_inline}])
-    VLC_ADD_CFLAGS([vlc],[${ac_cv_altivec_inline}])
+    VLC_ADD_CFLAGS([libvlc],[${ac_cv_altivec_inline}])
   fi
   ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
 fi
@@ -1334,7 +1333,7 @@ CPPFLAGS="${CPPFLAGS_save}"
 
 if test "${ac_cv_c_altivec}" != "no"; then
   AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, Define if your compiler groks C AltiVec extensions.)
-  VLC_ADD_CFLAGS([vlc],[${ac_cv_c_altivec}])
+  VLC_ADD_CFLAGS([libvlc],[${ac_cv_c_altivec}])
   VLC_ADD_CFLAGS([idctaltivec motionaltivec],[${ac_cv_c_altivec}])
   VLC_ADD_CFLAGS([i420_yuy2_altivec memcpyaltivec deinterlace],[${ac_cv_c_altivec} ${ac_cv_c_altivec_abi}])
   if test "${ac_cv_altivec_inline}" = "no"; then
@@ -1349,7 +1348,7 @@ AC_CACHE_CHECK([if linker needs -framework vecLib],
      LDFLAGS="${LDFLAGS_save}"
     ])
 if test "${ac_cv_ld_altivec}" != "no"; then
-  VLC_ADD_LDFLAGS([vlc idctaltivec motionaltivec memcpyaltivec],[-framework vecLib])
+  VLC_ADD_LDFLAGS([libvlc idctaltivec motionaltivec memcpyaltivec],[-framework vecLib])
 fi
 fi # end "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"
 
@@ -1446,15 +1445,6 @@ AC_ARG_ENABLE(release,
 [  --enable-release        activate extra optimizations (default disabled)])
 test "${enable_release}" != "yes" && enable_release="no"
 
-dnl
-dnl  Is the shared libvlc forced ?
-dnl
-AC_ARG_ENABLE(shared-libvlc,
-  [  --enable-shared-libvlc  Win32 libvlc.dll build (default disabled)])
-AS_IF([test "${enable_libtool}" != "no" && test "${enable_shared_libvlc}"], [
-  AC_MSG_ERROR([--enable-shared-libvlc and --enable-libtool are mutually exclusive])
-])
-
 dnl
 dnl Stream output
 dnl
@@ -2464,10 +2454,15 @@ if test "${enable_mkv}" != "no" -a "${CXX}" != ""; then
               if test "${SYS}" = "darwin"; then
                 VLC_ADD_CXXFLAGS([mkv],[-O1])
               fi
-              AC_CHECK_LIB(ebml, main, [
+              AC_CHECK_LIB(ebml_pic, main, [
                 VLC_ADD_PLUGINS([mkv])
-                VLC_ADD_LDFLAGS([mkv],[-lmatroska -lebml])
-              ])
+                VLC_ADD_LDFLAGS([mkv],[-lmatroska -lebml_pic])
+              ],
+                AC_CHECK_LIB(ebml, main, [
+                  VLC_ADD_PLUGINS([mkv])
+                  VLC_ADD_LDFLAGS([mkv],[-lmatroska -lebml])
+                ]) 
+             )
             ],
             [AC_MSG_RESULT([no])
               AC_MSG_ERROR([Your libmatroska is too old: you may get a more recent one from http://dl.matroska.org/downloads/libmatroska/. Alternatively you can use --disable-mkv to disable the matroska plugin.])
@@ -3664,11 +3659,16 @@ if test "${enable_glx}" != "no" &&
   (test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce" ||
    test "${enable_glx}" = "yes"); then
   CPPFLAGS="${CPPFLAGS_save} ${X_CFLAGS}"
-  AC_CHECK_HEADERS(X11/Xlib.h GL/glu.h GL/glx.h, [
+  AC_CHECK_HEADERS(X11/Xlib.h GL/glu.h GL/glx.h)
+  AC_COMPILE_IFELSE(AC_LANG_PROGRAM(
+    [[#if !defined(HAVE_X11_XLIB_H) || !defined(HAVE_GL_GLU_H) || !defined(HAVE_GL_GLX_H)
+    choke me
+    #endif]]),
+    [
       VLC_ADD_PLUGINS([glx])
       VLC_ADD_LDFLAGS([glx],[${X_LIBS} ${X_PRE_LIBS} -lX11 -lXext -lGL -lGLU])
       VLC_ADD_CPPFLAGS([glx],[${X_CFLAGS}])
-   ],[AC_MSG_ERROR([Please install GL development package. Alternatively you can also configure with --disable-glx.])])
+    ],[AC_MSG_ERROR([Please install GL development package. Alternatively you can also configure with --disable-glx.])])
   CPPFLAGS="${CPPFLAGS_save}"
 fi
 
@@ -4093,7 +4093,7 @@ then
       ])
       AC_CHECK_HEADERS(d3d9.h,
       [ VLC_ADD_PLUGINS([direct3d])
-        VLC_ADD_LDFLAGS([direct3d],[-ld3d9 -lgdi32])
+        VLC_ADD_LDFLAGS([direct3d],[-lgdi32])
       ])
     else
       AC_MSG_CHECKING(for directX headers in ${with_directx})
@@ -4783,6 +4783,8 @@ then
       # wxwidgets should provide the following flags but does not
       # the following is required to compile for win32
       VLC_ADD_CXXFLAGS([wxwidgets],[-D_UNICODE -DUNICODE])
+    else
+      AC_MSG_ERROR([You need a unicode build of wxWidgets. Please upgrade and try again. Alternatively you can also configure with --disable-wxwidgets.])
     fi
     if test "$have_libcdio" = "yes"
     then 
@@ -5264,7 +5266,8 @@ then
     fi
     AC_LANG_PUSH(C++)
     AC_CHECK_HEADERS(ole2.h olectl.h,
-      [ VLC_ADD_CXXFLAGS([activex],[-fno-exceptions])
+      [ VLC_ADD_CPPFLAGS([activex],[-D_MIDL_USE_GUIDDEF_])
+        VLC_ADD_CXXFLAGS([activex],[-fno-exceptions])
         VLC_ADD_LDFLAGS([activex],[-lole32 -loleaut32 -luuid -lshlwapi]) 
         AC_CHECK_HEADERS(objsafe.h,
           VLC_ADD_CXXFLAGS([activex],[-DHAVE_OBJSAFE_HEADER]),,
@@ -5318,20 +5321,20 @@ then
         MOZILLA_CONFIG="${SEAMONKEY_CONFIG}"
       fi
     fi
-    
+
     if ${MOZILLA_CONFIG} --defines | grep -q 'MOZ_X11=1'; then
       LDFLAGS="${LDFLAGS_save} ${X_LIBS} ${X_PRE_LIBS}"
       AC_CHECK_LIB(Xt,XtStrings,
        [
          VLC_ADD_CPPFLAGS([mozilla],[${X_CFLAGS}])
          VLC_ADD_LDFLAGS([mozilla],[${X_LIBS} ${X_PRE_LIBS} -lXt -lX11 -lSM -lICE])
-],
+       ],
        [],
        [[${X_LIBS} ${X_PRE_LIBS} -lX11 -lSM -lICE]
       ])
       LDFLAGS="${LDFLAGS_save}"
     fi
-    
+
       mozilla=:
       dnl Workaround for http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=150490
       VLC_ADD_CPPFLAGS([mozilla],[[`${MOZILLA_CONFIG} --cflags plugin xpcom java | sed 's,-I\([^ ]*\)/mozilla/\([^ ]*\),-I\1/\2 -I\1/mozilla/\2,g' | xargs`]])
@@ -5367,7 +5370,7 @@ then
           mozilla_sdk_xpcom="/xpcom"
       fi
     fi
-  
+
     real_mozilla_sdk="`cd ${with_mozilla_sdk_path} 2>/dev/null && pwd`"
     CPPFLAGS="${CPPFLAGS_save} -I${real_mozilla_sdk} -I${real_mozilla_sdk}/include"
     MOZILLA_REQUIRED_HEADERS=1
@@ -5453,7 +5456,7 @@ dnl
 if test "${SYS}" = "mingw32" -o "${SYS}" = "cygwin"
 then
     AC_CHECK_LIB(unicows, LoadUnicowsSymbol, [
-        VLC_ADD_LDFLAGS([vlc],[-Wl,--exclude-libs,libunicows.a -lunicows])
+        VLC_ADD_LDFLAGS([vlc libvlc],[-Wl,--exclude-libs,libunicows.a -lunicows])
     ])
 fi
 
@@ -5536,14 +5539,13 @@ AS_IF([${plugin_support}], [
 dnl
 dnl Pic and shared libvlc stuff
 dnl
-AS_IF([test "x${enable_shared_libvlc}" = "x"], [enable_shared_libvlc=no])
-AM_CONDITIONAL(BUILD_SHARED, [test "${enable_shared_libvlc}" != "no"])
-AS_IF([test "${enable_shared_libvlc}" != "no" || test "${enable_libtool}" != "no"], [
+AS_IF([test "${SYS}" = "mingw32" || test "${enable_libtool}" != "no"], [
   AC_DEFINE(HAVE_SHARED_LIBVLC, 1, [Define to 1 if libvlc is built as a shared library.])
   FILE_LIBVLC_DLL="!define LIBVLC_DLL libvlc.dll"
   VLC_ADD_PLUGINS([${BUILTINS}])
   BUILTINS=""
 ], [
+  LDFLAGS_vlc="${LDFLAGS_vlc} ${LDFLAGS_libvlc}"
   FILE_LIBVLC_DLL=""
 ])
 
@@ -5595,8 +5597,7 @@ VLC_RESTORE_FLAGS
 dnl
 dnl  Create the vlc-config script
 dnl
-LDFLAGS_libvlc="${LDFLAGS_vlc} ${LDFLAGS_builtin}"
-for i in `echo "${BUILTINS}" | sed -e 's@[^ ]*/@@g'` ; do LDFLAGS_libvlc="${LDFLAGS_libvlc} ${libdir}/vlc/${i}.a `eval echo '$'{LDFLAGS_${i}}`" ; done
+LDFLAGS_libvlc="${LDFLAGS_libvlc} ${LDFLAGS_builtin}"
 
 dnl
 dnl  Configuration is finished