]> git.sesse.net Git - vlc/blobdiff - configure.ac
Remove excess empty lines
[vlc] / configure.ac
index 2194b78bc43dd811d0e14876d0ae07010581e686..161cbf9cd2e5be2a8171ec3faf0241cfc034ad1a 100644 (file)
@@ -274,6 +274,8 @@ dnl
 AC_DISABLE_STATIC
 AC_LIBTOOL_DLOPEN
 dnl AC_LIBTOOL_WIN32_DLL - couldn't get libtool to work on Win32 so far
+m4_undefine([AC_PROG_F77])
+m4_defun([AC_PROG_F77],[])
 AC_PROG_LIBTOOL
 
 AC_ARG_ENABLE(libtool,
@@ -298,7 +300,7 @@ fi
 dnl
 dnl Gettext stuff
 dnl
-ALL_LINGUAS="ca cs da de en_GB es fr gl he hi hu it ja ka ko ms nl oc pt_BR ro ru sk sv tr zh_CN zh_TW"
+ALL_LINGUAS="ca cs da de en_GB es fr gl he hi hu it ja ka ko ms nl oc pt_BR ro ru sk sl sv tr zh_CN zh_TW"
 AM_GNU_GETTEXT_VERSION(0.11.5)
 AM_GNU_GETTEXT
 AS_IF([test "${nls_cv_force_use_gnu_gettext}" = "yes"], [
@@ -565,10 +567,10 @@ 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 freetype mpc dmo quicktime realaudio galaktos],[-lm])
+  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])
 ])
 AC_CHECK_LIB(m,sqrt,[
-  VLC_ADD_LDFLAGS([headphone_channel_mixer normvol speex],[-lm])
+  VLC_ADD_LDFLAGS([headphone_channel_mixer normvol speex mono],[-lm])
 ])
 AC_CHECK_LIB(m,ceil,[
   VLC_ADD_LDFLAGS([mosaic],[-lm])
@@ -886,19 +888,16 @@ AC_CACHE_CHECK([for ntohl in sys/param.h],
 if test "${ac_cv_c_ntohl_sys_param_h}" != "no"; then
     AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
 fi
+CFLAGS="${CFLAGS_save}"
 
-RDC_PROG_CC_WFLAGS_IFELSE([all extra no-unused-parameter conversion unreachable-code sign-compare undef])
+RDC_PROG_CC_WFLAGS([all extra no-unused-parameter sign-compare undef pointer-arith bad-function-cast cast-align write-strings old-style-definition missing-prototypes packed volatile-register-var])
+RDC_PROG_CC_FLAGS_IFELSE([-pipe])
 
-dnl Check for -pipe
-AC_CACHE_CHECK([if \$CC accepts -pipe],
-    [ac_cv_c_pipe],
-    [CFLAGS="${CFLAGS_save} -pipe"
-     AC_TRY_COMPILE([],,ac_cv_c_pipe=yes, ac_cv_c_pipe=no)])
-if test "${ac_cv_c_pipe}" != "no"; then
-    CFLAGS_save="${CFLAGS_save} -pipe"; CFLAGS="${CFLAGS_save}"
-    CXXFLAGS_save="${CXXFLAGS_save} -pipe"; CXXFLAGS="${CXXFLAGS_save}"
-    OBJCFLAGS_save="${OBJCFLAGS_save} -pipe"; OBJCFLAGS="${OBJCFLAGS_save}"
-fi
+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 Check for various optimization flags
 AC_CACHE_CHECK([if \$CC accepts -Os],
@@ -1485,7 +1484,7 @@ dnl
 
 AC_ARG_ENABLE(notify,
   [  --enable-notify         libnotify notification plugin (default enabled)])
-AS_IF([test "${enable_notify}" != "no"], [
+AS_IF([test "${enable_notify}" != "no" -a "${SYS}" != "mingw32"], [
     PKG_CHECK_MODULES(NOTIFY, libnotify,
       [
         VLC_ADD_PLUGINS([notify])
@@ -2455,8 +2454,8 @@ then
       dnl  Use a custom mod
       AC_MSG_RESULT(${real_mod_tree}/src/.libs/libmodplug.a)
       VLC_ADD_PLUGINS([mod])
-      VLC_ADD_LDFLAGS([mod],[${real_mod_tree}/src/.libs/libmodplug.a])
-      VLC_ADD_CFLAGS([mod],[-I${real_mod_tree}/include])
+      VLC_ADD_LDFLAGS([mod],[${real_mod_tree}/src/.libs/libmodplug.a -lstdc++])
+      VLC_ADD_CXXFLAGS([mod],[-I${real_mod_tree}/include])
     else
       dnl  The given mod wasn't built
       AC_MSG_RESULT(no)
@@ -2466,7 +2465,7 @@ then
     AC_CHECK_HEADERS(libmodplug/modplug.h, [
       VLC_ADD_PLUGINS([mod])
       VLC_ADD_CXXFLAGS([mod],[])
-      VLC_ADD_LDFLAGS([mod],[-lmodplug])])
+      VLC_ADD_LDFLAGS([mod],[-lmodplug -lstdc++])])
   fi
 fi
 
@@ -2758,10 +2757,10 @@ dnl Look for a ffmpeg-config (we are on debian )
   AC_PATH_PROG(FFMPEG_CONFIG, ffmpeg-config, no, ${FFMPEG_PATH})
   if test "${FFMPEG_CONFIG}" != "no"
   then
-    AC_CHECK_HEADERS(ffmpeg/avcodec.h)
+      AC_CHECK_HEADERS(ffmpeg/avcodec.h, [], [AC_MSG_ERROR([Missing header file ffmpeg/avcodec.h.])] )
     AC_CHECK_HEADERS(ffmpeg/avformat.h)
     AC_CHECK_HEADERS(ffmpeg/avutil.h)
-    AC_CHECK_HEADERS(postproc/postprocess.h)
+    AC_CHECK_HEADERS(postproc/postprocess.h, [], [AC_MSG_ERROR([Missing header file postproc/postprocess.h.])] )
     VLC_ADD_PLUGINS([ffmpeg])
     if test "${enable_sout}" != "no" -a "${enable_switcher}" = "yes"; then
         VLC_ADD_PLUGINS([stream_out_switcher])
@@ -2774,10 +2773,10 @@ dnl Look for a ffmpeg-config (we are on debian )
 dnl Trying with pkg-config
    PKG_CHECK_MODULES(FFMPEG,[libavcodec, libavformat],
     [
-     AC_CHECK_HEADERS(ffmpeg/avcodec.h)
+     AC_CHECK_HEADERS(ffmpeg/avcodec.h, [], [AC_MSG_ERROR([Missing header file ffmpeg/avcodec.h.])] )
      AC_CHECK_HEADERS(ffmpeg/avformat.h)
      AC_CHECK_HEADERS(ffmpeg/avutil.h)
-     AC_CHECK_HEADERS(postproc/postprocess.h)
+     AC_CHECK_HEADERS(postproc/postprocess.h, [], [AC_MSG_ERROR([Missing header file postproc/postprocess.h.])] )
      if test "${SYS}" = "darwin"; then
         VLC_ADD_BUILTINS([ffmpeg])
      else
@@ -3089,7 +3088,9 @@ then
         VLC_ADD_CPPFLAGS([a52tofloat32],[${CPPFLAGS_test}])
       ],[
         AC_MSG_ERROR([Could not find liba52 on your system: you may get it from http://liba52.sf.net/. Alternatively you can use --disable-a52 to disable the a52 plugin.])
-      ])
+        ])
+    ],[
+      AC_MSG_ERROR([Could not find liba52 on your system: you may get it from http://liba52.sf.net/. Alternatively you can use --disable-a52 to disable the a52 plugin.])
     ])
     CPPFLAGS="${CPPFLAGS_save}"
     LDFLAGS="${LDFLAGS_save}"
@@ -3293,10 +3294,10 @@ then
   else
     AC_CHECK_HEADERS(vorbis/codec.h, [
       VLC_ADD_PLUGINS([vorbis])
-      VLC_ADD_LDFLAGS([vorbis],[-lvorbis -logg]) ],[])
+      VLC_ADD_LDFLAGS([vorbis],[-lvorbis -logg -lm]) ],[])
 
     AC_CHECK_HEADERS(vorbis/vorbisenc.h, [
-      VLC_ADD_LDFLAGS([vorbis],[-lvorbisenc]) ],[])
+      VLC_ADD_LDFLAGS([vorbis],[-lvorbisenc -lm]) ],[])
   fi
 fi
 
@@ -3595,6 +3596,24 @@ if test "${enable_glx}" != "no" &&
   CPPFLAGS="${CPPFLAGS_save}"
 fi
 
+dnl
+dnl  XVMC module
+dnl  (enabled by default except on win32)
+dnl
+AC_ARG_ENABLE(xvmc,
+  [  --enable-xvmc            XVMC support (default disabled)])
+if test "${enable_xvmc}" = "yes" &&
+  (test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce" ||
+   test "${enable_xvmc}" = "yes"); then
+  CPPFLAGS="${CPPFLAGS_save} ${X_FLAGS}"
+  AC_CHECK_HEADERS(X11/extensions/vldXvMC.h, [
+    VLC_ADD_PLUGINS([xvmc])
+    VLC_ADD_LDFLAGS([xvmc],[${X_LIBS} ${X_PRE_LIBS} -lX11 -lXext])
+    VLC_ADD_CPPFLAGS([xvmc],[${X_CFLAGS}])
+  ])
+  CPPFLAGS="${CPPFLAGS_save}"
+fi
+
 dnl
 dnl  Check for the Xinerama extension
 dnl
@@ -4419,7 +4438,7 @@ AS_IF([test "x${enable_upnp}" != "xno"], [
     AC_MSG_ERROR([cannot find Intel UPnP SDK (libupnp)])
   ])
   AS_IF([test "${has_upnp}" = "yes"], [
-    VLC_ADD_LDFLAGS([upnp_intel], [-lupnp])
+    VLC_ADD_LDFLAGS([upnp_intel], [-lupnp -lixml])
   ])
 ], [
   has_upnp="no"
@@ -4671,6 +4690,18 @@ then
     fi
     VLC_ADD_LDFLAGS([wxwidgets],[`${WX_CONFIG} --libs`])
     VLC_ADD_CXXFLAGS([wxwidgets],[`${WX_CONFIG} --cxxflags`])
+    # check if we must link against gtk2 libs
+    # if __WXGTK20__ && __WXGTK__ are defined
+    # for modules/gui/wxwidgets/video.cpp
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
+#include <wx/wx.h>
+#ifdef __WXGTK20__
+#error ok, we need to link against gtk2
+#endif
+        ])],[WXGTK=no],[WXGTK=yes])
+    if test "$WXGTK" = "yes"; then
+      ${PKG_CONFIG} --exists gtk+-2.0 && VLC_ADD_LDFLAGS([wxwidgets],[`$PKG_CONFIG --libs gtk+-2.0`])
+    fi
     if ${WX_CONFIG} --unicode
     then 
       # wxwidgets should provide the following flags but does not
@@ -4708,6 +4739,8 @@ then
     CPPFLAGS="${CPPFLAGS_save}"
     AC_LANG_POP(C++)
   fi
+  dnl WxWidgets plugin will yield incorrect code without this
+  VLC_ADD_CXXFLAGS([wxwidgets], [-fno-strict-aliasing])
 fi
 
 dnl
@@ -5140,11 +5173,11 @@ AM_CONDITIONAL(LOADER, [test "${enable_loader}" = "yes"])
 AS_IF([test "${enable_loader}" = "yes"],
   [ VLC_ADD_PLUGINS([dmo])
     VLC_ADD_CPPFLAGS([dmo],[-I../../../@top_srcdir@/loader])
-    VLC_ADD_LDFLAGS([dmo],[../../../loader/libloader.la])
+    VLC_ADD_LDFLAGS([dmo],[../../../loader/libloader.la -lpthread])
     VLC_ADD_CPPFLAGS([quicktime],[-I../../@top_srcdir@/loader])
-    VLC_ADD_LDFLAGS([quicktime],[../../loader/libloader.la])
+    VLC_ADD_LDFLAGS([quicktime],[../../loader/libloader.la -lpthread])
     VLC_ADD_CPPFLAGS([realaudio],[-I../../@top_srcdir@/loader -DLOADER])
-    VLC_ADD_LDFLAGS([realaudio],[../../loader/libloader.la])
+    VLC_ADD_LDFLAGS([realaudio],[../../loader/libloader.la -ldl -lpthread])
   ])
 
 dnl
@@ -5203,7 +5236,7 @@ if test "${enable_mozilla}" = "yes"
 then
   dnl currently vlc plugin only needs headers, no xpcom support apis are actually used
   need_xpcom_libs=false
-  if test "${with_mozilla_sdk_path}" = ""
+  if test "${with_mozilla_sdk_path}" = "" -o "${with_mozilla_sdk_path}" = "no"
   then
     AC_PATH_PROG(MOZILLA_CONFIG, mozilla-config, no)
     if test "${MOZILLA_CONFIG}" = "no"