Commit a6e022ad139c695e60d1bcb6c298a67aaf5c2916

Authored by bellard
1 parent 702c651c

fixed SDL probing for cross compilation


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@698 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 17 additions and 8 deletions
configure
@@ -187,15 +187,23 @@ sdl_too_old=no @@ -187,15 +187,23 @@ sdl_too_old=no
187 187
188 if test -z "$sdl" ; then 188 if test -z "$sdl" ; then
189 189
  190 +sdl_config="sdl-config"
  191 +sdl=no
  192 +
  193 +if test "$mingw32" = "yes" -a ! -z "$cross_prefix" ; then
  194 +# win32 cross compilation case
  195 + sdl_config="i386-mingw32msvc-sdl-config"
  196 + sdl=yes
  197 +else
  198 +# normal SDL probe
190 cat > $TMPC << EOF 199 cat > $TMPC << EOF
191 #include <SDL.h> 200 #include <SDL.h>
192 #undef main /* We don't want SDL to override our main() */ 201 #undef main /* We don't want SDL to override our main() */
193 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); } 202 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
194 EOF 203 EOF
195 204
196 -sdl=no  
197 -if $cc -o $TMPE `sdl-config --cflags` $TMPC `sdl-config --libs` 2> /dev/null ; then  
198 -_sdlversion=`sdl-config --version | sed 's/[^0-9]//g'` 205 +if $cc -o $TMPE `$sdl_config --cflags 2> /dev/null` $TMPC `$sdl_config --libs 2> /dev/null` 2> /dev/null ; then
  206 +_sdlversion=`$sdl_config --version | sed 's/[^0-9]//g'`
199 if test "$_sdlversion" -lt 121 ; then 207 if test "$_sdlversion" -lt 121 ; then
200 sdl_too_old=yes 208 sdl_too_old=yes
201 else 209 else
@@ -203,7 +211,8 @@ sdl=yes @@ -203,7 +211,8 @@ sdl=yes
203 fi 211 fi
204 fi 212 fi
205 213
206 -fi 214 +fi # cross compilation
  215 +fi # -z $sdl
207 216
208 if test x"$1" = x"-h" -o x"$1" = x"--help" ; then 217 if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
209 cat << EOF 218 cat << EOF
@@ -355,15 +364,15 @@ fi @@ -355,15 +364,15 @@ fi
355 if test "$sdl" = "yes" ; then 364 if test "$sdl" = "yes" ; then
356 echo "CONFIG_SDL=yes" >> $config_mak 365 echo "CONFIG_SDL=yes" >> $config_mak
357 echo "#define CONFIG_SDL 1" >> $config_h 366 echo "#define CONFIG_SDL 1" >> $config_h
358 - echo "SDL_LIBS=`sdl-config --libs`" >> $config_mak 367 + echo "SDL_LIBS=`$sdl_config --libs`" >> $config_mak
359 aa="no" 368 aa="no"
360 - `sdl-config --static-libs | grep \\\-laa > /dev/null` && aa="yes"  
361 - echo -n "SDL_STATIC_LIBS=`sdl-config --static-libs`" >> $config_mak 369 + `$sdl_config --static-libs | grep \\\-laa > /dev/null` && aa="yes"
  370 + echo -n "SDL_STATIC_LIBS=`$sdl_config --static-libs`" >> $config_mak
362 if [ "${aa}" = "yes" ] ; then 371 if [ "${aa}" = "yes" ] ; then
363 echo -n " `aalib-config --libs`" >> $config_mak ; 372 echo -n " `aalib-config --libs`" >> $config_mak ;
364 fi 373 fi
365 echo "" >> $config_mak 374 echo "" >> $config_mak
366 - echo -n "SDL_CFLAGS=`sdl-config --cflags`" >> $config_mak 375 + echo -n "SDL_CFLAGS=`$sdl_config --cflags`" >> $config_mak
367 if [ "${aa}" = "yes" ] ; then 376 if [ "${aa}" = "yes" ] ; then
368 echo -n " `aalib-config --cflags`" >> $config_mak ; 377 echo -n " `aalib-config --cflags`" >> $config_mak ;
369 fi 378 fi