qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Sergei Trofimovich <slyfox@inbox.ru>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Sergei Trofimovich <slyfox@gentoo.org>
Subject: [Qemu-devel] [PATCH v2 1/2] ./configure: request pkg-config to provide private libs when static linking
Date: Mon, 23 Jan 2012 20:44:03 +0300	[thread overview]
Message-ID: <1327340643-15446-1-git-send-email-slyfox@inbox.ru> (raw)
In-Reply-To: <CAFEAcA9EuBymG6UMXbW6d6c_a8xLnPuaRZOf5qr9Qsvb2c91KQ@mail.gmail.com>

From: Sergei Trofimovich <slyfox@gentoo.org>

Added wrapper around pkg-config to allow:
- safe options injection via ${QEMU_PKG_CONFIG_FLAGS}
- spaces in path to pkg-config

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
---
 configure |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index 467e87b..97d51a7 100755
--- a/configure
+++ b/configure
@@ -234,7 +234,11 @@ ld="${LD-${cross_prefix}ld}"
 libtool="${LIBTOOL-${cross_prefix}libtool}"
 strip="${STRIP-${cross_prefix}strip}"
 windres="${WINDRES-${cross_prefix}windres}"
-pkg_config="${PKG_CONFIG-${cross_prefix}pkg-config}"
+pkg_config_exe="${PKG_CONFIG-${cross_prefix}pkg-config}"
+query_pkg_config() {
+    "${pkg_config_exe}" ${QEMU_PKG_CONFIG_FLAGS} "$@"
+}
+pkg_config=query_pkg_config # TODO: sed 's/$pkg_config/pkg_config/g'
 sdl_config="${SDL_CONFIG-${cross_prefix}sdl-config}"
 
 # default flags for all hosts
@@ -553,6 +557,7 @@ for opt do
   --static)
     static="yes"
     LDFLAGS="-static $LDFLAGS"
+    QEMU_PKG_CONFIG_FLAGS="--static $QEMU_PKG_CONFIG_FLAGS"
   ;;
   --mandir=*) mandir="$optarg"
   ;;
@@ -1445,8 +1450,8 @@ fi
 ##########################################
 # pkg-config probe
 
-if ! has $pkg_config; then
-  echo "Error: pkg-config binary '$pkg_config' not found"
+if ! has "$pkg_config_exe"; then
+  echo "Error: pkg-config binary '$pkg_config_exe' not found"
   exit 1
 fi
 
-- 
1.7.8.3

  reply	other threads:[~2012-01-23 17:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-23  7:41 [Qemu-devel] [PATCH 1/2] ./configure: request pkg-config to provide private libs when static linking Sergei Trofimovich
2012-01-23  7:41 ` [Qemu-devel] [PATCH 2/2] ./configure: add link check for nss-smartcard Sergei Trofimovich
2012-01-23  8:51   ` Alon Levy
2012-01-29  7:51   ` Sergei Trofimovich
2012-01-23 10:33 ` [Qemu-devel] [PATCH 1/2] ./configure: request pkg-config to provide private libs when static linking Peter Maydell
2012-01-23 17:44   ` Sergei Trofimovich [this message]
2012-01-23 18:02     ` [Qemu-devel] [PATCH v2 " Peter Maydell
2012-01-23 18:33       ` [Qemu-devel] [PATCH v3 " Sergei Trofimovich
2012-01-29  7:52         ` Sergei Trofimovich

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=1327340643-15446-1-git-send-email-slyfox@inbox.ru \
    --to=slyfox@inbox.ru \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=slyfox@gentoo.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).