From nobody Mon Feb 9 15:29:25 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1610028309; cv=none; d=zohomail.com; s=zohoarc; b=EGLxJpm31wltKmh1+0x3P3QVEa2kRDhoOYWq9gZWWLN9tl/3p3eGwyhaHVCSeUrkZlofElSetzAjJY+srzFrFUUO0Qr43kMiv4fUJ+JtBBsqAi7e1oCufTXnph6oje2Z1LkvsYK3Yw7KvRbf964e881ww7PxGlQsC/dxaIltFs0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610028309; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=t+Pwn9LfFG65wvaIUQ2xmA9CpZnngkiMNkAxYZScHNk=; b=G08j7AlJvEj5utpfl/OHyhtVK2cmleXdni+tanHbBnVPYS2/nevfpFQ0ZtnHIsHD6UjU1dDObeW0yCly01CBkZVItZ57yxXQFsw8OJGIywbXvzGy7ipeQX5NHElqhrRWg6m85MZ2s7W9ksqO3nAwlFkzHIGGvWiFt+cHCCAQzvg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1610028309949274.63790890386997; Thu, 7 Jan 2021 06:05:09 -0800 (PST) Received: from localhost ([::1]:58080 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kxVuW-0006x6-NS for importer@patchew.org; Thu, 07 Jan 2021 09:05:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42786) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kxVqQ-0003xC-AZ for qemu-devel@nongnu.org; Thu, 07 Jan 2021 09:00:54 -0500 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]:46256) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kxVqK-0006wf-Iw for qemu-devel@nongnu.org; Thu, 07 Jan 2021 09:00:50 -0500 Received: by mail-ed1-x530.google.com with SMTP id b73so7757197edf.13 for ; Thu, 07 Jan 2021 06:00:47 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id oq27sm2438523ejb.108.2021.01.07.06.00.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Jan 2021 06:00:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=t+Pwn9LfFG65wvaIUQ2xmA9CpZnngkiMNkAxYZScHNk=; b=W1yPHQ5Oha1hAeKLvXQHAgiKuICQu+riwApI91ZUUBVPbJ7o65NJH3hyUGqDODElLX CvOBKWDgRQufTi2eQui4h8b4dsgMR4cqLcE7uy9QPnFwfiJtJgEZkGfXkFtMwbV7NVHV DtOlGOezv0Q3Aj9FhQm+51YrQ9Ksj6wGkkfF2lLOKYE3t+ZGtiJT2+murcUzAuqHJb/1 hic37pFtXU5nFBlGu20IEJ4fY5lmdeFqONygYY2jJu4lJWNAUday+vVKRXSP2efNTJO5 JZX32noBcbKRNg/KclBICVAhc+niVvzzCNrJ8yDY+aNU0AAsuXZqMT+BnGU1oIQoAWcy xFtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=t+Pwn9LfFG65wvaIUQ2xmA9CpZnngkiMNkAxYZScHNk=; b=dJBOGbGkF4luFLwUuvUVBYYilwvX/i4HEX1nrUuIBUkI7ToNvQTDyU7w3MuhzR2U9p iCLq2Y6E3T8RxS32f/JlygMmH8PfFNT6+kShbOuk3XQaldNgyHvbAe0kxr8Xowmu0DeP KdepGxvBlfJPO+XvrYrhdJgrViPcNx/K6plPAb+D6Cs3rIHG7Q2kPPeKIMDMqZNSFmZ+ vsdWs+iDY1q7FMKJiEC92soSQBzTDVDMlYPevWpyltjtCW9ra6Xes3evp2Ur2npC2rhz 41+idajXcHTv3ZwXmjuCqgiuR09Isi+5UkHVdQ4VQ3VDyQMbS6fVrVjlAIV/Vvoi/BW8 33DA== X-Gm-Message-State: AOAM531Ih7yFuf8G9E2u6o9SUmJlVlBAGEJ/SGCvA+O+Ahfqyhtn+4Kq WcxULAIsCxaQxjo7IThzBIiD+vyeYAxDpw== X-Google-Smtp-Source: ABdhPJxUR6lb4AqZY40lk7LNBEnrPdRIetEAryg+o6RJ1yfctKM4kdiXgN+51cCXKdZP8HjdWAq+aw== X-Received: by 2002:aa7:d919:: with SMTP id a25mr1707624edr.81.1610028046439; Thu, 07 Jan 2021 06:00:46 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 5/8] configure: move GTK+ detection to Meson Date: Thu, 7 Jan 2021 15:00:36 +0100 Message-Id: <20210107140039.467969-6-pbonzini@redhat.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210107140039.467969-1-pbonzini@redhat.com> References: <20210107140039.467969-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x530.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.bennee@linaro.org, marcandre.lureau@redhat.com, berrange@redhat.com, stefanha@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" This also allows removing CONFIG_NEED_X11, all the ingredients can be computed easily in meson.build. Signed-off-by: Paolo Bonzini --- configure | 55 ++++++----------------------------------------- meson.build | 29 ++++++++++++++++++------- meson_options.txt | 2 ++ ui/meson.build | 2 +- 4 files changed, 30 insertions(+), 58 deletions(-) diff --git a/configure b/configure index e9d76c2c13..652cff7ba6 100755 --- a/configure +++ b/configure @@ -414,7 +414,7 @@ cfi=3D"false" cfi_debug=3D"false" seccomp=3D"auto" glusterfs=3D"auto" -gtk=3D"$default_feature" +gtk=3D"auto" tls_priority=3D"NORMAL" gnutls=3D"$default_feature" nettle=3D"$default_feature" @@ -1377,9 +1377,9 @@ for opt do --enable-uuid|--disable-uuid) echo "$0: $opt is obsolete, UUID support is always built" >&2 ;; - --disable-gtk) gtk=3D"no" + --disable-gtk) gtk=3D"disabled" ;; - --enable-gtk) gtk=3D"yes" + --enable-gtk) gtk=3D"enabled" ;; --tls-priority=3D*) tls_priority=3D"$optarg" ;; @@ -2329,10 +2329,10 @@ if test "$cocoa" =3D "enabled"; then if test "$sdl" =3D "enabled"; then error_exit "Cocoa and SDL UIs cannot both be enabled at once" fi - if test "$gtk" =3D "yes"; then + if test "$gtk" =3D "enabled"; then error_exit "Cocoa and GTK UIs cannot both be enabled at once" fi - gtk=3Dno + gtk=3Ddisabled sdl=3Ddisabled fi =20 @@ -2759,31 +2759,6 @@ EOF fi fi =20 -########################################## -# GTK probe - -if test "$gtk" !=3D "no"; then - gtkpackage=3D"gtk+-3.0" - gtkx11package=3D"gtk+-x11-3.0" - gtkversion=3D"3.22.0" - if $pkg_config --exists "$gtkpackage >=3D $gtkversion"; then - gtk_cflags=3D$($pkg_config --cflags $gtkpackage) - gtk_libs=3D$($pkg_config --libs $gtkpackage) - gtk_version=3D$($pkg_config --modversion $gtkpackage) - if $pkg_config --exists "$gtkx11package >=3D $gtkversion"; then - need_x11=3Dyes - gtk_cflags=3D"$gtk_cflags $x11_cflags" - gtk_libs=3D"$gtk_libs $x11_libs" - fi - gtk=3D"yes" - elif test "$gtk" =3D "yes"; then - feature_not_found "gtk" "Install gtk3-devel" - else - gtk=3D"no" - fi -fi - - ########################################## # GNUTLS probe =20 @@ -3640,16 +3615,6 @@ EOF fi fi =20 -if test "$opengl" =3D "yes" && test "$have_x11" =3D "yes"; then - for target in $target_list; do - case $target in - lm32-softmmu) # milkymist-tmu2 requires X11 and OpenGL - need_x11=3Dyes - ;; - esac - done -fi - ########################################## # libxml2 probe if test "$libxml2" !=3D "no" ; then @@ -5673,9 +5638,6 @@ fi if test "$module_upgrades" =3D "yes"; then echo "CONFIG_MODULE_UPGRADES=3Dy" >> $config_host_mak fi -if test "$need_x11" =3D "yes"; then - echo "CONFIG_NEED_X11=3Dy" >> $config_host_mak -fi if test "$pipe2" =3D "yes" ; then echo "CONFIG_PIPE2=3Dy" >> $config_host_mak fi @@ -5763,11 +5725,6 @@ fi if test "$bswap_h" =3D "yes" ; then echo "CONFIG_MACHINE_BSWAP_H=3Dy" >> $config_host_mak fi -if test "$gtk" =3D "yes" ; then - echo "CONFIG_GTK=3Dy" >> $config_host_mak - echo "GTK_CFLAGS=3D$gtk_cflags" >> $config_host_mak - echo "GTK_LIBS=3D$gtk_libs" >> $config_host_mak -fi if test "$gio" =3D "yes" ; then echo "CONFIG_GIO=3Dy" >> $config_host_mak echo "GIO_CFLAGS=3D$gio_cflags" >> $config_host_mak @@ -6491,7 +6448,7 @@ NINJA=3D$ninja $meson setup \ -Dmalloc=3D$malloc -Dmalloc_trim=3D$malloc_trim -Dsparse=3D$sparse= \ -Dkvm=3D$kvm -Dhax=3D$hax -Dwhpx=3D$whpx -Dhvf=3D$hvf \ -Dxen=3D$xen -Dxen_pci_passthrough=3D$xen_pci_passthrough -Dtcg=3D= $tcg \ - -Dcocoa=3D$cocoa -Dmpath=3D$mpath -Dsdl=3D$sdl -Dsdl_image=3D$sdl_= image \ + -Dcocoa=3D$cocoa -Dgtk=3D$gtk -Dmpath=3D$mpath -Dsdl=3D$sdl -Dsdl_= image=3D$sdl_image \ -Dvnc=3D$vnc -Dvnc_sasl=3D$vnc_sasl -Dvnc_jpeg=3D$vnc_jpeg -Dvnc_p= ng=3D$vnc_png \ -Dgettext=3D$gettext -Dxkbcommon=3D$xkbcommon -Du2f=3D$u2f -Dvirti= ofsd=3D$virtiofsd \ -Dcapstone=3D$capstone -Dslirp=3D$slirp -Dfdt=3D$fdt -Dbrlapi=3D$b= rlapi \ diff --git a/meson.build b/meson.build index fdd4312c71..a3a0958b4d 100644 --- a/meson.build +++ b/meson.build @@ -772,19 +772,31 @@ if 'CONFIG_OPENGL' in config_host opengl =3D declare_dependency(compile_args: config_host['OPENGL_CFLAGS']= .split(), link_args: config_host['OPENGL_LIBS'].split(= )) endif + gtk =3D not_found -if 'CONFIG_GTK' in config_host - gtk =3D declare_dependency(compile_args: config_host['GTK_CFLAGS'].split= (), - link_args: config_host['GTK_LIBS'].split()) +gtkx11 =3D not_found +if not get_option('gtk').auto() or have_system + gtk =3D dependency('gtk+-3.0', version: '>=3D3.22.0', + method: 'pkg-config', + required: get_option('gtk'), + static: enable_static) + if gtk.found() + gtkx11 =3D dependency('gtk+-x11-3.0', version: '>=3D3.22.0', + method: 'pkg-config', + required: false, + static: enable_static) + gtk =3D declare_dependency(dependencies: [gtk, gtkx11]) + endif endif + vte =3D not_found if 'CONFIG_VTE' in config_host vte =3D declare_dependency(compile_args: config_host['VTE_CFLAGS'].split= (), link_args: config_host['VTE_LIBS'].split()) endif x11 =3D not_found -if config_host.has_key('CONFIG_NEED_X11') - x11 =3D dependency('x11', method: 'pkg-config', required: false, +if gtkx11.found() or 'lm32-softmmu' in target_dirs + x11 =3D dependency('x11', method: 'pkg-config', required: gtkx11.found(), static: enable_static) endif vnc =3D not_found @@ -1058,6 +1070,7 @@ if glusterfs.found() config_host_data.set('CONFIG_GLUSTERFS_FTRUNCATE_HAS_STAT', glusterfs_ft= runcate_has_stat) config_host_data.set('CONFIG_GLUSTERFS_IOCB_HAS_STAT', glusterfs_iocb_ha= s_stat) endif +config_host_data.set('CONFIG_GTK', gtk.found()) config_host_data.set('CONFIG_LIBATTR', have_old_libattr) config_host_data.set('CONFIG_LIBCAP_NG', libcap_ng.found()) config_host_data.set('CONFIG_LIBISCSI', libiscsi.found()) @@ -2229,7 +2242,7 @@ subdir('tools') subdir('pc-bios') subdir('docs') subdir('tests') -if 'CONFIG_GTK' in config_host +if gtk.found() subdir('po') endif =20 @@ -2246,7 +2259,7 @@ if host_machine.system() =3D=3D 'windows' if build_docs nsis_cmd +=3D '-DCONFIG_DOCUMENTATION=3Dy' endif - if 'CONFIG_GTK' in config_host + if gtk.found() nsis_cmd +=3D '-DCONFIG_GTK=3Dy' endif =20 @@ -2337,7 +2350,7 @@ endif summary_info +=3D {'SDL support': sdl.found()} summary_info +=3D {'SDL image support': sdl_image.found()} # TODO: add back version -summary_info +=3D {'GTK support': config_host.has_key('CONFIG_GTK')} +summary_info +=3D {'GTK support': gtk.found()} summary_info +=3D {'pixman': pixman.found()} # TODO: add back version summary_info +=3D {'VTE support': config_host.has_key('CONFIG_VTE')} diff --git a/meson_options.txt b/meson_options.txt index 41f9c2cf6c..b9b106675f 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -76,6 +76,8 @@ option('lzo', type : 'feature', value : 'auto', description: 'lzo compression support') option('rbd', type : 'feature', value : 'auto', description: 'Ceph block device driver') +option('gtk', type : 'feature', value : 'auto', + description: 'GTK+ user interface') option('sdl', type : 'feature', value : 'auto', description: 'SDL user interface') option('sdl_image', type : 'feature', value : 'auto', diff --git a/ui/meson.build b/ui/meson.build index afbdd78e97..407e291ebe 100644 --- a/ui/meson.build +++ b/ui/meson.build @@ -57,7 +57,7 @@ if config_host.has_key('CONFIG_OPENGL_DMABUF') ui_modules +=3D {'egl-headless' : egl_headless_ss} endif =20 -if config_host.has_key('CONFIG_GTK') +if gtk.found() softmmu_ss.add(when: 'CONFIG_WIN32', if_true: files('win32-kbd-hook.c')) =20 gtk_ss =3D ss.source_set() --=20 2.29.2