From nobody Mon Apr 29 12:04:46 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) 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=temperror (zoho.com: Error in retrieving data from DNS) 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 (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1523352620515843.3533911245203; Tue, 10 Apr 2018 02:30:20 -0700 (PDT) Received: from localhost ([::1]:57117 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5pbX-0001ST-MU for importer@patchew.org; Tue, 10 Apr 2018 05:30:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34248) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5pWD-0004ja-Ur 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-0006Ve-0F for qemu-devel@nongnu.org; Tue, 10 Apr 2018 05:24:49 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:46880 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-0006UA-SU for qemu-devel@nongnu.org; Tue, 10 Apr 2018 05:24:48 -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 247F27C6DC for ; 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 B09E02140625; Tue, 10 Apr 2018 09:24:47 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id B7E309C3E5; Tue, 10 Apr 2018 11:24:46 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 10 Apr 2018 11:24:43 +0200 Message-Id: <20180410092446.26903-2-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.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 09:24:48 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 10 Apr 2018 09:24:48 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'kraxel@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] [PULL 1/4] ui: fix keymap detection under Xwayland 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: Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_6 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Daniel P. Berrang=C3=A9 The X11 code currently detects the keymap by looking for the keycode name property. Unfortunately due to the way Xwayland handles keyboards, this property gets unset almost immediately after the first application starts using Xwayland resulting in ** (qemu-system-x86_64:19644): WARNING **: Unknown X11 keycode mapping '(= unnamed)'. Please report to qemu-devel@nongnu.org including the following information: - Operating system - X11 Server - xprop -root - xdpyinfo Fortunately people will only see this problem if they built QEMU with GTK2, or have told GTK3 to prefer X11 by setting the GDK_BACKEND=3Dx11 env variable. To workaround the problem, we add a heuristic that looks at what scancode the XK_Page_Up keysymbol maps to, to determine if we've likely got the X11 kbd or evdev driver. Signed-off-by: Daniel P. Berrang=C3=A9 Message-Id: <20180313104235.20725-1-berrange@redhat.com> Signed-off-by: Gerd Hoffmann --- ui/x_keymap.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ui/x_keymap.c b/ui/x_keymap.c index 22e0e77c4d..2bc01432e5 100644 --- a/ui/x_keymap.c +++ b/ui/x_keymap.c @@ -17,6 +17,7 @@ #include "ui/input.h" =20 #include +#include =20 static gboolean check_for_xwin(Display *dpy) { @@ -87,11 +88,13 @@ const guint16 *qemu_xkeymap_mapping_table(Display *dpy,= size_t *maplen) trace_xkeymap_keymap("xquartz"); *maplen =3D qemu_input_map_xorgxquartz_to_qcode_len; return qemu_input_map_xorgxquartz_to_qcode; - } else if (keycodes && g_str_has_prefix(keycodes, "evdev")) { + } else if ((keycodes && g_str_has_prefix(keycodes, "evdev")) || + (XKeysymToKeycode(dpy, XK_Page_Up) =3D=3D 0x70)) { trace_xkeymap_keymap("evdev"); *maplen =3D qemu_input_map_xorgevdev_to_qcode_len; return qemu_input_map_xorgevdev_to_qcode; - } else if (keycodes && g_str_has_prefix(keycodes, "xfree86")) { + } else if ((keycodes && g_str_has_prefix(keycodes, "xfree86")) || + (XKeysymToKeycode(dpy, XK_Page_Up) =3D=3D 0x63)) { trace_xkeymap_keymap("kbd"); *maplen =3D qemu_input_map_xorgkbd_to_qcode_len; return qemu_input_map_xorgkbd_to_qcode; --=20 2.9.3 From nobody Mon Apr 29 12:04:46 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 (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1523352748952307.882073416755; Tue, 10 Apr 2018 02:32:28 -0700 (PDT) Received: from localhost ([::1]:57321 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5pdT-0003B5-0Z for importer@patchew.org; Tue, 10 Apr 2018 05:32:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34285) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5pWF-0004l4-MW for qemu-devel@nongnu.org; Tue, 10 Apr 2018 05:24:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f5pWE-0006YC-Ne for qemu-devel@nongnu.org; Tue, 10 Apr 2018 05:24:51 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:32782 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 1f5pWE-0006Xd-IU for qemu-devel@nongnu.org; Tue, 10 Apr 2018 05:24:50 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 31330EAEB2 for ; Tue, 10 Apr 2018 09:24:50 +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 A28D4D7DE5; Tue, 10 Apr 2018 09:24:47 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id BFC539C3FE; Tue, 10 Apr 2018 11:24:46 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 10 Apr 2018 11:24:44 +0200 Message-Id: <20180410092446.26903-3-kraxel@redhat.com> In-Reply-To: <20180410092446.26903-1-kraxel@redhat.com> References: <20180410092446.26903-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 10 Apr 2018 09:24:50 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 10 Apr 2018 09:24:50 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.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 2/4] gtk: drop pointless code from gd_window_close 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: Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Unregistering the display change listener looks like a pointless excercise given we'll exit in a moment. When exiting qemu via menu/file/quit this will not happen either. Just drop the code. Also return TRUE unconditionally. This will tell gtk to ignore the close request, so gtk will not start destroying widgets and causing warnings due to UI code trying to talk to widgets which are gone. Just depend on qmp_quit() doing it's job instead. Reported-by: Mark Cave-Ayland Signed-off-by: Gerd Hoffmann Message-Id: <20180314080439.4229-1-kraxel@redhat.com> --- ui/gtk.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/ui/gtk.c b/ui/gtk.c index e98ac4d2fc..bb3214cffb 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -786,21 +786,13 @@ static gboolean gd_window_close(GtkWidget *widget, Gd= kEvent *event, { GtkDisplayState *s =3D opaque; bool allow_close =3D true; - int i; =20 if (s->opts->has_window_close && !s->opts->window_close) { allow_close =3D false; } =20 if (allow_close) { - for (i =3D 0; i < s->nb_vcs; i++) { - if (s->vc[i].type !=3D GD_VC_GFX) { - continue; - } - unregister_displaychangelistener(&s->vc[i].gfx.dcl); - } qmp_quit(NULL); - return FALSE; } =20 return TRUE; --=20 2.9.3 From nobody Mon Apr 29 12:04:46 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 1523352418292178.86797552700023; Tue, 10 Apr 2018 02:26:58 -0700 (PDT) Received: from localhost ([::1]:56924 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5pYC-0006bg-9x for importer@patchew.org; Tue, 10 Apr 2018 05:26:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34244) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5pWD-0004jX-Tw for qemu-devel@nongnu.org; Tue, 10 Apr 2018 05:24:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f5pWC-0006VS-UT for qemu-devel@nongnu.org; Tue, 10 Apr 2018 05:24:49 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:32778 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-0006U5-QL for qemu-devel@nongnu.org; Tue, 10 Apr 2018 05:24:48 -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 E3805EAEB2; Tue, 10 Apr 2018 09:24:47 +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 901BC2140624; Tue, 10 Apr 2018 09:24:47 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id C75029C3FF; Tue, 10 Apr 2018 11:24:46 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 10 Apr 2018 11:24:45 +0200 Message-Id: <20180410092446.26903-4-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.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 10 Apr 2018 09:24:47 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 10 Apr 2018 09:24:47 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'kraxel@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] [PULL 3/4] configure: don't warn GTK 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 , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Xu , 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" From: Peter Xu We don't need to detect GTK ABI if GTK is disabled in general. Otherwise we could get this warning (when host is installed with GTK ABI version 2) even when configure with "--disable-gtk": WARNING: Use of GTK 2.0 is deprecated and will be removed in WARNING: future releases. Please switch to using GTK 3.0 CC: Paolo Bonzini CC: Gerd Hoffmann CC: Peter Maydell CC: Fam Zheng CC: "Philippe Mathieu-Daud=C3=A9" Signed-off-by: Peter Xu Reviewed-by: Daniel P. Berrang=C3=A9 Message-id: 20180409082323.29575-1-peterx@redhat.com Signed-off-by: Gerd Hoffmann --- configure | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/configure b/configure index 752dd9ef32..931d2a07cc 100755 --- a/configure +++ b/configure @@ -2540,19 +2540,18 @@ fi ########################################## # GTK probe =20 -if test "$gtkabi" =3D ""; then - # The GTK ABI was not specified explicitly, so try whether 3.0 is avai= lable. - # Use 2.0 as a fallback if that is available. - if $pkg_config --exists "gtk+-3.0 >=3D 3.0.0"; then - gtkabi=3D3.0 - elif $pkg_config --exists "gtk+-2.0 >=3D 2.18.0"; then - gtkabi=3D2.0 - else - gtkabi=3D3.0 - fi -fi - if test "$gtk" !=3D "no"; then + if test "$gtkabi" =3D ""; then + # The GTK ABI was not specified explicitly, so try whether 3.0 is = available. + # Use 2.0 as a fallback if that is available. + if $pkg_config --exists "gtk+-3.0 >=3D 3.0.0"; then + gtkabi=3D3.0 + elif $pkg_config --exists "gtk+-2.0 >=3D 2.18.0"; then + gtkabi=3D2.0 + else + gtkabi=3D3.0 + fi + fi gtkpackage=3D"gtk+-$gtkabi" gtkx11package=3D"gtk+-x11-$gtkabi" if test "$gtkabi" =3D "3.0" ; then --=20 2.9.3 From nobody Mon Apr 29 12:04:46 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 (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1523352414748191.77218607898635; Tue, 10 Apr 2018 02:26:54 -0700 (PDT) Received: from localhost ([::1]:56925 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5pYD-0006dt-PI for importer@patchew.org; Tue, 10 Apr 2018 05:26:53 -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:'' 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] [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=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" 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=C3=A9" Signed-off-by: Peter Xu Reviewed-by: Daniel P. Berrang=C3=A9 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-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 +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 + + 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 "$(basename $sdl_config)" !=3D $sdlconfigname && ! has ${sdl_con= fig}; then + sdl_config=3D$sdlconfigname + fi + + 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 -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 - -if test "$(basename $sdl_config)" !=3D $sdlconfigname && ! has ${sdl_confi= g}; then - sdl_config=3D$sdlconfigname -fi - -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" + 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() */ @@ -2919,6 +2922,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.9.3