]> git.sesse.net Git - vlc/blobdiff - configure.ac
Auto probe BDA tuner when using dvb://
[vlc] / configure.ac
index 85fe3ebce20150232560e5fc48c7db72675698ef..76bbac25e62a4dfaf658ba5f2c03f266b9490281 100644 (file)
@@ -2,11 +2,11 @@ dnl Autoconf settings for vlc
 
 AC_COPYRIGHT([Copyright 2002-2009 the VideoLAN team])
 
-AC_INIT(vlc, 1.0.0-pre1)
+AC_INIT(vlc, 1.0.0-pre2)
 VERSION_MAJOR="1"
 VERSION_MINOR="0"
 VERSION_REVISION="0"
-VERSION_EXTRA="-pre1"
+VERSION_EXTRA="-pre2"
 PKGDIR="vlc"
 AC_SUBST(PKGDIR)
 
@@ -213,7 +213,7 @@ case "${host_os}" in
     VLC_ADD_LDFLAGS([mkv mp4], [-Wl,-framework,IOKit,-framework,CoreFoundation])
     VLC_ADD_LDFLAGS([vlc],[-Wl,-undefined,dynamic_lookup])
     VLC_ADD_LDFLAGS([libvlc_control],[-Wl,dynamic_lookup])
-    VLC_ADD_LDFLAGS([avcodec avformat swscale imgresample postproc i420_rgb_mmx x264],[-Wl,-read_only_relocs,suppress])
+    VLC_ADD_LDFLAGS([avcodec avformat swscale postproc i420_rgb_mmx x264],[-Wl,-read_only_relocs,suppress])
     VLC_ADD_CFLAGS([motion],[-fconstant-cfstrings])
     VLC_ADD_LDFLAGS([libvlc],[-Wl,-framework,CoreFoundation])
     VLC_ADD_LDFLAGS([motion],[-Wl,-framework,IOKit,-framework,CoreFoundation])
@@ -270,26 +270,6 @@ case "${host_os}" in
         enable_xvideo="no"
         echo "  Assuming --disable-xvideo"
     fi
-    if test ".`uname -p`" = ".i386"; then
-        dnl Due to a ld(64) bug in 10.5 we cannot use our mmx code
-        dnl without hacking it a lot, we disable mmx and sse.
-        dnl (that bug is about ld being unable to handle
-        dnl text relocation)
-        save_cflags="$CFLAGS"
-        CFLAGS="$CFLAGS -dynamiclib -single_module -read_only_relocs suppress"
-        AC_TRY_LINK(
-            [int a;], [asm("movq _a,%mm0\n");],
-            ac_ld_does_not_support_text_reloc=no,
-            ac_ld_does_not_support_text_reloc=yes)
-        CFLAGS="$save_cflags"
-
-        if test "x$ac_ld_does_not_support_text_reloc" = "xyes"; then
-            enable_mmx="no"
-            echo "  Assuming --disable-mmx (due to a bug in ld)"
-            enable_sse="no"
-            echo "  Assuming --disable-sse (due to a bug in ld)"
-        fi
-    fi
     dnl
     dnl  Check for Mac OS X SDK settings
     dnl
@@ -302,6 +282,20 @@ case "${host_os}" in
         OBJC="${OBJC} -isysroot ${with_macosx_sdk}"
         LD="${LD} -syslibroot ${with_macosx_sdk}"
     fi
+    if test "${host_cpu}" = "powerpc"; then
+        CPP="${CPP} -arch ppc"
+        CC="${CC} -arch ppc"
+        CXX="${CXX} -arch ppc"
+        OBJC="${OBJC} -arch ppc"
+        LD="${LD} -arch ppc"
+    fi    
+    if test "${host_cpu}" = "i386"; then
+        CPP="${CPP} -arch i386"
+        CC="${CC} -arch i386"
+        CXX="${CXX} -arch i386"
+        OBJC="${OBJC} -arch i386"
+        LD="${LD} -arch i386"
+    fi
     AC_ARG_WITH(macosx-version-min,
        [  --with-macosx-version-min=VERSION  compile for MacOSX VERSION and above])
     if test "${with_macosx_version_min}" != "" ; then
@@ -317,6 +311,28 @@ case "${host_os}" in
         export MACOSX_DEPLOYMENT_TARGET
     fi
     ;;
+  darwin9*)
+    if (test ".`uname -p`" = ".i386"); then
+        dnl Due to a ld(64) bug in 10.5 we cannot use our mmx code
+        dnl without hacking it a lot, we disable mmx and sse.
+        dnl (that bug is about ld being unable to handle
+        dnl text relocation)
+        save_cflags="$CFLAGS"
+        CFLAGS="$CFLAGS -dynamiclib -single_module -read_only_relocs suppress"
+        AC_TRY_LINK(
+            [int a;], [asm("movq _a,%mm0\n");],
+            ac_ld_does_not_support_text_reloc=no,
+            ac_ld_does_not_support_text_reloc=yes)
+        CFLAGS="$save_cflags"
+
+        if test "x$ac_ld_does_not_support_text_reloc" = "xyes"; then
+            enable_mmx="no"
+            echo "  Assuming --disable-mmx (due to a bug in ld)"
+            enable_sse="no"
+            echo "  Assuming --disable-sse (due to a bug in ld)"
+        fi
+    fi
+    ;;
   *mingw32* | *cygwin* | *wince* | *mingwce* | *pe*)
     AC_CHECK_TOOL(WINDRES, windres, :)
     AC_CHECK_TOOL(OBJCOPY, objcopy, :)
@@ -455,22 +471,23 @@ VLC_ADD_CFLAGS([libvlc],[${INCICONV}])
 VLC_ADD_LIBS([libvlc],[${LTLIBICONV}])
 
 dnl Check for broken versions of mingw-runtime compatability library
-if test "${SYS}" = "mingw32"
-then
+AS_IF([test "${SYS}" = "mingw32"], [
     AC_MSG_CHECKING(for broken mingw-runtime)
-    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+    AC_PREPROC_IFELSE([
 #include <_mingw.h>
-#if (__MINGW32_MAJOR_VERSION == 3) && (__MINGW32_MINOR_VERSION < 14)
+#if (__MINGW32_MAJOR_VERSION == 3) && (__MINGW32_MINOR_VERSION < 15)
 # error Attempting to use mingw-runtime with broken vsnprintf support
 #endif
-        ]])],
-        [AC_MSG_RESULT([Ok])],
-        [AC_MSG_ERROR([Broken mingw-runtime, need > 3.13])],
+], [
+        AC_MSG_RESULT([ok])
+], [
+        AC_MSG_RESULT([present])
+        AC_MSG_ERROR([LibVLC requires mingw-runtime version 3.15 or higher!])
 ])
     dnl force use of mingw provided c99 *printf over msvcrt
     CPPFLAGS="${CPPFLAGS} -D__USE_MINGW_ANSI_STDIO=1"
     CPPFLAGS_save="${CPPFLAGS_save} -D__USE_MINGW_ANSI_STDIO=1"
-fi
+])
 
 dnl Check for the need to include the mingwex lib for mingw32
 if test "${SYS}" = "mingw32"
@@ -551,13 +568,11 @@ dnl Check for system libs needed
 need_libc=false
 
 dnl Check for usual libc functions
-AC_CHECK_FUNCS([gettimeofday isatty swab sigrelse getpwuid_r memalign posix_memalign if_nametoindex getenv putenv setenv gmtime_r ctime_r localtime_r lrintf daemon fork lstat posix_fadvise posix_madvise uselocale])
-AC_CHECK_FUNCS(strcasecmp,,[AC_CHECK_FUNCS(stricmp)])
-AC_CHECK_FUNCS(strncasecmp,,[AC_CHECK_FUNCS(strnicmp)])
-AC_CHECK_FUNCS(strcasestr,,[AC_CHECK_FUNCS(stristr)])
+AC_CHECK_FUNCS([gettimeofday isatty sigrelse getpwuid_r memalign posix_memalign if_nametoindex getenv putenv setenv ctime_r lrintf daemon fork lstat posix_fadvise posix_madvise uselocale])
 AC_FUNC_ALLOCA
 AC_CHECK_FUNCS(fcntl)
-AC_REPLACE_FUNCS([asprintf atof atoll lldiv strdup strlcpy strndup strnlen strsep strtof strtoll vasprintf])
+AC_REPLACE_FUNCS([asprintf atof atoll gmtime_r lldiv localtime_r rewind strcasecmp strcasestr strdup strlcpy strncasecmp strndup strnlen strsep strtof strtoll vasprintf swab])
+AC_CHECK_FUNCS([stricmp strnicmp])
 
 dnl Check for Linux system calls
 AC_CHECK_FUNCS([vmsplice])
@@ -705,7 +720,7 @@ AC_CHECK_LIB(m,cos,[
   VLC_ADD_LIBS([adjust wave ripple psychedelic gradient a52tofloat32 dtstofloat32 x264 goom visual panoramix rotate noise grain scene],[-lm])
 ])
 AC_CHECK_LIB(m,pow,[
-  VLC_ADD_LIBS([avcodec avformat swscale imgresample postproc ffmpegaltivec stream_out_transrate i420_rgb faad twolame equalizer spatializer param_eq libvlc vorbis freetype mod mpc dmo quicktime realaudio realvideo galaktos opengl],[-lm])
+  VLC_ADD_LIBS([avcodec avformat swscale postproc ffmpegaltivec stream_out_transrate i420_rgb faad twolame equalizer spatializer param_eq libvlc vorbis freetype mod mpc dmo quicktime realaudio realvideo galaktos opengl],[-lm])
 ])
 AC_CHECK_LIB(m,sqrt,[
   VLC_ADD_LIBS([headphone_channel_mixer normvol speex mono colorthres extract],[-lm])
@@ -854,6 +869,7 @@ AC_CHECK_HEADERS(fcntl.h sys/types.h sys/time.h sys/times.h sys/ioctl.h sys/stat
 AC_CHECK_HEADERS([arpa/inet.h netinet/in.h netinet/udplite.h sys/eventfd.h])
 AC_CHECK_HEADERS([net/if.h], [], [],
   [
+    #include <sys/types.h>
     #include <sys/socket.h>
   ])
 if test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"; then
@@ -3090,7 +3106,7 @@ then
       VLC_ADD_CFLAGS([avcodec],[$AVCODEC_CFLAGS])
       VLC_RESTORE_FLAGS
     ],[
-      AC_MSG_FAILURE([Could not find libavcodec or libavutil. Use --disable-avcodec to ignore this error.])
+      AC_MSG_ERROR([Could not find libavcodec or libavutil. Use --disable-avcodec to ignore this error.])
   ])
 fi
 
@@ -3114,7 +3130,7 @@ then
       VLC_ADD_CFLAGS([avformat],[$AVFORMAT_CFLAGS])
       VLC_RESTORE_FLAGS
     ],[
-      AC_MSG_FAILURE([Could not find libavformat or libavutil. Use --disable-avformat to ignore this error.])
+      AC_MSG_ERROR([Could not find libavformat or libavutil. Use --disable-avformat to ignore this error.])
   ])
 fi
 
@@ -3138,49 +3154,7 @@ then
       VLC_ADD_CFLAGS([swscale],[$SWSCALE_CFLAGS])
       VLC_RESTORE_FLAGS
     ],[
-      AC_MSG_WARN([Could not find libswscale. Trying to enable imgresample.])
-      enable_imgresample=yes
-  ])
-fi
-
-dnl
-dnl  avcodec (deprecated API) image scaling and conversion plugin
-dnl
-dnl  This is build as a seperate module than the avcodec one to prevent
-dnl  stupid run time library load errors from disabling most codecs
-dnl  from VLC.
-dnl
-
-AC_ARG_ENABLE(imgresample,
-  AS_HELP_STRING([--enable-imgresample],[deprecated libavcodec image scaling
-                 and conversion (default disabled)]))
-if test "${enable_imgresample}" = "yes"
-then
-  PKG_CHECK_MODULES(IMGRESAMPLE,[libavcodec],
-    [
-      VLC_SAVE_FLAGS
-      CPPFLAGS="${CPPFLAGS} ${IMGRESAMPLE_CFLAGS}"
-      CFLAGS="${CFLAGS} ${IMGRESAMPLE_CFLAGS}"
-      AC_CHECK_HEADERS(libavcodec/avcodec.h ffmpeg/avcodec.h)
-      AC_CHECK_LIB(avcodec,img_resample,
-        [
-          VLC_ADD_PLUGIN([imgresample])
-          VLC_ADD_LIBS([imgresample],[$IMGRESAMPLE_LIBS])
-          VLC_ADD_CFLAGS([imgresample],[$IMGRESAMPLE_CFLAGS])
-        ],[
-          AC_MSG_WARN([Could not find img_resample in libavcodec.])
-          if test "${enable_swscale}" != "no"
-          then
-            AC_MSG_FAILURE([swscale (and its fallback module imgresample) support will be missing. Use --disable-swscale to ignore this error. (This basically means that you will be missing any good software scaling module and some video chroma converters.)])
-          fi
-       # That sed hack to add -rpath is kind of ugly but at least it fixes
-        # detection when linking against a shared libavcodec with
-        # a libavutil not in one of your ld.so.conf directories.
-       # (for example a local install)
-        ],[${IMGRESAMPLE_LIBS} `echo ${IMGRESAMPLE_LIBS}|sed s'/-L/-Wl,-rpath=/'`])
-      VLC_RESTORE_FLAGS
-    ],[
-      AC_MSG_WARN([Could not find libavcodec.])
+      AC_MSG_ERROR([Could not find libswscale. Use --disable-swscale to ignore this error. Proper software scaling and some video chroma conversion will be missing.])
   ])
 fi
 
@@ -3203,7 +3177,7 @@ then
       VLC_ADD_CFLAGS([postproc],[$POSTPROC_CFLAGS])
       VLC_RESTORE_FLAGS
     ],[
-      AC_MSG_ERROR([Could not find libpostproc.])
+      AC_MSG_ERROR([Could not find libpostproc. Use --disable-postproc to ignore this error.])
   ])
 fi
 
@@ -3305,10 +3279,8 @@ dnl
 dnl  QuickTime plugin
 dnl
 AC_ARG_ENABLE(quicktime,
-  [  --enable-quicktime      QuickTime module (default enabled on MacOS X)])
-if test "${enable_quicktime}" != "no" &&
-  (test "${SYS}" = "darwin" || test "${enable_quicktime}" = "yes")
-then
+  [  --enable-quicktime      QuickTime module (deprecated)])
+if test "${enable_quicktime}" = "yes"; then
   if test "${SYS}" = "mingw32"; then
     VLC_ADD_PLUGIN([quicktime])
   else
@@ -4102,8 +4074,10 @@ AC_ARG_ENABLE(xvmc,
 AS_IF([test "${enable_xvmc}" != "no"], [
   AC_CHECK_HEADERS(X11/extensions/vldXvMC.h, [
     VLC_ADD_PLUGIN([xvmc])
-    VLC_ADD_LIBS([xvmc],[${X_LIBS} ${X_PRE_LIBS} -lX11 -lXext -lXvMCW -lXv -lXinerama])
-    VLC_ADD_CPPFLAGS([xvmc],[${X_CFLAGS}])
+    VLC_ADD_LIBS([xvmc],[${X_LIBS} ${X_PRE_LIBS} -lX11 -lXext -lXvMCW -lXv ${LIBMPEG2_LIBS}])
+    VLC_ADD_CPPFLAGS([xvmc],[${X_CFLAGS} ${LIBMPEG2_CFLAGS}])
+  ], [
+    AC_MSG_ERROR([XVideo-MotionCompensation extension not found!])
   ])
 ])
 
@@ -4187,7 +4161,6 @@ AS_IF([test "${enable_xcb}" != "no"], [
 
   dnl xcb-utils
   PKG_CHECK_MODULES(XCB_AUX, [xcb-aux])
-  PKG_CHECK_MODULES(XCB_IMAGE, [xcb-image])
   PKG_CHECK_MODULES(XCB_KEYSYMS, [xcb-keysyms])
 
   VLC_ADD_PLUGIN([xcb])
@@ -5151,9 +5124,9 @@ then
   VLC_ADD_LDFLAGS([macosx minimal_macosx opengllayer qtcapture],[-Wl,-framework,Cocoa])
   VLC_ADD_LDFLAGS([macosx minimal_macosx opengllayer],[-Wl,-framework,OpenGL])
   VLC_ADD_LDFLAGS([macosx minimal_macosx],            [-Wl,-framework,Carbon])
+  VLC_ADD_LDFLAGS([macosx minimal_macosx],            [-Wl,-framework,CoreServices])
   VLC_ADD_LDFLAGS([macosx minimal_macosx],            [-Wl,-framework,AGL])
   VLC_ADD_LDFLAGS([macosx],                           [-Wl,-framework,IOKit])
-  VLC_ADD_LDFLAGS([macosx],                           [-Wl,-framework,QuickTime])
   dnl For bug report
   VLC_ADD_LDFLAGS([macosx],                           [-Wl,-framework,AddressBook])
   VLC_ADD_LDFLAGS([macosx qtcapture],                 [-Wl,-framework,QTKit])
@@ -5236,19 +5209,12 @@ AC_ARG_ENABLE(xosd,
   [  --enable-xosd           xosd interface support (default disabled)])
 if test "${enable_xosd}" = "yes"
 then
-  AC_CHECK_HEADER(xosd.h, have_xosd="true", have_xosd="false")
-  AC_CHECK_LIB(xosd,xosd_set_offset,
-      AC_DEFINE(HAVE_XOSD_VERSION_1, 1, Define if <xosd.h> is 1.0.x),
-    AC_CHECK_LIB(xosd,xosd_set_horizontal_offset,
-        AC_DEFINE(HAVE_XOSD_VERSION_2, 1, Define if <xosd.h> is 2.0.x),
-      AC_TRY_COMPILE([#include <xosd.h>],
-         [xosd_init("foo","bar",12,XOSD_top,2,12,42);],,
-          AC_DEFINE(HAVE_XOSD_VERSION_0, 1, Define if <xosd.h> is pre-1.0.0))))
-  if test "${have_xosd}" = "true"
-  then
-    VLC_ADD_PLUGIN([xosd])
-    VLC_ADD_LIBS([xosd],[-lxosd])
-  fi
+  AC_CHECK_HEADERS(xosd.h,
+    AC_CHECK_LIB(xosd, xosd_set_horizontal_offset, [
+      VLC_ADD_PLUGIN([xosd])
+      VLC_ADD_LIBS([xosd],[-lxosd])
+    ])
+  )
 fi
 
 dnl