From patchwork Fri Oct 26 15:31:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 989639 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 42hTCB2Dbqz9sMl for ; Sat, 27 Oct 2018 02:57:09 +1100 (AEDT) Received: from localhost ([::1]:60792 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gG4Ty-0006OG-2K for incoming@patchwork.ozlabs.org; Fri, 26 Oct 2018 11:57:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50276) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gG4J9-0004cv-On for qemu-devel@nongnu.org; Fri, 26 Oct 2018 11:45:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gG46w-0005Sz-An for qemu-devel@nongnu.org; Fri, 26 Oct 2018 11:33:20 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:46289) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gG46n-0005Ha-J6; Fri, 26 Oct 2018 11:33:11 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N2SXX-1faiyG0v0B-013yG4; Fri, 26 Oct 2018 17:32:07 +0200 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N2SXX-1faiyG0v0B-013yG4; Fri, 26 Oct 2018 17:32:07 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Fri, 26 Oct 2018 17:31:18 +0200 Message-Id: <20181026153125.24738-14-laurent@vivier.eu> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181026153125.24738-1-laurent@vivier.eu> References: <20181026153125.24738-1-laurent@vivier.eu> X-Provags-ID: V03:K1:nHwqIfD7U1p4B2yoxOg3RbD7c0Q74lJnwOwV3+memYJKXd3VPHe ukJt7WzZgTFF8QfTFWEH8S+Kf/pXvB56SNq79YrtKkct5Bc1bE62Zqold5ehue7Ngj6gXZh ic4RlJ9ug1N1xqIQLYFSHfDHmWQrNQNJII4YgJ9s/ruhmlhI0LVhrIjrNYsS161Z4ZQTuKq dKIkAR8/79m8hupRwCipQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:u0w10T44iq4=:9aPSRBKTLB6nG1raNJUVAo IYRblKzQ+KTyDtQ5cT/QxcnxjdO49BCoiVJHMAEjzye5s+4S9kjyXuoCI8Tkkt21yBPP0OWdv Dr3qGNEEGXw9IUyGQm5/aMVxIsq5CG83Y5pyS+ovvttzW0MYl/ELBNfDUSxt44VEDbVSo4ned MsvIrXR3OOy+uNW+p3BzEOnaVRUCGJMzqShk8XdgN3G1ERVd6pjFmBwTP9/8C6CcGyrAodSof uqd6KajrBc9i1pyszFjLIC9pgSXPsLsrcw6jYMGnQ/Gzm2kXzrmLR8D/1Vyq7dKkJSCbaLH1T gBvSfUd0l+7fhqn+bOcRYtMVFL3Kwj7YMDHNMwbZL9h2hF9U3I3M/EK0MyZq5YV8cds8xYDzf GDGrKjUpEZglB82W3MmQLxOhh/t2gSfUW0PHmM1ngibCUXy9AdubtpOIU548idKOEOTjvxpVT /NDq2RzWYsW7/iUHPZFC7ocJR++HqEV8ITNdJoispY6ycRT/yH10zJZoefv9yTb9/t1lvEau6 FyvbdlPtubEFjF/OexQiSoq+t24OgmoPIz7VxoNiNcLpyfRCHUUf3Vpq6GRpPk9B6q00P/k1V E4EcwT9Wy7fM3v/5XallPkxURFRxwoEPCJgAAdX2UGeRjsyml4M5iPua4zPeCAfOyYU9trVH3 Ul9Ee0TcZx1paAZ66Su+q25L2H952IEeRu1bLXrcs5HoVDGyMnznCjR1P6FGpMk+MGrE= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.133 Subject: [Qemu-devel] [PULL 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, Markus Armbruster , Anthony Perard , xen-devel@lists.xenproject.org, Igor Mammedov , 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 , Laurent Vivier , Max Reitz , Michael Walle , 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