]> git.sesse.net Git - vlc/blobdiff - configure.ac
Remove legacy alloca checks
[vlc] / configure.ac
index 64977087959352a8699b48a3d898985e36885939..31bf3d250c3f95a8714805d35c90781e07149d9d 100644 (file)
@@ -355,6 +355,15 @@ case "${host_os}" in
         VLC_ADD_LIBS([cdda vcdx cddax sdl_image aout_sdl vout_sdl],[-lwinmm])
         VLC_ADD_LIBS([access_http access_mms access_udp access_tcp access_ftp access_rtmp access_output_udp access_output_shout access_output_rtmp sap slp http stream_out_standard stream_out_rtp stream_out_raop vod_rtsp access_realrtsp rtp telnet rc netsync gnutls growl_udp flac ts audioscrobbler lua remoteosd zvbi],[-lws2_32])
         VLC_ADD_LIBS([access_file], [-lshlwapi])
+        dnl
+        dnl DEP and ASLR options
+        dnl
+        AC_ARG_ENABLE(peflags,
+          [  --enable-peflags          peflags use (default enabled)])
+        if test "${enable_peflags}" != "no"
+        then
+          AC_CHECK_TOOL(PEFLAGS, peflags, :)
+        fi
     fi
     if test "${SYS}" = "mingwce"; then
         # add ws2 for closesocket, select, recv
@@ -402,6 +411,7 @@ AM_CONDITIONAL(HAVE_DARWIN, test "${SYS}" = "darwin")
 AM_CONDITIONAL(HAVE_LINUX, [test "${SYS}" = "linux"])
 AM_CONDITIONAL(HAVE_WIN32, test "${SYS}" = "mingw32")
 AM_CONDITIONAL(HAVE_WINCE, test "${SYS}" = "mingwce")
+AM_CONDITIONAL(USE_PEFLAGS, [test "${enable_peflags}" = "yes"])
 
 dnl
 dnl Sadly autoconf doesn't think about testing foo.exe when ask to test
@@ -562,7 +572,6 @@ need_libc=false
 
 dnl Check for usual libc functions
 AC_CHECK_FUNCS([gettimeofday isatty sigrelse getpwuid_r memalign posix_memalign if_nametoindex getenv putenv setenv ctime_r daemon fork lstat posix_fadvise posix_madvise uselocale])
-AC_FUNC_ALLOCA
 AC_CHECK_FUNCS(fcntl)
 AC_REPLACE_FUNCS([asprintf atof atoll getcwd getpid gmtime_r lldiv localtime_r rewind strcasecmp strcasestr strdup strlcpy strncasecmp strndup strnlen strsep strtof strtoll vasprintf swab])
 AC_CHECK_FUNCS([stricmp strnicmp])
@@ -1384,7 +1393,7 @@ dnl  Check for fully workin SSE2 intrinsics
 dnl  We need support for -mmmx, we need <emmintrin.h>, and we also need a
 dnl  working compiler (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23963)
 AC_ARG_ENABLE(sse,
-[  --disable-sse           disable SSE (1 and 2) optimizations (default auto)]
+[  --disable-sse           disable SSE (1, 2, 3 and 4) optimizations (default auto)]
 ,, [
   case "${host_cpu}" in
     i686|x86_64)
@@ -1443,6 +1452,42 @@ AS_IF([test "${enable_sse}" != "no"], [
     VLC_ADD_PLUGIN([i420_yuy2_sse2])
     VLC_ADD_PLUGIN([i422_yuy2_sse2])
   ])
+
+  # SSE3
+  AC_CACHE_CHECK([if $CC groks SSE3 inline assembly],
+    [ac_cv_sse3_inline],
+    [CFLAGS="${CFLAGS_save} -O -msse3"
+     AC_TRY_COMPILE(,[void *p;asm volatile("movsldup %%xmm1,%%xmm0"::"r"(p));],
+                    ac_cv_sse3_inline=yes, ac_cv_sse3_inline=no)
+     ARCH="${ARCH} sse3"
+  ])
+  AS_IF([test "${ac_cv_sse3_inline}" != "no"], [
+    AC_DEFINE(CAN_COMPILE_SSE3, 1,
+              [Define to 1 if SSE3 inline assembly is available.]) ])
+  # SSSE3
+  AC_CACHE_CHECK([if $CC groks SSSE3 inline assembly],
+    [ac_cv_ssse3_inline],
+    [CFLAGS="${CFLAGS_save} -O -mssse3"
+     AC_TRY_COMPILE(,[void *p;asm volatile("pabsw %%xmm0,%%xmm0"::"r"(p));],
+                    ac_cv_ssse3_inline=yes, ac_cv_ssse3_inline=no)
+     ARCH="${ARCH} ssse3"
+  ])
+
+  AS_IF([test "${ac_cv_ssse3_inline}" != "no"], [
+    AC_DEFINE(CAN_COMPILE_SSSE3, 1,
+              [Define to 1 if SSSE3 inline assembly is available.]) ])
+
+  # SSE4
+  AC_CACHE_CHECK([if $CC groks SSE4 inline assembly],
+    [ac_cv_sse4_inline],
+    [CFLAGS="${CFLAGS_save} -O -msse4"
+     AC_TRY_COMPILE(,[void *p;asm volatile("pmaxsb %%xmm1,%%xmm0"::"r"(p));],
+                    ac_cv_sse4_inline=yes, ac_cv_sse4_inline=no)
+     ARCH="${ARCH} sse4"
+  ])
+  AS_IF([test "${ac_cv_sse4_inline}" != "no"], [
+    AC_DEFINE(CAN_COMPILE_SSE4, 1,
+              [Define to 1 if SSE4 inline assembly is available.]) ])
 ])
 
 AC_CACHE_CHECK([if $CC groks 3D Now! inline assembly],
@@ -2253,7 +2298,16 @@ then
       then
         AC_MSG_ERROR([Could not find libdvbpsi on your system: you may get it from www.videolan.org, you'll need at least version 0.1.1])
       fi
-    ])
+    ],
+    [#if defined( HAVE_STDINT_H )
+#   include <stdint.h>
+#elif defined( HAVE_INTTYPES_H )
+#   include <inttypes.h>
+#endif
+#include <dvbpsi/dvbpsi.h>
+#include <dvbpsi/descriptor.h>
+#include <dvbpsi/pat.h>
+#include <dvbpsi/pmt.h>])
     CPPFLAGS="${CPPFLAGS_save}"
   ;;
   esac
@@ -2851,6 +2905,12 @@ AS_IF([test "${enable_id3tag}" = "yes"], [
     ])
 ])
 
+AC_ARG_ENABLE(merge-ffmpeg,
+[  --enable-merged-ffmpeg  merge FFmpeg-based plugins (default disabled)],, [
+  enable_merge_ffmpeg="no"
+])
+AM_CONDITIONAL([MERGE_FFMPEG], [test "$enable_merge_ffmpeg" != "no"])
+
 dnl
 dnl  avcodec decoder/encoder plugin
 dnl
@@ -2911,9 +2971,14 @@ then
       CFLAGS="${CFLAGS} ${AVFORMAT_CFLAGS}"
       AC_CHECK_HEADERS(libavformat/avformat.h ffmpeg/avformat.h)
       AC_CHECK_HEADERS(libavutil/avutil.h ffmpeg/avutil.h)
-      VLC_ADD_PLUGIN([avformat])
-      VLC_ADD_LIBS([avformat],[$AVFORMAT_LIBS $AVUTIL_LIBS])
-      VLC_ADD_CFLAGS([avformat],[$AVFORMAT_CFLAGS $AVUTIL_CFLAGS])
+      AS_IF([test "$enable_merge_ffmpeg" = "no"], [
+        VLC_ADD_PLUGIN([avformat])
+        VLC_ADD_LIBS([avformat],[$AVFORMAT_LIBS $AVUTIL_LIBS])
+        VLC_ADD_CFLAGS([avformat],[$AVFORMAT_CFLAGS $AVUTIL_CFLAGS])
+      ], [
+        VLC_ADD_LIBS([avcodec],[$AVFORMAT_LIBS $AVUTIL_LIBS])
+        VLC_ADD_CFLAGS([avcodec],[$AVFORMAT_CFLAGS $AVUTIL_CFLAGS])
+      ])
       VLC_RESTORE_FLAGS
     ],[
       AC_MSG_ERROR([Could not find libavformat or libavutil. Use --disable-avformat to ignore this error.])
@@ -3297,7 +3362,7 @@ if test "${enable_x264}" != "no"; then
       AC_MSG_ERROR([the specified tree doesn't have x264.h])
     fi
   else
-      PKG_CHECK_MODULES(X264,x264, [
+      PKG_CHECK_MODULES(X264,x264 >= 0.76, [
         VLC_ADD_PLUGIN([x264])
         VLC_ADD_LDFLAGS([x264],[${X264_LIBS}])
 
@@ -3317,7 +3382,7 @@ if test "${enable_x264}" != "no"; then
         fi
       ],[
         if test "${enable_x264}" = "yes"; then
-            AC_MSG_ERROR([Could not find libx264 on your system: you may get it from http://www.videolan.org/x264.html])
+            AC_MSG_ERROR([Could not find libx264 >= 0.76 on your system: you may get it from http://www.videolan.org/x264.html])
           fi
       ])
     LDFLAGS="${LDFLAGS_save}"
@@ -3527,9 +3592,13 @@ 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 ${LIBMPEG2_LIBS}])
-    VLC_ADD_CPPFLAGS([xvmc],[${X_CFLAGS} ${LIBMPEG2_CFLAGS}])
+    AS_IF([test "${enable_libmpeg2}" = "yes"], [
+      VLC_ADD_PLUGIN([xvmc])
+      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 needs libmpeg2 which isn't available])
+    ])
   ], [
     AC_MSG_ERROR([XVideo-MotionCompensation extension not found!])
   ])
@@ -4880,8 +4949,8 @@ AM_CONDITIONAL(BUILD_MOZILLA,${mozilla})
 dnl Tests for Osso and Xsp
 AC_CHECK_LIB(osso, osso_display_blanking_pause, [
   PKG_CHECK_MODULES(GLIB2, glib-2.0, [
-    VLC_ADD_CPPFLAGS([xvmc glx omapfb],[-DHAVE_OSSO ${DBUS_CFLAGS} ${GLIB2_CFLAGS}])
-    VLC_ADD_LIBS([xvmc glx omapfb],[-losso])
+    VLC_ADD_CPPFLAGS([xvmc glx],[-DHAVE_OSSO ${DBUS_CFLAGS} ${GLIB2_CFLAGS}])
+    VLC_ADD_LIBS([xvmc glx],[-losso])
  ])
 ])
 AC_CHECK_LIB(Xsp, XSPSetPixelDoubling,[