From patchwork Tue Oct 30 11:23:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 990785 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vivier.eu Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42kqVl6Jj6z9s7W for ; Tue, 30 Oct 2018 22:48:47 +1100 (AEDT) Received: from localhost ([::1]:52417 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHSVp-0008Gx-8i for incoming@patchwork.ozlabs.org; Tue, 30 Oct 2018 07:48:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58929) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHS9r-0002mv-SN for qemu-devel@nongnu.org; Tue, 30 Oct 2018 07:26:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHS9h-0004wx-5q for qemu-devel@nongnu.org; Tue, 30 Oct 2018 07:25:54 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:36277) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gHS95-0003N3-Os; Tue, 30 Oct 2018 07:25:16 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MfYc4-1fbleG2Ssa-00g3MY; Tue, 30 Oct 2018 12:24:12 +0100 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MfYc4-1fbleG2Ssa-00g3MY; Tue, 30 Oct 2018 12:24:12 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Tue, 30 Oct 2018 12:23:30 +0100 Message-Id: <20181030112337.17973-14-laurent@vivier.eu> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181030112337.17973-1-laurent@vivier.eu> References: <20181030112337.17973-1-laurent@vivier.eu> X-Provags-ID: V03:K1:7fBwOV45VO0pIDxAfapM/ah0RhizImgZJxgvW5VAB+D0Q8q0Qjs 5+96auVkeKmjT68irIXPp395Iu9qoJkYtJcIqmumqdxcac6arB5JvBmaivSFXhYdIQfAn/B IdQPh6kULgZSvyn4xLfmcD6xkvdzjQD7wTrzQaFnj8DDTiu6skX3OaX0HNkr/1el05Ioo1n PEghlp0GRDR8B+FtI9jyA== X-UI-Out-Filterresults: notjunk:1; V01:K0:JFjVUsmZIcY=:6A+G8CXaCFLZaUJAAJZS9e N12OXqNNFERafHKukwqPjmBIy+w7VvO5UdezU+TkRXrcuOkplzUubU5JKhppnD8S0M71w/ScS Ik36JRtLoGSvtrN6Zv+TxxHat6lUzMmH7NoD5NPmrSyB3ujIoEKAVEJenYmDcAOhj1jyEh7tb DEEaFCx1w1RztjgDVD0ppXivcAOjGuJV3221XIHh94bdNTRcthUiopiCTeTvN82Yb3pcVk8UA VbgzjyAPSrPg+U6Q1BL0+Q/43mZkEAqhy5swU9H9xnUQXymv3c8QfvxRVPgc2gCOb8R9CJ6Y3 qaBBYAjLFkud8d1KU6Q1ghPu6FWTaqc0jOxcWxxUZUb5SKIiKD4Z8BCP1zqcRFnZXldBHBqLU 0YM0oSzbymNIKo4kYd/mOU1gz85w3PWzJB9IF6FhDOfU9ZnIWdhLkmz5HtccGelBdPlWa20of BUMH7rX6A6MLspGtcM11yM0EMwtjCFy1mg3pcDeWU+UNoEuJ4wADhHtT+nrYqJb1uEi9btwR7 EltaY9/WqqTfDaVGEBpeTH7tbKHaCKwiXcdD1pVi1s6jG60i0SPts0wpJzwHsomU3vFkviiFZ +oOwNxxAdzO14fUOJk/yPY1EEUFn8H/rsMi8NZWKbn1j8vPRV7VhwUjPP3P89kAIo2RoukKoc B4feq/mP7ox6KmjO5fnvpXWkL+y7FyfeVbJNZZGK7njxOB5+Pmi6i6OKnpQBcpo7Ovds= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.134 Subject: [Qemu-devel] [PULL v2 13/20] configure: Support pkg-config for zlib X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , "Michael S. Tsirkin" , Jason Wang , Michael Tokarev , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Gerd Hoffmann , Stefano Stabellini , qemu-block@nongnu.org, qemu-trivial@nongnu.org, Michael Walle , Anthony Perard , xen-devel@lists.xenproject.org, Laurent Vivier , Thomas Huth , Fam Zheng , Eduardo Habkost , Stefan Weil , Riku Voipio , qemu-arm@nongnu.org, Cleber Rosa , =?utf-8?q?Alex_Benn=C3=A9e?= , Kevin Wolf , Markus Armbruster , Laurent Vivier , Max Reitz , Igor Mammedov , Aleksandar Markovic , Paolo Bonzini , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Stefan Weil This is needed for builds with the mingw64-* packages from Cygwin, but also works for Linux. Move the zlib test also more to the end because users should get information on the really important missing packages (which also require zlib) first. Signed-off-by: Stefan Weil Reviewed-by: Stefan Hajnoczi Message-Id: <20180712192603.11599-1-sw@weilnetz.de> Signed-off-by: Laurent Vivier --- configure | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/configure b/configure index 1ee09bd112..a02df30dde 100755 --- a/configure +++ b/configure @@ -2151,23 +2151,6 @@ EOF fi fi -######################################### -# zlib check - -if test "$zlib" != "no" ; then - cat > $TMPC << EOF -#include -int main(void) { zlibVersion(); return 0; } -EOF - if compile_prog "" "-lz" ; then - : - else - error_exit "zlib check failed" \ - "Make sure to have the zlib libs and headers installed." - fi -fi -LIBS="$LIBS -lz" - ########################################## # lzo check @@ -3479,6 +3462,29 @@ if ! compile_prog "$glib_cflags -Werror" "$glib_libs" ; then fi fi +######################################### +# zlib check + +if test "$zlib" != "no" ; then + if $pkg_config --exists zlib; then + zlib_cflags=$($pkg_config --cflags zlib) + zlib_libs=$($pkg_config --libs zlib) + QEMU_CFLAGS="$zlib_cflags $QEMU_CFLAGS" + LIBS="$zlib_libs $LIBS" + else + cat > $TMPC << EOF +#include +int main(void) { zlibVersion(); return 0; } +EOF + if compile_prog "" "-lz" ; then + LIBS="$LIBS -lz" + else + error_exit "zlib check failed" \ + "Make sure to have the zlib libs and headers installed." + fi + fi +fi + ########################################## # SHA command probe for modules if test "$modules" = yes; then