configure: don't warn SDL abi if disabled

SDL has the same problem as GTK that we might get warnings on SDL ABI
version even if SDL is disabled.  Fix that by only probing SDL if SDL is
enabled.  Also this should let configure be a little bit faster since we
don't really need to probe SDL stuff when it's off.

CC: Paolo Bonzini <pbonzini@redhat.com>
CC: Gerd Hoffmann <kraxel@redhat.com>
CC: Peter Maydell <peter.maydell@linaro.org>
CC: Daniel P. Berrange <berrange@redhat.com>
CC: Fam Zheng <famz@redhat.com>
CC: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Message-id: 20180410054034.20479-1-peterx@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Peter Xu 2018-04-10 13:40:34 +08:00 committed by Gerd Hoffmann
parent 5a464e6ce8
commit c6093a05d6
1 changed files with 48 additions and 41 deletions

89
configure vendored
View File

@ -2835,49 +2835,52 @@ fi
# Look for sdl configuration program (pkg-config or sdl-config). Try # Look for sdl configuration program (pkg-config or sdl-config). Try
# sdl-config even without cross prefix, and favour pkg-config over sdl-config. # sdl-config even without cross prefix, and favour pkg-config over sdl-config.
if test "$sdlabi" = ""; then sdl_probe ()
if $pkg_config --exists "sdl2"; then {
sdlabi=2.0 sdl_too_old=no
elif $pkg_config --exists "sdl"; then if test "$sdlabi" = ""; then
sdlabi=1.2 if $pkg_config --exists "sdl2"; then
else sdlabi=2.0
sdlabi=2.0 elif $pkg_config --exists "sdl"; then
fi sdlabi=1.2
fi else
sdlabi=2.0
if test $sdlabi = "2.0"; then fi
sdl_config=$sdl2_config fi
sdlname=sdl2
sdlconfigname=sdl2_config if test $sdlabi = "2.0"; then
elif test $sdlabi = "1.2"; then sdl_config=$sdl2_config
sdlname=sdl sdlname=sdl2
sdlconfigname=sdl_config sdlconfigname=sdl2_config
else elif test $sdlabi = "1.2"; then
error_exit "Unknown sdlabi $sdlabi, must be 1.2 or 2.0" sdlname=sdl
fi sdlconfigname=sdl_config
else
if test "$(basename $sdl_config)" != $sdlconfigname && ! has ${sdl_config}; then error_exit "Unknown sdlabi $sdlabi, must be 1.2 or 2.0"
sdl_config=$sdlconfigname fi
fi
if test "$(basename $sdl_config)" != $sdlconfigname && ! has ${sdl_config}; then
if $pkg_config $sdlname --exists; then sdl_config=$sdlconfigname
sdlconfig="$pkg_config $sdlname" fi
sdlversion=$($sdlconfig --modversion 2>/dev/null)
elif has ${sdl_config}; then if $pkg_config $sdlname --exists; then
sdlconfig="$sdl_config" sdlconfig="$pkg_config $sdlname"
sdlversion=$($sdlconfig --version) sdlversion=$($sdlconfig --modversion 2>/dev/null)
else elif has ${sdl_config}; then
if test "$sdl" = "yes" ; then sdlconfig="$sdl_config"
feature_not_found "sdl" "Install SDL2-devel" sdlversion=$($sdlconfig --version)
else
if test "$sdl" = "yes" ; then
feature_not_found "sdl" "Install SDL2-devel"
fi
sdl=no
# no need to do the rest
return
fi
if test -n "$cross_prefix" && test "$(basename "$sdlconfig")" = sdl-config; then
echo warning: using "\"$sdlconfig\"" to detect cross-compiled sdl >&2
fi fi
sdl=no
fi
if test -n "$cross_prefix" && test "$(basename "$sdlconfig")" = sdl-config; then
echo warning: using "\"$sdlconfig\"" to detect cross-compiled sdl >&2
fi
sdl_too_old=no
if test "$sdl" != "no" ; then
cat > $TMPC << EOF cat > $TMPC << EOF
#include <SDL.h> #include <SDL.h>
#undef main /* We don't want SDL to override our main() */ #undef main /* We don't want SDL to override our main() */
@ -2919,6 +2922,10 @@ EOF
fi fi
sdl=no sdl=no
fi # sdl compile test fi # sdl compile test
}
if test "$sdl" != "no" ; then
sdl_probe
fi fi
if test "$sdl" = "yes" ; then if test "$sdl" = "yes" ; then