From patchwork Sun Sep 2 13:09:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 181208 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 16D4B2C0081 for ; Mon, 3 Sep 2012 04:20:45 +1000 (EST) Received: from localhost ([::1]:49991 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8Emp-0006rm-3F for incoming@patchwork.ozlabs.org; Sun, 02 Sep 2012 14:20:43 -0400 Received: from eggs.gnu.org ([208.118.235.92]:38931) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T89w1-0001LG-OQ for qemu-devel@nongnu.org; Sun, 02 Sep 2012 09:09:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T89w0-00024p-0y for qemu-devel@nongnu.org; Sun, 02 Sep 2012 09:09:53 -0400 Received: from smtp03.smtpout.orange.fr ([80.12.242.125]:57172 helo=smtp.smtpout.orange.fr) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T89vz-00023Q-FX for qemu-devel@nongnu.org; Sun, 02 Sep 2012 09:09:51 -0400 Received: from treguer.bzh.lan ([90.32.144.8]) by mwinf5d26 with ME id uD9o1j00M0B56Sa03D9pBD; Sun, 02 Sep 2012 15:09:50 +0200 From: "Yann E. MORIN" To: qemu-devel@nongnu.org Date: Sun, 2 Sep 2012 15:09:45 +0200 Message-Id: <1346591386-22698-2-git-send-email-yann.morin.1998@free.fr> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1346591386-22698-1-git-send-email-yann.morin.1998@free.fr> References: <1346591386-22698-1-git-send-email-yann.morin.1998@free.fr> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.12.242.125 X-Mailman-Approved-At: Sun, 02 Sep 2012 14:20:28 -0400 Cc: qemu-trivial@nongnu.org, Stefan Hajnoczi , "Yann E. MORIN" , Peter Maydell Subject: [Qemu-devel] [PATCH 1/2] configure: fix detection for cURL libs when static linking X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Currently, to check for cURL, configure uses either pkg-config (the default), or curl-config (as a fallback). But curl-config and pkg-config do not have the same set of options: - to check for shared libs, both use the option: --libs - to check for static libs: - pkg-config uses: --static --libs - curl-config uses: --static-libs To add to the complexity, pkg-config is called through the querry_pkg_config wrapper, that already passes --static when static linking is required, but there is no such wrapper for curl-config, so we miss the occasion to pass --static-libs To fix this: - introduce a new variable QEMU_XXX_CONFIG_LIBS_FLAGS that mirrors the behavior of QEMU_PKG_CONFIG_FLAGS; this variable can be used by all xxx-config scripts (eg. curl-config, but later sdl-config too). Default it to '--libs', which is for shared linking; - properly use either --libs for pkg-config (--static is already taken care of in the wrapper), or $QEMU_XXX_CONFIG_LIBS_FLAGS for curl-config. Signed-off-by: "Yann E. MORIN" Reviewed-by: Stefan Hajnoczi --- configure | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/configure b/configure index d97fd81..67c9238 100755 --- a/configure +++ b/configure @@ -126,7 +126,7 @@ audio_win_int="" cc_i386=i386-pc-linux-gnu-gcc libs_qga="" debug_info="yes" - +QEMU_XXX_CONFIG_LIBS_FLAGS="--libs" target_list="" # Default value for a variable defining feature "foo". @@ -626,6 +626,7 @@ for opt do static="yes" LDFLAGS="-static $LDFLAGS" QEMU_PKG_CONFIG_FLAGS="--static $QEMU_PKG_CONFIG_FLAGS" + QEMU_XXX_CONFIG_LIBS_FLAGS="--static-libs" ;; --mandir=*) mandir="$optarg" ;; @@ -2077,8 +2078,10 @@ fi if $pkg_config libcurl --modversion >/dev/null 2>&1; then curlconfig="$pkg_config libcurl" + curlconfiglibs="--libs" else curlconfig=curl-config + curlconfiglibs="$QEMU_XXX_CONFIG_LIBS_FLAGS" fi if test "$curl" != "no" ; then @@ -2087,7 +2090,7 @@ if test "$curl" != "no" ; then int main(void) { curl_easy_init(); curl_multi_setopt(0, 0, 0); return 0; } EOF curl_cflags=`$curlconfig --cflags 2>/dev/null` - curl_libs=`$curlconfig --libs 2>/dev/null` + curl_libs=`$curlconfig $curlconfiglibs 2>/dev/null` if compile_prog "$curl_cflags" "$curl_libs" ; then curl=yes libs_tools="$curl_libs $libs_tools"