]> git.sesse.net Git - ffmpeg/blobdiff - configure
Use h->slice_num where possible.
[ffmpeg] / configure
index 0c580e1612ff3e6bd7e731fdf5b53f06726fb19e..6c35fc3d60d5bd9ebab72b38d3843e0853ed5771 100755 (executable)
--- a/configure
+++ b/configure
@@ -601,12 +601,12 @@ check_yasm(){
 
 check_ld(){
     log check_ld "$@"
-    check_cc || return
     flags=''
     libs=''
     for f; do
         test "${f}" = "${f#-l}" && flags="$flags $f" || libs="$libs $f"
     done
+    check_cc $($filter_cflags $flags) || return
     check_cmd $ld $LDFLAGS $flags -o $TMPE $TMPO $extralibs $libs
 }
 
@@ -626,13 +626,18 @@ int x;
 EOF
 }
 
-check_ldflags(){
-    log check_ldflags "$@"
-    check_ld "$@" <<EOF && add_ldflags "$@"
+test_ldflags(){
+    log test_ldflags "$@"
+    check_ld "$@" <<EOF
 int main(void){ return 0; }
 EOF
 }
 
+check_ldflags(){
+    log check_ldflags "$@"
+    test_ldflags "$@" && add_ldflags "$@"
+}
+
 check_header(){
     log check_header "$@"
     header=$1
@@ -678,7 +683,8 @@ check_cpp_condition(){
     log check_cpp_condition "$@"
     header=$1
     condition=$2
-    check_cpp <<EOF
+    shift 2
+    check_cpp $($filter_cppflags "$@") <<EOF
 #include <$header>
 #if !($condition)
 #error "unsatisfied condition: $condition"
@@ -703,11 +709,7 @@ check_lib2(){
     headers="$1"
     func="$2"
     shift 2
-    temp_extralibs "$@"
-    check_func_headers "$headers" $func && add_extralibs "$@"
-    err=$?
-    restore_flags
-    return $err
+    check_func_headers "$headers" $func "$@" && add_extralibs "$@"
 }
 
 check_exec(){
@@ -757,6 +759,24 @@ $type v;
 EOF
 }
 
+check_struct(){
+    log check_type "$@"
+    headers=$1
+    struct=$2
+    member=$3
+    shift 3
+    disable_safe "${struct}_${member}"
+    incs=""
+    for hdr in $headers; do
+        incs="$incs
+#include <$hdr>"
+    done
+    check_cc "$@" <<EOF && enable_safe "${struct}_${member}"
+$incs
+const void *p = &(($struct *)0)->$member;
+EOF
+}
+
 require(){
     name="$1"
     header="$2"
@@ -962,6 +982,7 @@ HAVE_LIST="
     exp2
     exp2f
     fast_64bit
+    fast_clz
     fast_cmov
     fast_unaligned
     fork
@@ -1094,6 +1115,8 @@ sse_deps="mmx"
 ssse3_deps="sse"
 vis_deps="sparc"
 
+fast_clz_if_any="alpha armv5te avr32 mips ppc x86"
+
 need_memalign="altivec neon sse"
 inline_asm_deps="!tms470"
 
@@ -1553,6 +1576,7 @@ tmpfile TMPE  $EXESUF
 tmpfile TMPH  .h
 tmpfile TMPO  .o
 tmpfile TMPS  .S
+tmpfile TMPV  .ver
 tmpfile TMPSH .sh
 
 unset -f mktemp
@@ -1765,8 +1789,12 @@ case $cpu in
         cpuflags="-mcpu=cell"
         enable ldbrx
     ;;
+    i[345]86|pentium)
+        cpuflags="-march=$cpu"
+        disable mmx
+    ;;
     # targets that do NOT support conditional mov (cmov)
-    i[345]86|pentium|pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
+    pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
         cpuflags="-march=$cpu"
         disable cmov
     ;;
@@ -2020,6 +2048,8 @@ case $target_os in
             { check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; }
         ;;
     mingw32*)
+        # Only WinXP or greater are supported
+        add_cflags -D_WIN32_WINNT=0x0501
         if test $target_os = "mingw32ce"; then
             disable network
         else
@@ -2312,6 +2342,12 @@ EOF
     esac
     disabled yasm || { check_yasm "pabsw xmm0, xmm0" && enable yasm; }
 
+    case "$cpu" in
+        athlon*|opteron*|k8*|pentium|pentium-mmx|prescott|nocona|atom|geode)
+            disable fast_clz
+        ;;
+    esac
+
 fi
 
 if check_func dlopen; then
@@ -2430,31 +2466,14 @@ if enabled libdc1394; then
     die "ERROR: No version of libdc1394 found "
 fi
 
-disable sdl_too_old
-disable sdl
 SDL_CONFIG="${cross_prefix}sdl-config"
 if "${SDL_CONFIG}" --version > /dev/null 2>&1; then
     sdl_cflags=$("${SDL_CONFIG}" --cflags)
     sdl_libs=$("${SDL_CONFIG}" --libs)
-    temp_cflags $sdl_cflags
-    temp_extralibs $sdl_libs
-    if check_lib2 SDL.h SDL_Init; then
-        _sdlversion=$("${SDL_CONFIG}" --version | sed 's/[^0-9]//g')
-        if test "$_sdlversion" -lt 121 ; then
-            enable sdl_too_old
-        else
-            enable sdl
-            check_cc $sdl_cflags <<EOF && enable sdl_video_size
-#include <SDL.h>
-int main(int argc, char **argv){
-    const SDL_VideoInfo *vi = SDL_GetVideoInfo();
-    int w = vi->current_w;
-    return 0;
-}
-EOF
-        fi
-    fi
-    restore_flags
+    check_func_headers SDL.h SDL_Init $sdl_cflags $sdl_libs &&
+    check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
+    enable sdl &&
+    check_struct SDL.h SDL_VideoInfo current_w $sdl_cflags && enable sdl_video_size
 fi
 
 texi2html -version > /dev/null 2>&1 && enable texi2html || disable texi2html
@@ -2523,7 +2542,7 @@ check_func XOpenDisplay -lX11           &&
 check_func XShmCreateImage -lX11 -lXext &&
 check_func XFixesGetCursorImage -lX11 -lXext -lXfixes
 
-if enabled vdpau_vdpau_h; then
+if ! disabled vdpau && enabled vdpau_vdpau_h; then
 check_cpp_condition \
     vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP" ||
     { echolog "Please upgrade to libvdpau >= 0.2 if you would like vdpau support." &&
@@ -2552,6 +2571,10 @@ check_ldflags -Wl,--as-needed
 check_ldflags '-Wl,-rpath-link,\$(BUILD_ROOT)/libpostproc -Wl,-rpath-link,\$(BUILD_ROOT)/libswscale -Wl,-rpath-link,\$(BUILD_ROOT)/libavfilter -Wl,-rpath-link,\$(BUILD_ROOT)/libavdevice -Wl,-rpath-link,\$(BUILD_ROOT)/libavformat -Wl,-rpath-link,\$(BUILD_ROOT)/libavcodec -Wl,-rpath-link,\$(BUILD_ROOT)/libavutil'
 check_ldflags -Wl,-Bsymbolic
 
+echo "X{};" > $TMPV
+test_ldflags -Wl,--version-script,$TMPV &&
+    append SHFLAGS '-Wl,--version-script,\$(SUBDIR)lib\$(NAME).ver'
+
 if enabled small; then
     check_cflags -Os            # not all compilers support -Os
     optimizations="small"
@@ -2697,9 +2720,6 @@ if enabled network; then
 fi
 echo "threading support         ${thread_type-no}"
 echo "SDL support               ${sdl-no}"
-if enabled sdl_too_old; then
-    echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support."
-fi
 echo "Sun medialib support      ${mlib-no}"
 echo "AVISynth enabled          ${avisynth-no}"
 echo "libdc1394 support         ${libdc1394-no}"