From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, Stefan Hajnoczi <stefanha@gmail.com>,
"Yann E. MORIN" <yann.morin.1998@free.fr>,
Peter Maydell <peter.maydell@linaro.org>
Subject: [Qemu-devel] [PATCH 2/2] configure: fix detection for SDL libs when static linking
Date: Sun, 2 Sep 2012 15:09:46 +0200 [thread overview]
Message-ID: <1346591386-22698-3-git-send-email-yann.morin.1998@free.fr> (raw)
In-Reply-To: <1346591386-22698-1-git-send-email-yann.morin.1998@free.fr>
Currently, configure checks for SDL libs either with pkg-config (the
default), or with sdl-config (as a fallback).
But sdl-config does not have the same set of options as pkg-config:
- to check for shared libs, both use the option: --libs
- to check for static libs:
- pkg-config uses: --static --libs
- sdl-config uses: --static-libs
Fix that by using the previously introduced $QEMU_XXX_CONFIG_LIBS_FLAGS
variable, the way it was done previously for cURL.
Also, simplify the code-path for checking for SDL libs with a single,
non-conditional call to $sdlconfig, which is either pkg-config or
sdl-config, as checked just above.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: Stefan Hajnoczi <stefanha@gmail.com>
---
configure | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/configure b/configure
index 67c9238..c5888fa 100755
--- a/configure
+++ b/configure
@@ -1646,9 +1646,11 @@ fi
if $pkg_config sdl --modversion >/dev/null 2>&1; then
sdlconfig="$pkg_config sdl"
+ sdlconfiglibs="--libs"
_sdlversion=`$sdlconfig --modversion 2>/dev/null | sed 's/[^0-9]//g'`
elif has ${sdl_config}; then
sdlconfig="$sdl_config"
+ sdlconfiglibs="$QEMU_XXX_CONFIG_LIBS_FLAGS"
_sdlversion=`$sdlconfig --version | sed 's/[^0-9]//g'`
else
if test "$sdl" = "yes" ; then
@@ -1668,11 +1670,7 @@ if test "$sdl" != "no" ; then
int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
EOF
sdl_cflags=`$sdlconfig --cflags 2> /dev/null`
- if test "$static" = "yes" ; then
- sdl_libs=`$sdlconfig --static-libs 2>/dev/null`
- else
- sdl_libs=`$sdlconfig --libs 2> /dev/null`
- fi
+ sdl_libs=`$sdlconfig $sdlconfiglibs 2> /dev/null`
if compile_prog "$sdl_cflags" "$sdl_libs" ; then
if test "$_sdlversion" -lt 121 ; then
sdl_too_old=yes
--
1.7.2.5
next prev parent reply other threads:[~2012-09-02 13:09 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-02 13:09 [Qemu-devel] [PATCH 0/2 v3] Fix static linking for cURL and SDL Yann E. MORIN
2012-09-02 13:09 ` [Qemu-devel] [PATCH 1/2] configure: fix detection for cURL libs when static linking Yann E. MORIN
2012-09-02 13:09 ` Yann E. MORIN [this message]
2012-09-03 9:31 ` [Qemu-devel] [PATCH 0/2 v3] Fix static linking for cURL and SDL Stefan Hajnoczi
2012-09-03 15:41 ` Andreas Färber
2012-09-03 15:44 ` Peter Maydell
2012-09-03 16:28 ` Yann E. MORIN
2012-09-03 16:38 ` Peter Maydell
2012-09-03 17:06 ` Yann E. MORIN
2012-09-05 9:33 ` Stefan Hajnoczi
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=1346591386-22698-3-git-send-email-yann.morin.1998@free.fr \
--to=yann.morin.1998@free.fr \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=stefanha@gmail.com \
/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).