From nobody Tue Feb 10 01:35:32 2026 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=1597768284; cv=none; d=zohomail.com; s=zohoarc; b=Ea2dtGKxte1A5fzRWR7L/aKzmSEUALu8fFe2VRq8nrn+vtbRPlzaAiJcFReDckXu0L6Su8A7K/fs6nhbfyUHPU56MO6DfEHCUh0eSay/v7Fm8wrPm071830YKXwfdrMsJXo4jqxh8d6YRhkfFxqiXrYmKUNZzgwf+I0c9xHJ8Uo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597768284; h=Content-Type:Content-Transfer-Encoding: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=pQJeg8MZZWFA+26AoBZGRexdaepfiPY1AFS/gUOoBrE=; b=EAhe0XTb8HqH92UGXJ4n8TrIgoaQjf9ZRHIX7mqqWWGYiLZlRRf74cyYLe050VOvhPzSctLDnMoG9T+n6UxRE5isRgjzL1PgUCc9yWeeK8Wz827VeCksnIOhAvg/rvTko8jevNcmjtCceKsjJcf9NJe/TPq2f1z+/nxhw9uvuSI= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1597768284424678.8457154554505; Tue, 18 Aug 2020 09:31:24 -0700 (PDT) Received: from localhost ([::1]:52862 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k83DY-0000OY-F9 for importer@patchew.org; Tue, 18 Aug 2020 11:08:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33946) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k82Ly-0006dk-3q for qemu-devel@nongnu.org; Tue, 18 Aug 2020 10:12:42 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:55427 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1k82Lo-0007gx-38 for qemu-devel@nongnu.org; Tue, 18 Aug 2020 10:12:41 -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-44-PhE6885FMyGE5KW3dKjKOQ-1; Tue, 18 Aug 2020 10:12:23 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F144880F040 for ; Tue, 18 Aug 2020 14:12:22 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id B58427A1FA for ; Tue, 18 Aug 2020 14:12:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1597759951; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pQJeg8MZZWFA+26AoBZGRexdaepfiPY1AFS/gUOoBrE=; b=KwsEYpof5Oi1d4103SprQfXT41W95jTPm/1bVtxse4GymsrzMlYrj37zHZe+KkzFDQkFpA bHwRUncV/NdlQufX1O2FfD9unUtJP4GQoEisPIv2FHpbaX695qxUtcNAVKa/4wHwN13qHV u/jwxSqszP5p4gs7C8dgWQM982BOsdg= X-MC-Unique: PhE6885FMyGE5KW3dKjKOQ-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 146/150] meson: convert VNC and dependent libraries to meson Date: Tue, 18 Aug 2020 10:10:21 -0400 Message-Id: <20200818141025.21608-147-pbonzini@redhat.com> In-Reply-To: <20200818141025.21608-1-pbonzini@redhat.com> References: <20200818141025.21608-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com 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=205.139.110.61; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/18 02:16:14 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -40 X-Spam_score: -4.1 X-Spam_bar: ---- X-Spam_report: (-4.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini --- configure | 122 +++++----------------------------------------- meson.build | 40 +++++++++------ meson_options.txt | 4 ++ ui/meson.build | 10 ++-- 4 files changed, 45 insertions(+), 131 deletions(-) diff --git a/configure b/configure index 26fefa6cbc..86f384be29 100755 --- a/configure +++ b/configure @@ -380,12 +380,12 @@ sdl=3D"auto" sdl_image=3D"auto" virtfs=3D"" mpath=3D"" -vnc=3D"yes" +vnc=3D"enabled" sparse=3D"no" vde=3D"" -vnc_sasl=3D"" -vnc_jpeg=3D"" -vnc_png=3D"" +vnc_sasl=3D"auto" +vnc_jpeg=3D"auto" +vnc_png=3D"auto" xkbcommon=3D"" xen=3D"" xen_ctrl_version=3D"" @@ -1108,9 +1108,9 @@ for opt do ;; --enable-mpath) mpath=3D"yes" ;; - --disable-vnc) vnc=3D"no" + --disable-vnc) vnc=3D"disabled" ;; - --enable-vnc) vnc=3D"yes" + --enable-vnc) vnc=3D"enabled" ;; --oss-lib=3D*) oss_lib=3D"$optarg" ;; @@ -1146,17 +1146,17 @@ for opt do ;; --disable-strip) strip_opt=3D"no" ;; - --disable-vnc-sasl) vnc_sasl=3D"no" + --disable-vnc-sasl) vnc_sasl=3D"disabled" ;; - --enable-vnc-sasl) vnc_sasl=3D"yes" + --enable-vnc-sasl) vnc_sasl=3D"enabled" ;; - --disable-vnc-jpeg) vnc_jpeg=3D"no" + --disable-vnc-jpeg) vnc_jpeg=3D"disabled" ;; - --enable-vnc-jpeg) vnc_jpeg=3D"yes" + --enable-vnc-jpeg) vnc_jpeg=3D"enabled" ;; - --disable-vnc-png) vnc_png=3D"no" + --disable-vnc-png) vnc_png=3D"disabled" ;; - --enable-vnc-png) vnc_png=3D"yes" + --enable-vnc-png) vnc_png=3D"enabled" ;; --disable-slirp) slirp=3D"no" ;; @@ -3379,85 +3379,6 @@ EOF fi fi =20 -########################################## -# VNC SASL detection -if test "$vnc" =3D "yes" && test "$vnc_sasl" !=3D "no" ; then - cat > $TMPC < -#include -int main(void) { sasl_server_init(NULL, "qemu"); return 0; } -EOF - # Assuming Cyrus-SASL installed in /usr prefix - # QEMU defines struct iovec in "qemu/osdep.h", - # we don't want libsasl to redefine it in . - vnc_sasl_cflags=3D"-DSTRUCT_IOVEC_DEFINED" - vnc_sasl_libs=3D"-lsasl2" - if compile_prog "$vnc_sasl_cflags" "$vnc_sasl_libs" ; then - vnc_sasl=3Dyes - libs_softmmu=3D"$vnc_sasl_libs $libs_softmmu" - QEMU_CFLAGS=3D"$QEMU_CFLAGS $vnc_sasl_cflags" - else - if test "$vnc_sasl" =3D "yes" ; then - feature_not_found "vnc-sasl" "Install Cyrus SASL devel" - fi - vnc_sasl=3Dno - fi -fi - -########################################## -# VNC JPEG detection -if test "$vnc" =3D "yes" && test "$vnc_jpeg" !=3D "no" ; then -cat > $TMPC < -#include -int main(void) { struct jpeg_compress_struct s; jpeg_create_compress(&s); = return 0; } -EOF - vnc_jpeg_cflags=3D"" - vnc_jpeg_libs=3D"-ljpeg" - if compile_prog "$vnc_jpeg_cflags" "$vnc_jpeg_libs" ; then - vnc_jpeg=3Dyes - libs_softmmu=3D"$vnc_jpeg_libs $libs_softmmu" - QEMU_CFLAGS=3D"$QEMU_CFLAGS $vnc_jpeg_cflags" - else - if test "$vnc_jpeg" =3D "yes" ; then - feature_not_found "vnc-jpeg" "Install libjpeg-turbo devel" - fi - vnc_jpeg=3Dno - fi -fi - -########################################## -# VNC PNG detection -if test "$vnc" =3D "yes" && test "$vnc_png" !=3D "no" ; then -cat > $TMPC < -#include -#include -int main(void) { - png_structp png_ptr; - png_ptr =3D png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL,= NULL); - return png_ptr !=3D 0; -} -EOF - if $pkg_config libpng --exists; then - vnc_png_cflags=3D$($pkg_config libpng --cflags) - vnc_png_libs=3D$($pkg_config libpng --libs) - else - vnc_png_cflags=3D"" - vnc_png_libs=3D"-lpng" - fi - if compile_prog "$vnc_png_cflags" "$vnc_png_libs" ; then - vnc_png=3Dyes - libs_softmmu=3D"$vnc_png_libs $libs_softmmu" - QEMU_CFLAGS=3D"$QEMU_CFLAGS $vnc_png_cflags" - else - if test "$vnc_png" =3D "yes" ; then - feature_not_found "vnc-png" "Install libpng devel" - fi - vnc_png=3Dno - fi -fi - ########################################## # xkbcommon probe if test "$xkbcommon" !=3D "no" ; then @@ -6839,24 +6760,6 @@ if test "$audio_win_int" =3D "yes" ; then fi echo "CONFIG_BDRV_RW_WHITELIST=3D$block_drv_rw_whitelist" >> $config_host_= mak echo "CONFIG_BDRV_RO_WHITELIST=3D$block_drv_ro_whitelist" >> $config_host_= mak -if test "$vnc" =3D "yes" ; then - echo "CONFIG_VNC=3Dy" >> $config_host_mak -fi -if test "$vnc_sasl" =3D "yes" ; then - echo "CONFIG_VNC_SASL=3Dy" >> $config_host_mak -fi -echo "SASL_CFLAGS=3D$vnc_sasl_cflags" >> $config_host_mak -echo "SASL_LIBS=3D$vnc_sasl_libs" >> $config_host_mak -if test "$vnc_jpeg" =3D "yes" ; then - echo "CONFIG_VNC_JPEG=3Dy" >> $config_host_mak -fi -echo "JPEG_CFLAGS=3D$vnc_jpeg_cflags" >> $config_host_mak -echo "JPEG_LIBS=3D$vnc_jpeg_libs" >> $config_host_mak -if test "$vnc_png" =3D "yes" ; then - echo "CONFIG_VNC_PNG=3Dy" >> $config_host_mak -fi -echo "PNG_CFLAGS=3D$vnc_png_cflags" >> $config_host_mak -echo "PNG_LIBS=3D$vnc_png_libs" >> $config_host_mak if test "$xkbcommon" =3D "yes" ; then echo "CONFIG_XKBCOMMON=3Dy" >> $config_host_mak echo "XKBCOMMON_CFLAGS=3D$xkbcommon_cflags" >> $config_host_mak @@ -8275,6 +8178,7 @@ NINJA=3D$PWD/ninjatool $meson setup \ -Db_pie=3D$(if test "$pie" =3D yes; then echo true; else echo fals= e; fi) \ -Db_coverage=3D$(if test "$gcov" =3D yes; then echo true; else ech= o false; fi) \ -Dsdl=3D$sdl -Dsdl_image=3D$sdl_image \ + -Dvnc=3D$vnc -Dvnc_sasl=3D$vnc_sasl -Dvnc_jpeg=3D$vnc_jpeg -Dvnc_png=3D$v= nc_png \ $cross_arg \ "$PWD" "$source_path" =20 diff --git a/meson.build b/meson.build index 53638335d9..afe684cbad 100644 --- a/meson.build +++ b/meson.build @@ -299,20 +299,24 @@ if 'CONFIG_GIO' in config_host gio =3D declare_dependency(compile_args: config_host['GIO_CFLAGS'].split= (), link_args: config_host['GIO_LIBS'].split()) endif +vnc =3D not_found png =3D not_found -if 'CONFIG_VNC_PNG' in config_host - png =3D declare_dependency(compile_args: config_host['PNG_CFLAGS'].split= (), - link_args: config_host['PNG_LIBS'].split()) -endif jpeg =3D not_found -if 'CONFIG_VNC_JPEG' in config_host - jpeg =3D declare_dependency(compile_args: config_host['JPEG_CFLAGS'].spl= it(), - link_args: config_host['JPEG_LIBS'].split()) -endif sasl =3D not_found -if 'CONFIG_VNC_SASL' in config_host - sasl =3D declare_dependency(compile_args: config_host['SASL_CFLAGS'].spl= it(), - link_args: config_host['SASL_LIBS'].split()) +if get_option('vnc').enabled() + vnc =3D declare_dependency() # dummy dependency + png =3D dependency('libpng', required: get_option('vnc_png'), + static: enable_static) + jpeg =3D cc.find_library('jpeg', has_headers: ['jpeglib.h'], + required: get_option('vnc_jpeg'), + static: enable_static) + sasl =3D cc.find_library('sasl2', has_headers: ['sasl/sasl.h'], + required: get_option('vnc_sasl'), + static: enable_static) + if sasl.found() + sasl =3D declare_dependency(dependencies: sasl, + compile_args: '-DSTRUCT_IOVEC_DEFINED') + endif endif fdt =3D not_found if 'CONFIG_FDT' in config_host @@ -370,6 +374,10 @@ endif =20 config_host_data.set('CONFIG_SDL', sdl.found()) config_host_data.set('CONFIG_SDL_IMAGE', sdl_image.found()) +config_host_data.set('CONFIG_VNC', vnc.found()) +config_host_data.set('CONFIG_VNC_JPEG', jpeg.found()) +config_host_data.set('CONFIG_VNC_PNG', png.found()) +config_host_data.set('CONFIG_VNC_SASL', sasl.found()) config_host_data.set('QEMU_VERSION', '"@0@"'.format(meson.project_version(= ))) config_host_data.set('QEMU_VERSION_MAJOR', meson.project_version().split('= .')[0]) config_host_data.set('QEMU_VERSION_MINOR', meson.project_version().split('= .')[1]) @@ -1275,11 +1283,11 @@ summary_info +=3D {'Block whitelist (rw)': config_h= ost['CONFIG_BDRV_RW_WHITELIST'] summary_info +=3D {'Block whitelist (ro)': config_host['CONFIG_BDRV_RO_WHI= TELIST']} summary_info +=3D {'VirtFS support': config_host.has_key('CONFIG_VIRTFS= ')} summary_info +=3D {'Multipath support': config_host.has_key('CONFIG_MPATH'= )} -summary_info +=3D {'VNC support': config_host.has_key('CONFIG_VNC')} -if config_host.has_key('CONFIG_VNC') - summary_info +=3D {'VNC SASL support': config_host.has_key('CONFIG_VNC_= SASL')} - summary_info +=3D {'VNC JPEG support': config_host.has_key('CONFIG_VNC_= JPEG')} - summary_info +=3D {'VNC PNG support': config_host.has_key('CONFIG_VNC_= PNG')} +summary_info +=3D {'VNC support': vnc.found()} +if vnc.found() + summary_info +=3D {'VNC SASL support': sasl.found()} + summary_info +=3D {'VNC JPEG support': jpeg.found()} + summary_info +=3D {'VNC PNG support': png.found()} endif summary_info +=3D {'xen support': config_host.has_key('CONFIG_XEN_BA= CKEND')} if config_host.has_key('CONFIG_XEN_BACKEND') diff --git a/meson_options.txt b/meson_options.txt index e548211f34..67455c57bc 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,2 +1,6 @@ option('sdl', type : 'feature', value : 'auto') option('sdl_image', type : 'feature', value : 'auto') +option('vnc', type : 'feature', value : 'enabled') +option('vnc_jpeg', type : 'feature', value : 'auto') +option('vnc_png', type : 'feature', value : 'auto') +option('vnc_sasl', type : 'feature', value : 'auto') diff --git a/ui/meson.build b/ui/meson.build index daec6c405e..6f74d30ea0 100644 --- a/ui/meson.build +++ b/ui/meson.build @@ -27,14 +27,12 @@ vnc_ss.add(files( 'vnc-ws.c', 'vnc-jobs.c', )) -vnc_ss.add(zlib) -vnc_ss.add(when: 'CONFIG_VNC_SASL', if_true: [files('vnc-auth-sasl.c'), sa= sl]) -softmmu_ss.add_all(when: 'CONFIG_VNC', if_true: vnc_ss) -softmmu_ss.add(when: 'CONFIG_VNC', if_false: files('vnc-stubs.c')) +vnc_ss.add(zlib, png, jpeg) +vnc_ss.add(when: sasl, if_true: files('vnc-auth-sasl.c')) +softmmu_ss.add_all(when: vnc, if_true: vnc_ss) +softmmu_ss.add(when: vnc, if_false: files('vnc-stubs.c')) softmmu_ss.add(when: [opengl, 'CONFIG_OPENGL'], if_true: files('shader.c',= 'console-gl.c', 'egl-helpers.c', 'egl-context.c')) softmmu_ss.add(when: [opengl, 'CONFIG_OPENGL_DMABUF'], if_true: files('egl= -headless.c')) -softmmu_ss.add(when: 'CONFIG_VNC_PNG', if_true: png) -softmmu_ss.add(when: 'CONFIG_VNC_JPEG', if_true: jpeg) =20 ui_modules =3D {} =20 --=20 2.26.2