]> git.proxmox.com Git - qemu.git/commitdiff
Fix cross compilation
authorStefan Weil <weil@mail.berlios.de>
Sun, 11 Apr 2010 16:44:18 +0000 (18:44 +0200)
committerAurelien Jarno <aurelien@aurel32.net>
Wed, 19 May 2010 06:46:10 +0000 (08:46 +0200)
This patch enhances the algorithm which finds the correct settings for SDL.
For cross compilations (when cross_prefix is set), it looks for sdl-config
with cross prefix. Here is the complete search order:

$(cross_prefix}pkg-config              (old, only used for cross compilation)
${cross_prefix}sdl_config              (new, only used for cross compilation)
pkg-config                             (old, needs PATH)
sdl-config                             (old, needs PATH)

Cross SDL packages (or the user) now can simply set a link (for example
/usr/bin/i586-mingw32msvc-sdl-config -> /usr/i586-mingw32msvc/bin/sdl-config)
which allows cross compilations without PATH modifications.

Without the patch, configure and make (which calls configure) typically
need a non-standard PATH. Failing to set this special PATH results in
broken builds.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
configure

index 36d028fef69301ea33aea8913658cf69e5995c99..3cd2c5f7cb287418b0fb02b233079fd1fef2cb93 100755 (executable)
--- a/configure
+++ b/configure
@@ -1064,7 +1064,17 @@ fi
 ##########################################
 # SDL probe
 
-if $pkgconfig sdl --modversion >/dev/null 2>&1; then
+# Look for sdl configuration program (pkg-config or sdl-config).
+# Prefer variant with cross prefix if cross compiling,
+# and favour pkg-config with sdl over sdl-config.
+if test -n "$cross_prefix" -a $pkgconfig != pkg-config && \
+     $pkgconfig sdl --modversion >/dev/null 2>&1; then
+  sdlconfig="$pkgconfig sdl"
+  _sdlversion=`$sdlconfig --modversion 2>/dev/null | sed 's/[^0-9]//g'`
+elif test -n "$cross_prefix" && has ${cross_prefix}sdl-config; then
+  sdlconfig="${cross_prefix}sdl-config"
+  _sdlversion=`$sdlconfig --version | sed 's/[^0-9]//g'`
+elif $pkgconfig sdl --modversion >/dev/null 2>&1; then
   sdlconfig="$pkgconfig sdl"
   _sdlversion=`$sdlconfig --modversion 2>/dev/null | sed 's/[^0-9]//g'`
 elif has sdl-config; then