Received: from [140.186.70.92] (port=34306 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OEnDA-0004W3-I8 for qemu-devel@nongnu.org; Wed, 19 May 2010 13:37:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OEnD7-00028u-3J for qemu-devel@nongnu.org; Wed, 19 May 2010 13:37:39 -0400 Received: from hall.aurel32.net ([88.191.82.174]:36882) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OEnD6-00028R-UM for qemu-devel@nongnu.org; Wed, 19 May 2010 13:37:37 -0400 Date: Wed, 19 May 2010 08:06:48 +0200 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH] Fix cross compilation Message-ID: <20100519060648.GB25432@ohm.aurel32.net> References: <20100409194401.GE21042@volta.aurel32.net> <1271004258-26882-1-git-send-email-weil@mail.berlios.de> <20100518174349.GA31346@ohm.aurel32.net> <4BF2F4C6.20704@mail.berlios.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <4BF2F4C6.20704@mail.berlios.de> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Weil Cc: QEMU Developers On Tue, May 18, 2010 at 10:12:54PM +0200, Stefan Weil wrote: > Am 18.05.2010 19:43, schrieb Aurelien Jarno: > >On Sun, Apr 11, 2010 at 06:44:18PM +0200, Stefan Weil wrote: > >>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&& \ > > ^^^^^^^^^^^^^^^^^^^^^^^^^^ > > Why this test ? > > > > This tests for cross compilation with a working cross pkg-config > (and not the fallback solution "hope for the best" which is used > in the third case). > > >>+ $pkgconfig sdl --modversion>/dev/null 2>&1; then > >>+ sdlconfig="$pkgconfig sdl" > >It should probably be sdlconfig="${cross_prefix}$pkgconfig sdl" so that > >the cross version of pkg-config is called later in this file. > > pkgconfig="${cross_prefix}pkg-config" (was set earlier), > so it is the cross version. > Ok, it makes sense now, applied. -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net