From patchwork Sun Apr 11 16:44:18 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Weil X-Patchwork-Id: 49918 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 45D35B7D22 for ; Mon, 12 Apr 2010 02:50:42 +1000 (EST) Received: from localhost ([127.0.0.1]:51341 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O10IL-0005ca-E3 for incoming@patchwork.ozlabs.org; Sun, 11 Apr 2010 12:46:01 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O10H9-0005cU-3c for qemu-devel@nongnu.org; Sun, 11 Apr 2010 12:44:47 -0400 Received: from [140.186.70.92] (port=54252 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O10H6-0005cM-Pv for qemu-devel@nongnu.org; Sun, 11 Apr 2010 12:44:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O10H4-0004if-Qb for qemu-devel@nongnu.org; Sun, 11 Apr 2010 12:44:44 -0400 Received: from moutng.kundenserver.de ([212.227.17.9]:59284) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O10H4-0004gK-Ct for qemu-devel@nongnu.org; Sun, 11 Apr 2010 12:44:42 -0400 Received: from flocke.weilnetz.de (p54ADE617.dip.t-dialin.net [84.173.230.23]) by mrelayeu.kundenserver.de (node=mreu1) with ESMTP (Nemesis) id 0MK5Y1-1O1pDN3rLp-001fBp; Sun, 11 Apr 2010 18:44:21 +0200 Received: from stefan by flocke.weilnetz.de with local (Exim 4.71) (envelope-from ) id 1O10Gh-000706-LF; Sun, 11 Apr 2010 18:44:19 +0200 From: Stefan Weil To: QEMU Developers Date: Sun, 11 Apr 2010 18:44:18 +0200 Message-Id: <1271004258-26882-1-git-send-email-weil@mail.berlios.de> X-Mailer: git-send-email 1.7.0 In-Reply-To: <20100409194401.GE21042@volta.aurel32.net> References: <20100409194401.GE21042@volta.aurel32.net> X-Provags-ID: V01U2FsdGVkX1+Ug+11/HgVZ/09EoQ7svm/62KQAzDCskF0TzC WMxOt9muHwJpbE6Ens2i1C4Knb18kA+nWp3lW/QC3k3F9SGCbT EMpGHddOnNkuV9g7faYnjo6RTl0oNBAomoOyUVyqdilIvQbGmG vQQ== X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: Aurelien Jarno Subject: [Qemu-devel] [PATCH] Fix cross compilation X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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. v2: * Favour pkg-config over sdl-config for cross compilations (suggested by Aurelien Jarno) and add comment for this. Cc: Aurelien Jarno Signed-off-by: Stefan Weil --- configure | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/configure b/configure index 966cd7d..47fca4f 100755 --- 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