qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 2/3] use pkg-config for sdl when cross compiling


From: Paolo Bonzini
Subject: [Qemu-devel] [PATCH 2/3] use pkg-config for sdl when cross compiling
Date: Thu, 7 Jan 2010 15:42:17 +0100

Together with the previous patch this enables using the prefixed
pkg-config, thus picking up the correct flags for SDL.  Since
pkg-config has an awful lot of dependencies, I still use sdl-config
when not cross-compiling since some people may only have the latter.

Signed-off-by: Paolo Bonzini <address@hidden>
---
 configure |   23 +++++++++++++++--------
 1 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/configure b/configure
index a6acff2..9fc3173 100755
--- a/configure
+++ b/configure
@@ -989,18 +989,24 @@ fi
 ##########################################
 # SDL probe
 
-sdl_too_old=no
+if test "$pkgconfig" = pkg-config; then
+  sdlconfig='sdl-config'
+  _sdlversion=`$sdlconfig --version | sed 's/[^0-9]//g'`
+else
+  sdlconfig="$pkgconfig sdl"
+  _sdlversion=`$sdlconfig --modversion | sed 's/[^0-9]//g'`
+fi
 
+sdl_too_old=no
 if test "$sdl" != "no" ; then
   cat > $TMPC << EOF
 #include <SDL.h>
 #undef main /* We don't want SDL to override our main() */
 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
 EOF
-  sdl_cflags=`sdl-config --cflags 2> /dev/null`
-  sdl_libs=`sdl-config --libs 2> /dev/null`
+  sdl_cflags=`$sdlconfig --cflags 2> /dev/null`
+  sdl_libs=`$sdlconfig --libs 2> /dev/null`
   if compile_prog "$sdl_cflags" "$sdl_libs" ; then
-    _sdlversion=`sdl-config --version | sed 's/[^0-9]//g'`
     if test "$_sdlversion" -lt 121 ; then
       sdl_too_old=yes
     else
@@ -1009,10 +1015,11 @@ EOF
       fi
     fi
 
-    # static link with sdl ?
-    if test "$sdl" = "yes" -a "$static" = "yes" ; then
-      sdl_libs=`sdl-config --static-libs 2>/dev/null`
-      if test `sdl-config --static-libs 2>/dev/null | grep \\\-laa > 
/dev/null` ; then
+    # static link with sdl ? sdl.pc is broken here, so if cross-compiling
+    # hope for the best
+    if test "$sdl" = "yes" -a "$static" = "yes" -a "$sdlconfig" = sdl-config; 
then
+      sdl_libs=`$sdlconfig --static-libs 2>/dev/null`
+      if test `$sdlconfig --static-libs 2>/dev/null | grep \\\-laa > 
/dev/null`; then
          sdl_libs="$sdl_libs `aalib-config --static-libs >2 /dev/null`"
          sdl_cflags="$sd_cflags `aalib-config --cflags >2 /dev/null`"
       fi
-- 
1.6.5.2






reply via email to

[Prev in Thread] Current Thread [Next in Thread]