]> git.sesse.net Git - vlc/blobdiff - configure.ac
Fix segfault when Connect() returned failure and fix memleaks. Make sure live555...
[vlc] / configure.ac
index b8a523891a38b9521adb7a37c667fdf6dcfec073..59c8e219acf3ef7154ea5ebbac5b2ac593700de7 100644 (file)
@@ -183,6 +183,8 @@ case "${host_os}" in
     then
         echo ""
         echo "Building with Mac OS X defaults:"
+        enable_macosx="yes"
+        echo "  Assuming --enable-macosx"
         enable_faad="yes"
         echo "  Assuming --enable-faad"
         enable_flac="yes"
@@ -214,6 +216,9 @@ case "${host_os}" in
         echo "  Assuming --disable-glx"
         enable_xvideo="no"
         echo "  Assuming --disable-xvideo"
+
+        with_macosx_sdk="no"
+        echo "  Compiling without SDK usage"
     fi
     if test ".`uname -p`" = ".i386"; then
         dnl Due to a ld(64) bug in 10.5 we cannot use our mmx code
@@ -233,8 +238,6 @@ case "${host_os}" in
             echo "  Assuming --disable-mmx (due to a bug in ld)"
             enable_sse="no"
             echo "  Assuming --disable-sse (due to a bug in ld)"
-            enable_ffmpeg="no"
-            echo "  Assuming --disable-ffmpeg (due to a bug in ld)"
         fi
     fi
     ;;
@@ -365,12 +368,15 @@ if test "${with_macosx_sdk}" != "no" ; then
     CC="${CC} -isysroot /Developer/SDKs/MacOSX10.4u.sdk" 
     CXX="${CXX} -isysroot /Developer/SDKs/MacOSX10.4u.sdk" 
     OBJC="${OBJC} -isysroot /Developer/SDKs/MacOSX10.4u.sdk" 
-    LD="${LD} -syslibroot /Developer/SDKs/MacOSX10.4u.sdk"
+    LD="${LD} -syslibroot/Developer/SDKs/MacOSX10.4u.sdk"
     CFLAGS_save="${CFLAGS_save} -DMACOSX_DEPLOYMENT_TARGET=10.4 -mmacosx-version-min=10.4"; CFLAGS="${CFLAGS_save}"
     CXXFLAGS_save="${CXXFLAGS_save} -DMACOSX_DEPLOYMENT_TARGET=10.4 -mmacosx-version-min=10.4"; CXXFLAGS="${CXXFLAGS_save}"
     OBJCFLAGS_save="${OBJCFLAGS_save} -DMACOSX_DEPLOYMENT_TARGET=10.4 -mmacosx-version-min=10.4"; OBJCFLAGS="${OBJCFLAGS_save}"
     MACOSX_DEPLOYMENT_TARGET="10.4"
     export MACOSX_DEPLOYMENT_TARGET
+else
+    MACOSX_DEPLOYMENT_TARGET="10.4"
+    export MACOSX_DEPLOYMENT_TARGET
 fi
 
 dnl
@@ -1262,7 +1268,7 @@ if test "${SYS}" != "mingwce"; then
   VLC_ADD_PLUGINS([access_fake access_filter_timeshift access_filter_record access_filter_dump])
   VLC_ADD_PLUGINS([gestures rc telnet hotkeys showintf marq podcast shout sap fake folder])
   VLC_ADD_PLUGINS([rss mosaic wall motiondetect clone crop erase bluescreen alphamask gaussianblur])
-  VLC_ADD_PLUGINS([i420_yuy2 i422_yuy2 i420_ymga i422_i420])
+  VLC_ADD_PLUGINS([i420_yuy2 i422_yuy2 i420_ymga i422_i420 yuy2_i422 yuy2_i420 chroma_chain])
   VLC_ADD_PLUGINS([aout_file linear_resampler bandlimited_resampler])
   VLC_ADD_PLUGINS([float32_mixer spdif_mixer simple_channel_mixer])
   VLC_ADD_PLUGINS([dolby_surround_decoder headphone_channel_mixer normvol equalizer param_eq])
@@ -2344,7 +2350,7 @@ then
 fi
 
 dnl
-dnl  Video4Linux plugin
+dnl  Video4Linux2 plugin
 dnl
 AC_ARG_ENABLE(v4l2,
   [  --enable-v4l2           Video4Linux2 input support (default disabled)])
@@ -2357,6 +2363,19 @@ then
     VLC_ADD_CPPFLAGS([v4l2],[-I${with_v4l2}/include])
   fi
 
+  AC_CHECK_HEADER(alsa/asoundlib.h, AC_CHECK_LIB(asound, main, have_v4l2_alsa="true", have_v4l2_alsa="false"),have_v4l2_alsa="false")
+  if test "${have_v4l2_alsa}" = "true"
+  then
+    CFLAGS="${CFLAGS_save}"
+    AC_TRY_COMPILE([#define ALSA_PCM_NEW_HW_PARAMS_API
+                    #define ALSA_PCM_NEW_SW_PARAMS_API
+                    #include <alsa/asoundlib.h>],
+       [snd_pcm_hw_params_get_period_time(0,0,0);],
+        AC_DEFINE(HAVE_ALSA_NEW_API, 1, Define if ALSA is at least rc4))
+    VLC_ADD_LDFLAGS([v4l2],[-lasound -lm -ldl])
+    AC_DEFINE(HAVE_ALSA, 1, Define if ALSA is present.)
+  fi
+
   CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_v4l2}"
   AC_CHECK_HEADERS(linux/videodev2.h, [
     VLC_ADD_PLUGINS([v4l2])
@@ -3067,6 +3086,12 @@ dnl Those options have to be here because the .pc can be bogus for ffmpeg previo
      VLC_ADD_LIBS([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
+
+    if test -f "${real_ffmpeg_tree}/libavformat/libavformat.a"; then
+      AC_DEFINE(HAVE_LIBAVFORMAT_TREE, 1, [Define if you have ffmpeg's libavformat.])
+      VLC_ADD_LIBS([ffmpeg],[-L${real_ffmpeg_tree}/libavformat -lavformat -lz])
+      VLC_ADD_CPPFLAGS([ffmpeg],[-I${real_ffmpeg_tree}/libavformat])
+    fi
 else
 
 
@@ -5178,9 +5203,9 @@ AS_IF([test "${enable_qt4}" != "no" &&
       AC_PATH_PROGS(UIC, [uic-qt4 uic], uic,`$PKG_CONFIG --variable=exec_prefix QtCore`/bin)
       ],
       AS_IF([test "${enable_qt4}" = "yes"],[
-       AC_MSG_ERROR(QT4 library not found)
+    AC_MSG_ERROR(QT4 library not found)
       ],[
-        AC_MSG_WARN(QT4 library not found)
+    AC_MSG_WARN(QT4 library not found)
       ])
     )
 ])
@@ -5308,32 +5333,31 @@ AC_ARG_ENABLE(opie,
    fi])
 
 dnl
-dnl  MacOS X module
+dnl  MacOS X video output/gui modules
 dnl
-ORIGCFLAGS=$CFLAGS
-CFLAGS="$CFLAGS -x objective-c"
-AC_ARG_ENABLE(macosx,
-  [  --enable-macosx         MacOS X support (default enabled on MacOS X)],
-  [if test "${enable_macosx}" = "yes"
-   then
-     VLC_ADD_PLUGINS([access_eyetv])
-     VLC_ADD_LDFLAGS([access_eyetv], [-Wl,-framework,CoreFoundation])
-     VLC_ADD_LDFLAGS([minimal_macosx],[-Wl,-framework,IOKit,-framework,Cocoa,-framework,Carbon,-lobjc,-ObjC,-framework,OpenGL,-framework,AGL])
-     VLC_ADD_LDFLAGS([macosx],[-Wl,-framework,IOKit,-framework,Cocoa,-framework,Carbon,-framework,QuickTime,-lobjc,-ObjC,-framework,OpenGL,-framework,AGL,-framework,QTKit,-framework,WebKit])
-     VLC_ADD_OBJCFLAGS( [macosx],[-fobjc-exceptions] )
-     VLC_ADD_OBJCFLAGS( [minimal_macosx],[-fobjc-exceptions] )
-   fi],
-  [AC_CHECK_HEADERS(Cocoa/Cocoa.h,
-    [VLC_ADD_PLUGINS([access_eyetv])
-     VLC_ADD_LDFLAGS([access_eyetv], [-Wl,-framework,CoreFoundation])
-     VLC_ADD_BUILTINS([macosx])
-     VLC_ADD_BUILTINS([minimal_macosx])
-     VLC_ADD_LDFLAGS([minimal_macosx],[-Wl,-framework,IOKit,-framework,Cocoa,-framework,Carbon,-framework,QuickTime,-lobjc,-ObjC,-framework,OpenGL,-framework,AGL])
-     VLC_ADD_LDFLAGS([macosx],[-Wl,-framework,IOKit,-framework,Cocoa,-framework,Carbon,-framework,QuickTime,-lobjc,-ObjC,-framework,OpenGL,-framework,AGL,-framework,QTKit,-framework,WebKit])
-     VLC_ADD_OBJCFLAGS([macosx],[-fobjc-exceptions])
-     VLC_ADD_OBJCFLAGS([minimal_macosx],[-fobjc-exceptions])
-    ])])
-CFLAGS=$ORIGCFLAGS
+AC_ARG_ENABLE(macosx, [--enable-macosx MacOS X support (default enabled on MacOS X)])
+if test "x${enable_macosx}" = "xyes"
+then
+  VLC_ADD_LDFLAGS([access_eyetv],                     [-Wl,-framework,CoreFoundation])
+  VLC_ADD_LDFLAGS([macosx minimal_macosx opengllayer],[-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,AGL])
+  VLC_ADD_LDFLAGS([macosx],                           [-Wl,-framework,IOKit])
+  VLC_ADD_LDFLAGS([macosx],                           [-Wl,-framework,QuickTime])
+  VLC_ADD_LDFLAGS([macosx],                           [-Wl,-framework,QTKit])
+  VLC_ADD_LDFLAGS([macosx],                           [-Wl,-framework,WebKit])
+  VLC_ADD_LDFLAGS([opengllayer],                      [-Wl,-framework,QuartzCore])
+  VLC_ADD_OBJCFLAGS([macosx minimal_macosx opengllayer], [-fobjc-exceptions] )
+
+  VLC_ADD_PLUGINS([access_eyetv])
+  VLC_ADD_BUILTINS([macosx minimal_macosx])
+  ORIGCFLAGS=$CFLAGS
+  CFLAGS="$CFLAGS -x objective-c"
+  AC_CHECK_HEADER(QuartzCore/CALayer.h, [VLC_ADD_BUILTINS([opengllayer])])
+  CFLAGS=$ORIGCFLAGS
+fi
 
 dnl
 dnl  QNX RTOS module
@@ -5358,6 +5382,7 @@ AC_ARG_ENABLE(ncurses,
       [AC_CHECK_LIB(ncursesw, mvprintw,
         [VLC_ADD_PLUGINS([ncurses])
         VLC_ADD_LIBS([ncurses],[-lncursesw])
+        ALIASES="${ALIASES} nvlc"
         AC_DEFINE([HAVE_NCURSESW], 1, [Define to 1 if you have libncursesw.])
         ],
         [AC_CHECK_LIB( ncurses, mvprintw,
@@ -5556,7 +5581,7 @@ dnl libgcrypt
 dnl
 AC_ARG_ENABLE(libgcrypt,
   [  --enable-libgcrypt      libgcrypts support (default enabled)])
-if test "${enable_libgcrypt}" != "no" -a "${enable_gnutls}" != "no"i
+if test "${enable_libgcrypt}" != "no" -a "${enable_gnutls}" != "no"
 then
   dnl Workaround for cross-compiling since AM_PATH_LIBGRYPT doesn't dectect
   dnl it and looks for libgcrypt headers in the wrong place.
@@ -5569,6 +5594,20 @@ then
 fi
 AM_CONDITIONAL([HAVE_LIBGCRYPT], [test "${have_libgcrypt}" = "yes"])
 
+dnl
+dnl update checking system
+dnl
+AC_ARG_ENABLE(update-check,
+  [  --enable-update-check   update checking system (default disabled)])
+if test "${enable_update_check}" = "yes"
+then
+  if test "${have_libgcrypt}" != "yes"
+  then
+    AC_MSG_ERROR([libgcrypt is required for update checking system])
+  fi
+  VLC_ADD_LIBS([libvlc], [-lgcrypt])
+  AC_DEFINE([UPDATE_CHECK], [1], [Define if you want to use the VLC update mechanism])
+fi
 
 dnl
 dnl  Endianness check, AC_C_BIGENDIAN doesn't work if we are cross-compiling
@@ -5875,7 +5914,7 @@ fi
 AC_LANG_POP(C++)
 AM_CONDITIONAL(BUILD_MOZILLA,${mozilla})
 
-   dnl Tests for Osso and Xsp
+dnl Tests for Osso and Xsp
 if test "${enable_x11}" != "no" &&
   (test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce" ||
    test "${enable_x11}" = "yes"); then
@@ -6048,13 +6087,6 @@ AC_DEFINE_UNQUOTED(VLC_COMPILE_HOST, "`hostname`", [host which ran configure])
 AC_DEFINE_UNQUOTED(VLC_COMPILE_DOMAIN, "`dnsdomainname 2>/dev/null || domainname 2>/dev/null || echo unknown`", [domain of the host which ran configure]) 
 AC_DEFINE_UNQUOTED(VLC_COMPILER, "`$CC -v 2>&1 | tail -n 1`", [compiler]) 
 
-dnl New definitions with value matching 0.9.0 release
-module_symbol="0_9_0c"
-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}"
-AC_SUBST(VLC_ENTRY)
-
 dnl
 dnl  Handle substvars that use $(top_srcdir)
 dnl
@@ -6237,7 +6269,7 @@ if test "x$ac_ld_does_not_support_text_reloc" = "xyes"; then
    echo ""
    echo "Warning: Due to a bug in ld, mmx/sse support has been"
    echo "         turned off."
-   echo "         More over FFmpeg support has been disabled."
-   echo "         VLC WILL NOT BE ABLE TO PLAY MOST FILES."
+   echo "         FFmpeg will be REALLY slow."
+   echo "         VLC WILL NOT PERFORM AS EXPECTED."
    echo ""
 fi