]> git.sesse.net Git - vlc/blobdiff - configure.ac
Factorize code to open configuration file
[vlc] / configure.ac
index 50ca2a5d150a881c25886f799d0fce3321cc8061..cb5f17846fa4c6fa6989898329e2d1ac026df236 100644 (file)
@@ -848,26 +848,44 @@ AC_ARG_ENABLE(dbus,
  
 if test "${enable_dbus}" != "no"
 then
-  PKG_CHECK_MODULES(DBUS, dbus-1 >= 0.92,
-    [ AC_DEFINE( HAVE_DBUS_2, 1, [Define if you have the D-BUS library API >= 0.92] )
+  dnl api stable dbus
+  PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.0.0,
+    [ AC_DEFINE( HAVE_DBUS_3, 1, [Define if you have the D-BUS library API >= 1.0.0] )
+      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],[$DBUS_LIBS])
-      VLC_ADD_CFLAGS([screensaver],[$DBUS_CFLAGS])],
-    dnl older dbus
-    [ PKG_CHECK_MODULES(DBUS, dbus-1 >= 0.30,
-      [ AC_DEFINE( HAVE_DBUS_1, 1, [Define if you have the D-BUS library API >= 0.30 ] )
+      VLC_ADD_LDFLAGS([screensaver vlc],[$DBUS_LIBS])
+      VLC_ADD_CFLAGS([screensaver vlc],[$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"
+        then
+          VLC_ADD_PLUGINS([dbus])
+          VLC_ADD_LDFLAGS([dbus],[$DBUS_LIBS])
+          VLC_ADD_CFLAGS([dbus],[$DBUS_CFLAGS])
+        fi],
+    dnl not too old dbus
+    [ PKG_CHECK_MODULES(DBUS, dbus-1 >= 0.92,
+      [ 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],[$DBUS_LIBS])
         VLC_ADD_CFLAGS([screensaver],[$DBUS_CFLAGS])],
-      dnl much older dbus
-      [ PKG_CHECK_MODULES( DBUS, dbus-1, 
-         [AC_DEFINE(HAVE_DBUS, 1, [Define if you have the D-BUS library])
+      dnl older dbus
+      [ PKG_CHECK_MODULES(DBUS, dbus-1 >= 0.30,
+        [ 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],[$DBUS_LIBS])
           VLC_ADD_CFLAGS([screensaver],[$DBUS_CFLAGS])],
-         [AC_MSG_WARN(DBUS library not found)])
-      ]
-   )]
+        dnl much older dbus
+        [ PKG_CHECK_MODULES( DBUS, dbus-1, 
+           [AC_DEFINE(HAVE_DBUS, 1, [Define if you have the D-BUS library])
+            VLC_ADD_LDFLAGS([screensaver],[$DBUS_LIBS])
+            VLC_ADD_CFLAGS([screensaver],[$DBUS_CFLAGS])],
+           [AC_MSG_WARN(DBUS library not found)])
+        ]
+      )]
+    )]
   )
 fi
 
@@ -892,7 +910,7 @@ if test "${ac_cv_c_ntohl_sys_param_h}" != "no"; then
 fi
 CFLAGS="${CFLAGS_save}"
 
-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_WFLAGS([all extra no-unused-parameter sign-compare undef pointer-arith bad-function-cast cast-align write-strings old-style-definition missing-prototypes volatile-register-var])
 RDC_PROG_CC_FLAGS_IFELSE([-pipe])
 
 dnl This helps detect broken plugins with undefined symbols
@@ -1430,6 +1448,7 @@ then
   VLC_ADD_PLUGINS([stream_out_dummy stream_out_standard stream_out_es stream_out_rtp stream_out_description vod_rtsp])
   VLC_ADD_PLUGINS([stream_out_duplicate stream_out_gather stream_out_display stream_out_transcode stream_out_bridge stream_out_mosaic_bridge stream_out_autodel])
 #  VLC_ADD_PLUGINS([stream_out_transrate])
+#  VLC_ADD_PLUGINS([rtcp])
   VLC_ADD_PLUGINS([profile_parser])
 
   AC_DEFINE(ENABLE_SOUT, 1, Define if you want the stream output support)
@@ -2739,6 +2758,12 @@ dnl Those options have to be here because the .pc can be bogus for ffmpeg previo
      VLC_ADD_LDFLAGS([ffmpeg],[-L${real_ffmpeg_tree}/libavformat ${real_ffmpeg_tree}/libavformat/libavformat.a])
      VLC_ADD_CPPFLAGS([ffmpeg stream_out_switcher],[-I${real_ffmpeg_tree}/libavformat])
    fi
+
+   if test -f "${real_ffmpeg_tree}/libswscale/libswscale.a"; then
+     AC_DEFINE(HAVE_LIBSWSCALE_TREE, 1, [Define if you have ffmpeg's libswscale.])
+     VLC_ADD_LDFLAGS([ffmpeg],[-L${real_ffmpeg_tree}/libswscale ${real_ffmpeg_tree}/libswscale/libswscale.a])
+     VLC_ADD_CPPFLAGS([ffmpeg stream_out_switcher],[-I${real_ffmpeg_tree}/libswscale])
+   fi
 else    
     
 dnl Look for a ffmpeg-config (we are on debian )
@@ -2753,7 +2778,7 @@ 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_MSG_ERROR([Missing header file 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_MSG_ERROR([Missing header file postproc/postprocess.h.])] )
@@ -2772,6 +2797,7 @@ dnl Trying with pkg-config
      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(ffmpeg/swscale.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])
@@ -2789,8 +2815,14 @@ dnl Trying with pkg-config
      VLC_ADD_LDFLAGS([ffmpeg stream_out_switcher],[${FFMPEG_LIBS}])
      dnl newer ffmpeg have a separate libpostproc
      PKG_CHECK_MODULES(POSTPROC, libpostproc,[
+       VLC_ADD_CFLAGS([ffmpeg],[${POSTPROC_CFLAGS}]) 
        VLC_ADD_LDFLAGS([ffmpeg],[${POSTPROC_LIBS}]) 
        ],[ true ])
+     dnl even newer ffmpeg has a libswscale
+     PKG_CHECK_MODULES(SWSCALE, libswscale,[
+       VLC_ADD_CFLAGS([ffmpeg],[${SWSCALE_CFLAGS}]) 
+       VLC_ADD_LDFLAGS([ffmpeg],[${SWSCALE_LIBS}]) 
+       ],[ true ])
     ],[
      
     dnl
@@ -2800,6 +2832,7 @@ dnl Trying with pkg-config
       LDFLAGS="${LDFLAGS_save} ${LDFLAGS_ffmpeg}"
       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/swscale.h)
       AC_CHECK_HEADERS(ffmpeg/avutil.h)
       AC_CHECK_HEADERS(postproc/postprocess.h, [], [AC_MSG_ERROR([Missing header file postproc/postprocess.h.])] )
 
@@ -2825,6 +2858,11 @@ dnl Trying with pkg-config
         VLC_ADD_LDFLAGS([ffmpeg],[-lavformat -lz]) ], [], [-lavcodec -lz $LDAVUTIL])
       LDFLAGS="${LDFLAGS_save}"
       CPPFLAGS="${CPPFLAGS_save}"
+
+      AC_CHECK_LIB(swscale, sws_getContext, [
+        VLC_ADD_LDFLAGS([ffmpeg],[-lswscale]) ], [], [-lavcodec $LDAVUTIL])
+      LDFLAGS="${LDFLAGS_save}"
+      CPPFLAGS="${CPPFLAGS_save}"
     ])
   fi
  fi 
@@ -5027,20 +5065,6 @@ then
   fi
 fi
 
-dnl
-dnl DAAP access plugin and services discovery 
-dnl
-AC_ARG_ENABLE(daap,
-  [  --enable-daap               DAAP shares services discovery support (default enabled)])
-if test "$enable_daap" != "no"
-then
-   PKG_CHECK_MODULES(DAAP, opendaap >= 0.3.0,
-      [ VLC_ADD_PLUGINS([daap])
-       VLC_ADD_LDFLAGS([daap],[$DAAP_LIBS])
-       VLC_ADD_CFLAGS([daap],[$DAAP_CFLAGS])]:,
-      [AC_MSG_WARN(DAAP library not found)])
-fi
-
 dnl
 dnl  Bonjour services discovery
 dnl
@@ -5507,8 +5531,8 @@ dnl VLC_SYMBOL="`echo ${VERSION} | sed -e 'y/.-+/___/'`"
 dnl AC_DEFINE_UNQUOTED(MODULE_SUFFIX, "__${VLC_SYMBOL}", [String suffix for module functions])
 dnl AC_DEFINE_UNQUOTED(MODULE_SYMBOL, ${VLC_SYMBOL}, [Symbol suffix for module functions])
 
-dnl New definitions with value matching 0.8.6 release
-module_symbol="0_8_6c"
+dnl New definitions with value matching 0.9.0 release
+module_symbol="0_9_0"
 AC_DEFINE_UNQUOTED(MODULE_SUFFIX, "__${module_symbol}", [String suffix for module functions])
 AC_DEFINE_UNQUOTED(MODULE_SYMBOL, $module_symbol, [Symbol suffix for module functions])
 VLC_ENTRY="vlc_entry__${module_symbol}"
@@ -5601,6 +5625,7 @@ AC_CONFIG_FILES([
   modules/codec/dmo/Makefile
   modules/codec/ffmpeg/Makefile
   modules/codec/spudec/Makefile
+  modules/codec/xvmc/Makefile
   modules/control/Makefile
   modules/control/http/Makefile
   modules/demux/Makefile
@@ -5637,7 +5662,6 @@ AC_CONFIG_FILES([
   modules/stream_out/transrate/Makefile
   modules/video_chroma/Makefile
   modules/video_filter/Makefile
-  modules/video_filter/swscale/Makefile
   modules/video_output/Makefile
   modules/video_output/directx/Makefile
   modules/video_output/qte/Makefile