Browse code

configure: simplify libsdl check

Originally committed as revision 21268 to svn://svn.ffmpeg.org/ffmpeg/trunk

Måns Rullgård authored on 2010/01/18 04:10:05
Showing 1 changed files
... ...
@@ -2462,31 +2462,14 @@ if enabled libdc1394; then
2462 2462
     die "ERROR: No version of libdc1394 found "
2463 2463
 fi
2464 2464
 
2465
-disable sdl_too_old
2466
-disable sdl
2467 2465
 SDL_CONFIG="${cross_prefix}sdl-config"
2468 2466
 if "${SDL_CONFIG}" --version > /dev/null 2>&1; then
2469 2467
     sdl_cflags=$("${SDL_CONFIG}" --cflags)
2470 2468
     sdl_libs=$("${SDL_CONFIG}" --libs)
2471
-    temp_cflags $sdl_cflags
2472
-    temp_extralibs $sdl_libs
2473
-    if check_lib2 SDL.h SDL_Init; then
2474
-        _sdlversion=$("${SDL_CONFIG}" --version | sed 's/[^0-9]//g')
2475
-        if test "$_sdlversion" -lt 121 ; then
2476
-            enable sdl_too_old
2477
-        else
2478
-            enable sdl
2479
-            check_cc $sdl_cflags <<EOF && enable sdl_video_size
2480
-#include <SDL.h>
2481
-int main(int argc, char **argv){
2482
-    const SDL_VideoInfo *vi = SDL_GetVideoInfo();
2483
-    int w = vi->current_w;
2484
-    return 0;
2485
-}
2486
-EOF
2487
-        fi
2488
-    fi
2489
-    restore_flags
2469
+    check_func_headers SDL.h SDL_Init $sdl_cflags $sdl_libs &&
2470
+    check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
2471
+    enable sdl &&
2472
+    check_struct SDL.h SDL_VideoInfo current_w $sdl_cflags && enable sdl_video_size
2490 2473
 fi
2491 2474
 
2492 2475
 texi2html -version > /dev/null 2>&1 && enable texi2html || disable texi2html
... ...
@@ -2733,9 +2716,6 @@ if enabled network; then
2733 2733
 fi
2734 2734
 echo "threading support         ${thread_type-no}"
2735 2735
 echo "SDL support               ${sdl-no}"
2736
-if enabled sdl_too_old; then
2737
-    echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support."
2738
-fi
2739 2736
 echo "Sun medialib support      ${mlib-no}"
2740 2737
 echo "AVISynth enabled          ${avisynth-no}"
2741 2738
 echo "libdc1394 support         ${libdc1394-no}"