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 187  
188 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 199 cat > $TMPC << EOF
191 200 #include <SDL.h>
192 201 #undef main /* We don't want SDL to override our main() */
193 202 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
194 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 207 if test "$_sdlversion" -lt 121 ; then
200 208 sdl_too_old=yes
201 209 else
... ... @@ -203,7 +211,8 @@ sdl=yes
203 211 fi
204 212 fi
205 213  
206   -fi
  214 +fi # cross compilation
  215 +fi # -z $sdl
207 216  
208 217 if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
209 218 cat << EOF
... ... @@ -355,15 +364,15 @@ fi
355 364 if test "$sdl" = "yes" ; then
356 365 echo "CONFIG_SDL=yes" >> $config_mak
357 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 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 371 if [ "${aa}" = "yes" ] ; then
363 372 echo -n " `aalib-config --libs`" >> $config_mak ;
364 373 fi
365 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 376 if [ "${aa}" = "yes" ] ; then
368 377 echo -n " `aalib-config --cflags`" >> $config_mak ;
369 378 fi
... ...