From patchwork Tue Apr 10 09:24:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 896553 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=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40L1xM2Gdzz9s1p for ; Tue, 10 Apr 2018 19:25:43 +1000 (AEST) Received: from localhost ([::1]:56898 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5pX3-0004n6-3M for incoming@patchwork.ozlabs.org; Tue, 10 Apr 2018 05:25:41 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34251) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5pWE-0004jo-6R for qemu-devel@nongnu.org; Tue, 10 Apr 2018 05:24:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f5pWD-0006Vm-4f for qemu-devel@nongnu.org; Tue, 10 Apr 2018 05:24:50 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:57994 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f5pWC-0006UT-VM for qemu-devel@nongnu.org; Tue, 10 Apr 2018 05:24:49 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 37652818AAEE; Tue, 10 Apr 2018 09:24:48 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-121.ams2.redhat.com [10.36.116.121]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9D9612026E03; Tue, 10 Apr 2018 09:24:47 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id CF4EC9C400; Tue, 10 Apr 2018 11:24:46 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 10 Apr 2018 11:24:46 +0200 Message-Id: <20180410092446.26903-5-kraxel@redhat.com> In-Reply-To: <20180410092446.26903-1-kraxel@redhat.com> References: <20180410092446.26903-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Tue, 10 Apr 2018 09:24:48 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Tue, 10 Apr 2018 09:24:48 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'kraxel@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 4/4] configure: don't warn SDL abi if disabled 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 , Fam Zheng , Peter Xu , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Gerd Hoffmann , Paolo Bonzini Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Peter Xu SDL has the same problem as GTK that we might get warnings on SDL ABI version even if SDL is disabled. Fix that by only probing SDL if SDL is enabled. Also this should let configure be a little bit faster since we don't really need to probe SDL stuff when it's off. CC: Paolo Bonzini CC: Gerd Hoffmann CC: Peter Maydell CC: Daniel P. Berrange CC: Fam Zheng CC: "Philippe Mathieu-Daudé" Signed-off-by: Peter Xu Reviewed-by: Daniel P. Berrangé Reviewed-by: Fam Zheng Message-id: 20180410054034.20479-1-peterx@redhat.com Signed-off-by: Gerd Hoffmann --- configure | 87 ++++++++++++++++++++++++++++++++++----------------------------- 1 file changed, 47 insertions(+), 40 deletions(-) diff --git a/configure b/configure index 931d2a07cc..0a19b033bc 100755 --- a/configure +++ b/configure @@ -2835,49 +2835,52 @@ fi # Look for sdl configuration program (pkg-config or sdl-config). Try # sdl-config even without cross prefix, and favour pkg-config over sdl-config. -if test "$sdlabi" = ""; then - if $pkg_config --exists "sdl2"; then - sdlabi=2.0 - elif $pkg_config --exists "sdl"; then - sdlabi=1.2 - else - sdlabi=2.0 +sdl_probe () +{ + sdl_too_old=no + if test "$sdlabi" = ""; then + if $pkg_config --exists "sdl2"; then + sdlabi=2.0 + elif $pkg_config --exists "sdl"; then + sdlabi=1.2 + else + sdlabi=2.0 + fi + fi + + if test $sdlabi = "2.0"; then + sdl_config=$sdl2_config + sdlname=sdl2 + sdlconfigname=sdl2_config + elif test $sdlabi = "1.2"; then + sdlname=sdl + sdlconfigname=sdl_config + else + error_exit "Unknown sdlabi $sdlabi, must be 1.2 or 2.0" + fi + + if test "$(basename $sdl_config)" != $sdlconfigname && ! has ${sdl_config}; then + sdl_config=$sdlconfigname + fi + + if $pkg_config $sdlname --exists; then + sdlconfig="$pkg_config $sdlname" + sdlversion=$($sdlconfig --modversion 2>/dev/null) + elif has ${sdl_config}; then + sdlconfig="$sdl_config" + sdlversion=$($sdlconfig --version) + else + if test "$sdl" = "yes" ; then + feature_not_found "sdl" "Install SDL2-devel" fi -fi - -if test $sdlabi = "2.0"; then - sdl_config=$sdl2_config - sdlname=sdl2 - sdlconfigname=sdl2_config -elif test $sdlabi = "1.2"; then - sdlname=sdl - sdlconfigname=sdl_config -else - error_exit "Unknown sdlabi $sdlabi, must be 1.2 or 2.0" -fi - -if test "$(basename $sdl_config)" != $sdlconfigname && ! has ${sdl_config}; then - sdl_config=$sdlconfigname -fi - -if $pkg_config $sdlname --exists; then - sdlconfig="$pkg_config $sdlname" - sdlversion=$($sdlconfig --modversion 2>/dev/null) -elif has ${sdl_config}; then - sdlconfig="$sdl_config" - sdlversion=$($sdlconfig --version) -else - if test "$sdl" = "yes" ; then - feature_not_found "sdl" "Install SDL2-devel" + sdl=no + # no need to do the rest + return + fi + if test -n "$cross_prefix" && test "$(basename "$sdlconfig")" = sdl-config; then + echo warning: using "\"$sdlconfig\"" to detect cross-compiled sdl >&2 fi - sdl=no -fi -if test -n "$cross_prefix" && test "$(basename "$sdlconfig")" = sdl-config; then - echo warning: using "\"$sdlconfig\"" to detect cross-compiled sdl >&2 -fi -sdl_too_old=no -if test "$sdl" != "no" ; then cat > $TMPC << EOF #include #undef main /* We don't want SDL to override our main() */ @@ -2919,6 +2922,10 @@ EOF fi sdl=no fi # sdl compile test +} + +if test "$sdl" != "no" ; then + sdl_probe fi if test "$sdl" = "yes" ; then