From nobody Tue Feb 10 03:39:13 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1634039530125382.82642959337943; Tue, 12 Oct 2021 04:52:10 -0700 (PDT) Received: from localhost ([::1]:54370 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maGKG-0001bX-Md for importer@patchew.org; Tue, 12 Oct 2021 07:52:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33370) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maFik-0000on-5E for qemu-devel@nongnu.org; Tue, 12 Oct 2021 07:13:22 -0400 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]:36729) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maFih-0007ZX-Th for qemu-devel@nongnu.org; Tue, 12 Oct 2021 07:13:21 -0400 Received: by mail-ed1-x535.google.com with SMTP id d3so52076019edp.3 for ; Tue, 12 Oct 2021 04:13:19 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id m23sm4742802eja.6.2021.10.12.04.13.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 04:13:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rFWlNHgZp+u4/R/Eh7ozjTenLSMf75mKcf5hLBHebxA=; b=YtkyqJCubKRYi5ShqbT8OhWYfUn1IucA5hZcuvTDABxx1AI7xGg904HBD8zLvZ/DYn 8LF1TGaXlgCL4UECVP+/JFzvovhzIDSJ37jweu1H5VFEj7F1iFK28gQ6CP4AmX+uxJ87 CDj2FZGNIthSXJWzRXa87jUJ/ru3wr148r/PS0n9Y9fQNyWMFnCuyazjoMfGVxPC+b3c 8NTJ8fX+TgqHvn0oFQTQiswNLfRnM5Viq9O9UHQtEzP4e8bstxrZkfIc/FnBqfDl6RhE 9mSZr7krRfjOayBDf5rBe5BN7jzgKqyVMFo9USkz+cGa9lMczK5gtnn37PsbL/AkgzsV WVgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=rFWlNHgZp+u4/R/Eh7ozjTenLSMf75mKcf5hLBHebxA=; b=abZ8zX2ohYra0/7p5Nh0sZvISbXr0C4BbotGfKSYMTXOcGJYKGYsgTcfku+IG6dIqv i3EsN3bi5bDal3PATlG5VdBeLUMMV3ZI+wcYyKHZ0KIclGifkKCFtvAGVFLgmxD9955c HeAi+sufDLUdEjNjZ+LLOHAdLFpKgC2K0rJeVObGU1VFS8M0JFL6MiOs/y8YxlcFDZhB p/86ZTpYo45iGcO6C1MS2r0EfKpfShO4rSS9kpptNq2au3KERlWmLb9PJFKzPJ5Tbtlv jN85iCS2m9cchftaDq3Z54WQzbqZAFPu8mxN55ULDI1BDKC0Mu7j5IeUxNqisTqWdqpS dwFw== X-Gm-Message-State: AOAM5307nLusXDfqeDL1XC5kj6jcRPkWIiZvf8/A/Swa6+RQpkb9mhLu WlJbDIWPvtH2Ull3+Jzk925N1bis93Y= X-Google-Smtp-Source: ABdhPJwuxm1pVTQ2lWP1kCHwnRPslf54QG+71FG0Z8yoVWzyM1WInimzV1sv5bWkQMA8Vq1AYNe0cw== X-Received: by 2002:a05:6402:2552:: with SMTP id l18mr30099608edb.370.1634037198639; Tue, 12 Oct 2021 04:13:18 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 18/24] configure, meson: move Spice configure handling to meson Date: Tue, 12 Oct 2021 13:12:56 +0200 Message-Id: <20211012111302.246627-19-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211012111302.246627-1-pbonzini@redhat.com> References: <20211012111302.246627-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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::535; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x535.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.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, 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: marcandre.lureau@redhat.com, thuth@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1634039530875100001 From: Marc-Andr=C3=A9 Lureau Add meson feature options for Spice and Spice protocol, and move detection logic out of configure. Signed-off-by: Marc-Andr=C3=A9 Lureau Message-Id: <20211007102453.978041-1-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini Message-Id: <20211007130829.632254-13-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- chardev/meson.build | 2 +- configure | 47 +-------------------------------------------- meson.build | 29 +++++++++++++++++----------- meson_options.txt | 4 ++++ ui/meson.build | 4 ++-- 5 files changed, 26 insertions(+), 60 deletions(-) diff --git a/chardev/meson.build b/chardev/meson.build index 32377af383..325ba2bdb9 100644 --- a/chardev/meson.build +++ b/chardev/meson.build @@ -35,7 +35,7 @@ if brlapi.found() chardev_modules +=3D { 'baum': module_ss } endif =20 -if config_host.has_key('CONFIG_SPICE') +if spice.found() module_ss =3D ss.source_set() module_ss.add(when: [spice], if_true: files('spice.c')) chardev_modules +=3D { 'spice': module_ss } diff --git a/configure b/configure index bb3bb3e58f..016814d23b 100755 --- a/configure +++ b/configure @@ -369,7 +369,7 @@ pie=3D"" qom_cast_debug=3D"yes" trace_backends=3D"log" trace_file=3D"trace" -spice=3D"$default_feature" +spice=3D"auto" spice_protocol=3D"auto" rbd=3D"auto" smartcard=3D"auto" @@ -3229,41 +3229,6 @@ EOF fi fi =20 -########################################## -# spice probe -if test "$spice_protocol" !=3D "no" ; then - spice_protocol_cflags=3D$($pkg_config --cflags spice-protocol 2>/dev/nul= l) - if $pkg_config --atleast-version=3D0.12.3 spice-protocol; then - spice_protocol=3D"yes" - else - if test "$spice_protocol" =3D "yes" ; then - feature_not_found "spice_protocol" \ - "Install spice-protocol(>=3D0.12.3) devel" - fi - spice_protocol=3D"no" - fi -fi - -if test "$spice" !=3D "no" ; then - cat > $TMPC << EOF -#include -int main(void) { spice_server_new(); return 0; } -EOF - spice_cflags=3D$($pkg_config --cflags spice-protocol spice-server 2>/dev= /null) - spice_libs=3D$($pkg_config --libs spice-protocol spice-server 2>/dev/nul= l) - if $pkg_config --atleast-version=3D0.12.5 spice-server && \ - test "$spice_protocol" =3D "yes" && \ - compile_prog "$spice_cflags" "$spice_libs" ; then - spice=3D"yes" - else - if test "$spice" =3D "yes" ; then - feature_not_found "spice" \ - "Install spice-server(>=3D0.12.5) devel" - fi - spice=3D"no" - fi -fi - ########################################## # check if we have VSS SDK headers for win =20 @@ -4233,16 +4198,6 @@ if test "$tcg" =3D "enabled" -a "$tcg_interpreter" = =3D "true" ; then echo "CONFIG_TCG_INTERPRETER=3Dy" >> $config_host_mak fi =20 -if test "$spice_protocol" =3D "yes" ; then - echo "CONFIG_SPICE_PROTOCOL=3Dy" >> $config_host_mak - echo "SPICE_PROTOCOL_CFLAGS=3D$spice_protocol_cflags" >> $config_host_mak -fi -if test "$spice" =3D "yes" ; then - echo "CONFIG_SPICE=3Dy" >> $config_host_mak - echo "SPICE_CFLAGS=3D$spice_cflags $spice_protocol_cflags" >> $config_ho= st_mak - echo "SPICE_LIBS=3D$spice_libs" >> $config_host_mak -fi - if test "$opengl" =3D "yes" ; then echo "CONFIG_OPENGL=3Dy" >> $config_host_mak echo "OPENGL_CFLAGS=3D$opengl_cflags" >> $config_host_mak diff --git a/meson.build b/meson.build index 68bf65a923..bf1b372a4a 100644 --- a/meson.build +++ b/meson.build @@ -540,17 +540,20 @@ if not get_option('jack').auto() or have_system method: 'pkg-config', kwargs: static_kwargs) endif =20 -spice =3D not_found -spice_headers =3D not_found spice_protocol =3D not_found -if 'CONFIG_SPICE' in config_host - spice =3D declare_dependency(compile_args: config_host['SPICE_CFLAGS'].s= plit(), - link_args: config_host['SPICE_LIBS'].split()) - spice_headers =3D declare_dependency(compile_args: config_host['SPICE_CF= LAGS'].split()) +if not get_option('spice_protocol').auto() or have_system + spice_protocol =3D dependency('spice-protocol', version: '>=3D0.12.3', + required: get_option('spice_protocol'), + method: 'pkg-config', kwargs: static_kwargs) endif -if 'CONFIG_SPICE_PROTOCOL' in config_host - spice_protocol =3D declare_dependency(compile_args: config_host['SPICE_P= ROTOCOL_CFLAGS'].split()) +spice =3D not_found +if not get_option('spice').auto() or have_system + spice =3D dependency('spice-server', version: '>=3D0.12.5', + required: get_option('spice'), + method: 'pkg-config', kwargs: static_kwargs) endif +spice_headers =3D spice.partial_dependency(compile_args: true, includes: t= rue) + rt =3D cc.find_library('rt', required: false) libdl =3D not_found if 'CONFIG_PLUGIN' in config_host @@ -1481,6 +1484,8 @@ config_host_data.set('CONFIG_STATX', has_statx) config_host_data.set('CONFIG_ZSTD', zstd.found()) config_host_data.set('CONFIG_FUSE', fuse.found()) config_host_data.set('CONFIG_FUSE_LSEEK', fuse_lseek.found()) +config_host_data.set('CONFIG_SPICE_PROTOCOL', spice_protocol.found()) +config_host_data.set('CONFIG_SPICE', spice.found()) config_host_data.set('CONFIG_X11', x11.found()) config_host_data.set('CONFIG_CFI', get_option('cfi')) config_host_data.set('QEMU_VERSION', '"@0@"'.format(meson.project_version(= ))) @@ -1761,7 +1766,7 @@ have_ivshmem =3D config_host_data.get('CONFIG_EVENTFD= ') host_kconfig =3D \ (get_option('fuzzing') ? ['CONFIG_FUZZ=3Dy'] : []) + \ ('CONFIG_TPM' in config_host ? ['CONFIG_TPM=3Dy'] : []) + \ - ('CONFIG_SPICE' in config_host ? ['CONFIG_SPICE=3Dy'] : []) + \ + (spice.found() ? ['CONFIG_SPICE=3Dy'] : []) + \ (have_ivshmem ? ['CONFIG_IVSHMEM=3Dy'] : []) + \ ('CONFIG_OPENGL' in config_host ? ['CONFIG_OPENGL=3Dy'] : []) + \ (x11.found() ? ['CONFIG_X11=3Dy'] : []) + \ @@ -3339,8 +3344,10 @@ summary_info +=3D {'PVRDMA support': config_host.= has_key('CONFIG_PVRDMA')} summary_info +=3D {'fdt support': fdt_opt =3D=3D 'disabled' ? false = : fdt_opt} summary_info +=3D {'libcap-ng support': libcap_ng} summary_info +=3D {'bpf support': libbpf} -# TODO: add back protocol and server version -summary_info +=3D {'spice support': config_host.has_key('CONFIG_SPICE'= )} +summary_info +=3D {'spice protocol support': spice_protocol} +if spice_protocol.found() + summary_info +=3D {' spice server support': spice} +endif summary_info +=3D {'rbd support': rbd} summary_info +=3D {'xfsctl support': config_host.has_key('CONFIG_XFS')} summary_info +=3D {'smartcard support': cacard} diff --git a/meson_options.txt b/meson_options.txt index d8e67ae481..5a140af7f7 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -125,6 +125,10 @@ option('smartcard', type : 'feature', value : 'auto', description: 'CA smartcard emulation support') option('snappy', type : 'feature', value : 'auto', description: 'snappy compression support') +option('spice', type : 'feature', value : 'auto', + description: 'Spice server support') +option('spice_protocol', type : 'feature', value : 'auto', + description: 'Spice protocol support') option('u2f', type : 'feature', value : 'auto', description: 'U2F emulation support') option('usb_redir', type : 'feature', value : 'auto', diff --git a/ui/meson.build b/ui/meson.build index a73beb0e54..ee8ef27714 100644 --- a/ui/meson.build +++ b/ui/meson.build @@ -89,7 +89,7 @@ if sdl.found() ui_modules +=3D {'sdl' : sdl_ss} endif =20 -if config_host.has_key('CONFIG_SPICE') +if spice.found() spice_core_ss =3D ss.source_set() spice_core_ss.add(spice, pixman, files( 'spice-core.c', @@ -99,7 +99,7 @@ if config_host.has_key('CONFIG_SPICE') ui_modules +=3D {'spice-core' : spice_core_ss} endif =20 -if config_host.has_key('CONFIG_SPICE') and config_host.has_key('CONFIG_GIO= ') +if spice.found() and config_host.has_key('CONFIG_GIO') spice_ss =3D ss.source_set() spice_ss.add(spice, gio, pixman, files('spice-app.c')) ui_modules +=3D {'spice-app': spice_ss} --=20 2.31.1