From nobody Thu May 2 10:42:53 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 152333892508051.19584449153001; Mon, 9 Apr 2018 22:42:05 -0700 (PDT) Received: from localhost ([::1]:41971 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5m2T-0004JY-GU for importer@patchew.org; Tue, 10 Apr 2018 01:41:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47346) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5m1U-0003wV-A9 for qemu-devel@nongnu.org; Tue, 10 Apr 2018 01:40:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f5m1P-0005iP-SW for qemu-devel@nongnu.org; Tue, 10 Apr 2018 01:40:52 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:37486 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 1f5m1P-0005i3-Me for qemu-devel@nongnu.org; Tue, 10 Apr 2018 01:40:47 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1C04A722FC; Tue, 10 Apr 2018 05:40:43 +0000 (UTC) Received: from xz-mi.nay.redhat.com (dhcp-14-151.nay.redhat.com [10.66.14.151]) by smtp.corp.redhat.com (Postfix) with ESMTP id 18B31218CC09; Tue, 10 Apr 2018 05:40:35 +0000 (UTC) From: Peter Xu To: qemu-devel@nongnu.org Date: Tue, 10 Apr 2018 13:40:34 +0800 Message-Id: <20180410054034.20479-1-peterx@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 10 Apr 2018 05:40:43 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 10 Apr 2018 05:40:43 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'peterx@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable 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] [PATCH] 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 , peterx@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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=C3=A9" Signed-off-by: Peter Xu Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Fam Zheng --- configure | 83 ++++++++++++++++++++++++++++++++++-------------------------= ---- 1 file changed, 45 insertions(+), 38 deletions(-) diff --git a/configure b/configure index 752dd9ef32..f647026b8d 100755 --- a/configure +++ b/configure @@ -2836,49 +2836,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-con= fig. =20 -if test "$sdlabi" =3D ""; then - if $pkg_config --exists "sdl2"; then - sdlabi=3D2.0 - elif $pkg_config --exists "sdl"; then - sdlabi=3D1.2 - else - sdlabi=3D2.0 - fi -fi +sdl_probe () +{ + sdl_too_old=3Dno + if test "$sdlabi" =3D ""; then + if $pkg_config --exists "sdl2"; then + sdlabi=3D2.0 + elif $pkg_config --exists "sdl"; then + sdlabi=3D1.2 + else + sdlabi=3D2.0 + fi + fi =20 -if test $sdlabi =3D "2.0"; then - sdl_config=3D$sdl2_config - sdlname=3Dsdl2 - sdlconfigname=3Dsdl2_config -elif test $sdlabi =3D "1.2"; then - sdlname=3Dsdl - sdlconfigname=3Dsdl_config -else - error_exit "Unknown sdlabi $sdlabi, must be 1.2 or 2.0" -fi + if test $sdlabi =3D "2.0"; then + sdl_config=3D$sdl2_config + sdlname=3Dsdl2 + sdlconfigname=3Dsdl2_config + elif test $sdlabi =3D "1.2"; then + sdlname=3Dsdl + sdlconfigname=3Dsdl_config + else + error_exit "Unknown sdlabi $sdlabi, must be 1.2 or 2.0" + fi =20 -if test "$(basename $sdl_config)" !=3D $sdlconfigname && ! has ${sdl_confi= g}; then - sdl_config=3D$sdlconfigname -fi + if test "$(basename $sdl_config)" !=3D $sdlconfigname && ! has ${sdl_con= fig}; then + sdl_config=3D$sdlconfigname + fi =20 -if $pkg_config $sdlname --exists; then - sdlconfig=3D"$pkg_config $sdlname" - sdlversion=3D$($sdlconfig --modversion 2>/dev/null) -elif has ${sdl_config}; then - sdlconfig=3D"$sdl_config" - sdlversion=3D$($sdlconfig --version) -else - if test "$sdl" =3D "yes" ; then - feature_not_found "sdl" "Install SDL2-devel" + if $pkg_config $sdlname --exists; then + sdlconfig=3D"$pkg_config $sdlname" + sdlversion=3D$($sdlconfig --modversion 2>/dev/null) + elif has ${sdl_config}; then + sdlconfig=3D"$sdl_config" + sdlversion=3D$($sdlconfig --version) + else + if test "$sdl" =3D "yes" ; then + feature_not_found "sdl" "Install SDL2-devel" + fi + sdl=3Dno + # no need to do the rest + return + fi + if test -n "$cross_prefix" && test "$(basename "$sdlconfig")" =3D sdl-co= nfig; then + echo warning: using "\"$sdlconfig\"" to detect cross-compiled sdl >&2 fi - sdl=3Dno -fi -if test -n "$cross_prefix" && test "$(basename "$sdlconfig")" =3D sdl-conf= ig; then - echo warning: using "\"$sdlconfig\"" to detect cross-compiled sdl >&2 -fi =20 -sdl_too_old=3Dno -if test "$sdl" !=3D "no" ; then cat > $TMPC << EOF #include #undef main /* We don't want SDL to override our main() */ @@ -2920,6 +2923,10 @@ EOF fi sdl=3Dno fi # sdl compile test +} + +if test "$sdl" !=3D "no" ; then + sdl_probe fi =20 if test "$sdl" =3D "yes" ; then --=20 2.14.3