From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 2/3] use pkg-config for sdl when cross compiling
Date: Thu, 7 Jan 2010 15:42:17 +0100 [thread overview]
Message-ID: <1262875338-4104-3-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1262875338-4104-1-git-send-email-pbonzini@redhat.com>
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 <pbonzini@redhat.com>
---
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
next prev parent reply other threads:[~2010-01-07 14:51 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-07 14:42 [Qemu-devel] [PATCH 0/3] Fixes for Linux->Win32 cross-compilation Paolo Bonzini
2010-01-07 14:42 ` [Qemu-devel] [PATCH 1/3] use cross-prefix for pkg-config Paolo Bonzini
2010-01-07 14:42 ` Paolo Bonzini [this message]
2010-01-11 19:40 ` [Qemu-devel] [PATCH 2/3] use pkg-config for sdl when cross compiling Anthony Liguori
2010-01-12 8:46 ` Paolo Bonzini
2010-01-12 15:03 ` Anthony Liguori
2010-01-07 14:42 ` [Qemu-devel] [PATCH 3/3] use pkg-config for libcurl " Paolo Bonzini
2010-01-07 15:23 ` [Qemu-devel] [PATCH 0/3] Fixes for Linux->Win32 cross-compilation Stefan Weil
2010-01-07 18:28 ` [Qemu-devel] " Paolo Bonzini
2010-01-07 19:46 ` Anthony Liguori
2010-01-08 7:27 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1262875338-4104-3-git-send-email-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).