From nobody Thu May 9 04:49:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1633602468; cv=none; d=zohomail.com; s=zohoarc; b=Ue5Pd87d4A6Ig+pvwjQJRTHU4Fa4x1m1RKqcQgKllyULVlH7HFqOKjIi+ir4aBKE8sAqJlczyyT7Zrmr4mOewH2xntnH2kUbx3lFnOf9UE49qyhzu8CR03ctFoKXB7SR1Y1ZXAyCiSiD3KCZUqcglH2QcihUFLeBdiuLRLZqOf8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633602468; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=eM5W8FPykjrcNVBrTjAL2JFAzO3bABsZ1PpFl9oeLyo=; b=mhDA7Ro32VWTnuXjO5Nui40r09LK+xt9dgcbjQrEAvuj8HcMHEJ/TdqHMtneqO0Dvm9jB3z+EutNw6hfBwzZ393qeeHcFa4Jlm8wOFVlWnLVGobtI+27n03YmUQAPUMVuXsx70xuOHcJeKfGLeAownIR3IFKxy7d9Z9pPbrTkJI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1633602468807849.7508237620148; Thu, 7 Oct 2021 03:27:48 -0700 (PDT) Received: from localhost ([::1]:58734 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mYQct-0006YB-MO for importer@patchew.org; Thu, 07 Oct 2021 06:27:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46952) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mYQad-0004KH-9H for qemu-devel@nongnu.org; Thu, 07 Oct 2021 06:25:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:58424) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mYQaS-0000lz-V2 for qemu-devel@nongnu.org; Thu, 07 Oct 2021 06:25:25 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-42-zkTtKkYvPtuY3TxszAYIcg-1; Thu, 07 Oct 2021 06:25:05 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 971ED1080865 for ; Thu, 7 Oct 2021 10:25:04 +0000 (UTC) Received: from localhost (unknown [10.39.208.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6115F1980E; Thu, 7 Oct 2021 10:24:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633602309; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eM5W8FPykjrcNVBrTjAL2JFAzO3bABsZ1PpFl9oeLyo=; b=hhwXlfRnTxoGjZKL/VsauyyUo4CZgXO3/DfXVZvj9rQzmVlI2I5R9oistASYLYHmxGQ5UR 3bHcHjbbulUJW3jZaAFjy4XoA2CZuHHghcXmi5dK2p8WtZbvLCsaCWxR1YZrnnS8mOztpk imr4eWpyutJvJr7Pf5KQ4+/jQdBIi3E= X-MC-Unique: zkTtKkYvPtuY3TxszAYIcg-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PATCH] build-sys: move Spice configure handling to meson Date: Thu, 7 Oct 2021 14:24:53 +0400 Message-Id: <20211007102453.978041-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=marcandre.lureau@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.05, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: pbonzini@redhat.com, kraxel@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1633602470618100001 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 --- configure | 48 ++------------------------------------------- meson.build | 27 ++++++++++++------------- chardev/meson.build | 2 +- meson_options.txt | 4 ++++ ui/meson.build | 4 ++-- 5 files changed, 22 insertions(+), 63 deletions(-) diff --git a/configure b/configure index 877bf3d76a..375cde2b44 100755 --- a/configure +++ b/configure @@ -372,7 +372,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" @@ -3525,41 +3525,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 @@ -4659,16 +4624,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 @@ -5202,6 +5157,7 @@ if test "$skip_meson" =3D no; then -Ddocs=3D$docs -Dsphinx_build=3D$sphinx_build -Dinstall_blobs=3D$b= lobs \ -Dvhost_user_blk_server=3D$vhost_user_blk_server -Dmultiprocess=3D= $multiprocess \ -Dfuse=3D$fuse -Dfuse_lseek=3D$fuse_lseek -Dguest_agent_msi=3D$gue= st_agent_msi -Dbpf=3D$bpf\ + -Dspice=3D$spice -Dspice_protocol=3D$spice_protocol \ $(if test "$default_feature" =3D no; then echo "-Dauto_features=3D= disabled"; fi) \ -Dtcg_interpreter=3D$tcg_interpreter \ $cross_arg \ diff --git a/meson.build b/meson.build index 99a0a3e689..fe621413a4 100644 --- a/meson.build +++ b/meson.build @@ -442,17 +442,14 @@ jack =3D not_found if 'CONFIG_LIBJACK' in config_host jack =3D declare_dependency(link_args: config_host['JACK_LIBS'].split()) endif -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()) -endif -if 'CONFIG_SPICE_PROTOCOL' in config_host - spice_protocol =3D declare_dependency(compile_args: config_host['SPICE_P= ROTOCOL_CFLAGS'].split()) -endif +spice_protocol =3D dependency('spice-protocol', version: '>=3D0.12.3', + required: get_option('spice_protocol')) +spice =3D dependency('spice-server', version: '>=3D0.12.5', + required: get_option('spice')) +if spice.found() + config_host +=3D { 'CONFIG_SPICE': 'y' } # for audio/meson.build +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 @@ -1293,6 +1290,9 @@ 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_X11', x11.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(= ))) config_host_data.set('QEMU_VERSION_MAJOR', meson.project_version().split('= .')[0]) @@ -1516,7 +1516,7 @@ endif have_ivshmem =3D config_host_data.get('CONFIG_EVENTFD') host_kconfig =3D \ ('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'] : []) + \ @@ -3082,8 +3082,7 @@ summary_info +=3D {'PVRDMA support': config_host.h= as_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 support': spice} 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/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/meson_options.txt b/meson_options.txt index 2c89e79e8b..b064b0b46c 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -114,6 +114,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 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.33.0.113.g6c40894d24