From patchwork Thu Jan 7 14:42:17 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 42442 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 EB1CBB6EE9 for ; Fri, 8 Jan 2010 01:55:14 +1100 (EST) Received: from localhost ([127.0.0.1]:39747 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NStlY-0008FV-3E for incoming@patchwork.ozlabs.org; Thu, 07 Jan 2010 09:55:12 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NStiP-0006SA-2a for qemu-devel@nongnu.org; Thu, 07 Jan 2010 09:51:57 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NStiK-0006Q1-Hd for qemu-devel@nongnu.org; Thu, 07 Jan 2010 09:51:56 -0500 Received: from [199.232.76.173] (port=55461 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NStiK-0006Pt-Bs for qemu-devel@nongnu.org; Thu, 07 Jan 2010 09:51:52 -0500 Received: from mx1.redhat.com ([209.132.183.28]:62436) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NStiJ-0002uc-Om for qemu-devel@nongnu.org; Thu, 07 Jan 2010 09:51:52 -0500 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o07EgLoP029318 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 7 Jan 2010 09:42:22 -0500 Received: from localhost.localdomain (vpn2-11-178.ams2.redhat.com [10.36.11.178]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o07EgIoU005391 for ; Thu, 7 Jan 2010 09:42:21 -0500 From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 7 Jan 2010 15:42:17 +0100 Message-Id: <1262875338-4104-3-git-send-email-pbonzini@redhat.com> In-Reply-To: <1262875338-4104-1-git-send-email-pbonzini@redhat.com> References: <1262875338-4104-1-git-send-email-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [Qemu-devel] [PATCH 2/3] use pkg-config for sdl when cross compiling 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 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 --- 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 #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