From nobody Mon Feb 9 20:12:34 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 1634230399293895.2269485327746; Thu, 14 Oct 2021 09:53:19 -0700 (PDT) Received: from localhost ([::1]:53062 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mb3yn-00037f-SK for importer@patchew.org; Thu, 14 Oct 2021 12:53:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35024) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mb3cT-0003wp-06 for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:30:18 -0400 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]:44618) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mb3cM-0000sE-OL for qemu-devel@nongnu.org; Thu, 14 Oct 2021 12:30:11 -0400 Received: by mail-ed1-x530.google.com with SMTP id w14so26394523edv.11 for ; Thu, 14 Oct 2021 09:30:06 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id x22sm2658404edv.14.2021.10.14.09.30.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Oct 2021 09:30:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nJMY6tw0TNF27/bRMeNYIxvIfy8u0dOObIn8EaOKMK4=; b=MA1aplkWGdp5/qImL93gBjZeI5PnVzdxfCPaSIVkbzXYP4+vpM7koUyNH2D1OhuyJA xYGZutoj96IbOxL2B9Hhif251w+jLLUVKd6qBum0ABVlV99EWQrWHC8HohEaooFiihWn 6Z5LCAdSMXQ753ATuKOkEeRdYNwQ43TSjeDtfpomQLiwo2/kt8kAej9gqBA05oxoFXlN S4W2VbWTLKClSujOPM7O57lJHbGuaL9uN5culgf2zPSwBNkkTjxgbQVV8RfUtf60Tz9h d7NFwM1p6kNCllW4ifyInfCIGmO6v2hpl3/3H2ciXwOsd17mHMGjMAxeu4GxaZT3tnCc tdBw== 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:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=nJMY6tw0TNF27/bRMeNYIxvIfy8u0dOObIn8EaOKMK4=; b=zOO4Sj8oJfDT0DN+F965cFxlVHfLyW8BPN/JxmvcDLl/8WsBDLeOJilJTuKSVoGRmX eeHkNyzPowpAvw0UoSm0vVEgJ+PI7YIcmzaj0imVyWT9IAyej9HCKLkYSZVpZ05SHuJt wbCARlQ35MjGYCi4odHsqLf2f2A/YtIYKlJQ/B2fye4p9lxJqNi1JuFZM7Zq+LEwhfdB PtRJiTlI6GiTlz0BhfnYlniaEIgeUps2tLiwnq/tSSd47yfFUYj+M7wdgW7Us9NdIRF+ rqSVncNSHqi3by9HPjVERXgj5ebeGSYHeUSCM8TIG5kh7Z2zVUWXMXJFeyGQu6ZQN+Hx WEWQ== X-Gm-Message-State: AOAM533A/vKQP19OXZbiRF/w3qURRjhmOqazEIzY6JYIbzUu6MK9qKTL 0HCdRVJsxhSPcT/OuXiNPrIp++dMDl4= X-Google-Smtp-Source: ABdhPJztBUFmcmXVg3TWYo1sn9z26CMLJAyCUBKWkYBrJkIYhSQzRQPPJ/tkWBTSUR6OLx3Zknce1A== X-Received: by 2002:a17:907:208c:: with SMTP id pv12mr5217793ejb.314.1634229004878; Thu, 14 Oct 2021 09:30:04 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 26/26] configure: automatically parse command line for meson -D options Date: Thu, 14 Oct 2021 18:29:38 +0200 Message-Id: <20211014162938.430211-27-pbonzini@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211014162938.430211-1-pbonzini@redhat.com> References: <20211014162938.430211-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: 4 X-Spam_score: 0.4 X-Spam_bar: / X-Spam_report: (0.4 / 5.0 requ) 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: , 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: 1634230400890100001 Content-Type: text/plain; charset="utf-8" Right now meson_options.txt lists about 90 options. Each option needs code in configure to parse it and pass the option down to Meson as a -D command-line argument; in addition the default must be duplicated between configure and meson_options.txt. This series tries to remove the code duplication by generating the case statement for those --enable and --disable options, as well as the corresponding help text. About 80% of the options can be handled completely by the new mechanism. Eight meson options are not of the --enable/--disable kind. Six more need to be parsed in configure for various reasons documented in the patch, but they still have their help automatically generated. The advantages are: - less code in configure - parsing and help is more consistent (for example --enable-blobs was not supported) - options are described entirely in one place, meson_options.txt. This make it more attractive to use Meson options instead of hand-crafted configure options and config-host.mak A few options change name: --enable-tcmalloc and --enable-jemalloc become --enable-malloc=3D{tcmalloc,jemalloc}; --disable-blobs becomes --disable-install-blobs; --enable-trace-backend becomes --enable-trace-backends. However, the old names are allowed for backwards compatibility. Message-Id: <20211007130829.632254-19-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- configure | 556 +++------------------------------- docs/devel/build-system.rst | 132 ++++---- meson_options.txt | 8 + scripts/meson-buildoptions.py | 92 ++++++ scripts/meson-buildoptions.sh | 257 ++++++++++++++++ 5 files changed, 459 insertions(+), 586 deletions(-) diff --git a/configure b/configure index 8eb0ef160f..039467c04b 100755 --- a/configure +++ b/configure @@ -286,41 +286,8 @@ for opt do esac done =20 -brlapi=3D"auto" -curl=3D"auto" -iconv=3D"auto" -curses=3D"auto" -docs=3D"auto" -fdt=3D"auto" -netmap=3D"auto" -sdl=3D"auto" -sdl_image=3D"auto" -virtiofsd=3D"auto" -virtfs=3D"auto" -libudev=3D"auto" -mpath=3D"auto" -vnc=3D"auto" -sparse=3D"auto" -vde=3D"auto" -vnc_sasl=3D"auto" -vnc_jpeg=3D"auto" -vnc_png=3D"auto" -xkbcommon=3D"auto" -alsa=3D"auto" -coreaudio=3D"auto" -dsound=3D"auto" -jack=3D"auto" -oss=3D"auto" -pa=3D"auto" -xen=3D${default_feature:+disabled} xen_ctrl_version=3D"$default_feature" -xen_pci_passthrough=3D"auto" -linux_aio=3D"auto" -linux_io_uring=3D"auto" -cap_ng=3D"auto" -attr=3D"auto" xfs=3D"$default_feature" -tcg=3D"enabled" membarrier=3D"$default_feature" vhost_kernel=3D"$default_feature" vhost_net=3D"$default_feature" @@ -328,15 +295,8 @@ vhost_crypto=3D"$default_feature" vhost_scsi=3D"$default_feature" vhost_vsock=3D"$default_feature" vhost_user=3D"no" -vhost_user_blk_server=3D"auto" vhost_user_fs=3D"$default_feature" vhost_vdpa=3D"$default_feature" -bpf=3D"auto" -kvm=3D"auto" -hax=3D"auto" -hvf=3D"auto" -whpx=3D"auto" -nvmm=3D"auto" rdma=3D"$default_feature" pvrdma=3D"$default_feature" gprof=3D"no" @@ -346,7 +306,6 @@ sanitizers=3D"no" tsan=3D"no" fortify_source=3D"$default_feature" strip_opt=3D"yes" -tcg_interpreter=3D"false" mingw32=3D"no" gcov=3D"no" EXESUF=3D"" @@ -354,68 +313,36 @@ modules=3D"no" module_upgrades=3D"no" prefix=3D"/usr/local" qemu_suffix=3D"qemu" -slirp=3D"auto" bsd=3D"no" linux=3D"no" solaris=3D"no" profiler=3D"no" -cocoa=3D"auto" softmmu=3D"yes" linux_user=3D"no" bsd_user=3D"no" -blobs=3D"true" pkgversion=3D"" pie=3D"" qom_cast_debug=3D"yes" trace_backends=3D"log" trace_file=3D"trace" -spice=3D"auto" -spice_protocol=3D"auto" -rbd=3D"auto" -smartcard=3D"auto" -u2f=3D"auto" -libusb=3D"auto" -usb_redir=3D"auto" opengl=3D"$default_feature" cpuid_h=3D"no" avx2_opt=3D"$default_feature" -capstone=3D"auto" -lzo=3D"auto" -snappy=3D"auto" -bzip2=3D"auto" -lzfse=3D"auto" -zstd=3D"auto" guest_agent=3D"$default_feature" guest_agent_with_vss=3D"no" guest_agent_ntddscsi=3D"no" -guest_agent_msi=3D"auto" vss_win32_sdk=3D"$default_feature" win_sdk=3D"no" want_tools=3D"$default_feature" -libiscsi=3D"auto" -libnfs=3D"auto" coroutine=3D"" coroutine_pool=3D"$default_feature" debug_stack_usage=3D"no" crypto_afalg=3D"no" -cfi=3D"false" -cfi_debug=3D"false" -seccomp=3D"auto" -glusterfs=3D"auto" -gtk=3D"auto" tls_priority=3D"NORMAL" -gnutls=3D"auto" -nettle=3D"auto" -gcrypt=3D"auto" -auth_pam=3D"auto" -vte=3D"auto" -virglrenderer=3D"auto" tpm=3D"$default_feature" libssh=3D"$default_feature" live_block_migration=3D${default_feature:-yes} numa=3D"$default_feature" -tcmalloc=3D"no" -jemalloc=3D"no" replication=3D${default_feature:-yes} bochs=3D${default_feature:-yes} cloop=3D${default_feature:-yes} @@ -425,26 +352,34 @@ vdi=3D${default_feature:-yes} vvfat=3D${default_feature:-yes} qed=3D${default_feature:-yes} parallels=3D${default_feature:-yes} -libxml2=3D"auto" debug_mutex=3D"no" -libpmem=3D"auto" -default_devices=3D"true" plugins=3D"$default_feature" -fuzzing=3D"false" rng_none=3D"no" secret_keyring=3D"$default_feature" -libdaxctl=3D"auto" meson=3D"" +meson_args=3D"" ninja=3D"" +gio=3D"$default_feature" skip_meson=3Dno -gettext=3D"auto" -fuse=3D"auto" -fuse_lseek=3D"auto" -multiprocess=3D"auto" slirp_smbd=3D"$default_feature" =20 -malloc_trim=3D"auto" -gio=3D"$default_feature" +# The following Meson options are handled manually (still they +# are included in the automatically generated help message) + +# 1. Track which submodules are needed +capstone=3D"auto" +fdt=3D"auto" +slirp=3D"auto" + +# 2. Support --with/--without option +default_devices=3D"true" + +# 3. Automatically enable/disable other options +tcg=3D"enabled" +cfi=3D"false" + +# 4. Detection partly done in configure +xen=3D${default_feature:+disabled} =20 # parse CC options second for opt do @@ -874,11 +809,6 @@ for opt do error_exit "Can't mix --target-list-exclude with --= target-list" fi ;; - --enable-trace-backends=3D*) trace_backends=3D"$optarg" - ;; - # XXX: backwards compatibility - --enable-trace-backend=3D*) trace_backends=3D"$optarg" - ;; --with-trace-file=3D*) trace_file=3D"$optarg" ;; --with-default-devices) default_devices=3D"true" @@ -941,42 +871,10 @@ for opt do # configure to be used by RPM and similar macros that set # lots of directory switches by default. ;; - --disable-sdl) sdl=3D"disabled" - ;; - --enable-sdl) sdl=3D"enabled" - ;; - --disable-sdl-image) sdl_image=3D"disabled" - ;; - --enable-sdl-image) sdl_image=3D"enabled" - ;; --disable-qom-cast-debug) qom_cast_debug=3D"no" ;; --enable-qom-cast-debug) qom_cast_debug=3D"yes" ;; - --disable-virtfs) virtfs=3D"disabled" - ;; - --enable-virtfs) virtfs=3D"enabled" - ;; - --disable-libudev) libudev=3D"disabled" - ;; - --enable-libudev) libudev=3D"enabled" - ;; - --disable-virtiofsd) virtiofsd=3D"disabled" - ;; - --enable-virtiofsd) virtiofsd=3D"enabled" - ;; - --disable-mpath) mpath=3D"disabled" - ;; - --enable-mpath) mpath=3D"enabled" - ;; - --disable-vnc) vnc=3D"disabled" - ;; - --enable-vnc) vnc=3D"enabled" - ;; - --disable-gettext) gettext=3D"disabled" - ;; - --enable-gettext) gettext=3D"enabled" - ;; --audio-drv-list=3D*) audio_drv_list=3D"$optarg" ;; --block-drv-rw-whitelist=3D*|--block-drv-whitelist=3D*) block_drv_rw_whi= telist=3D$(echo "$optarg" | sed -e 's/,/ /g') @@ -1007,24 +905,8 @@ for opt do ;; --disable-tsan) tsan=3D"no" ;; - --enable-sparse) sparse=3D"enabled" - ;; - --disable-sparse) sparse=3D"disabled" - ;; --disable-strip) strip_opt=3D"no" ;; - --disable-vnc-sasl) vnc_sasl=3D"disabled" - ;; - --enable-vnc-sasl) vnc_sasl=3D"enabled" - ;; - --disable-vnc-jpeg) vnc_jpeg=3D"disabled" - ;; - --enable-vnc-jpeg) vnc_jpeg=3D"enabled" - ;; - --disable-vnc-png) vnc_png=3D"disabled" - ;; - --enable-vnc-png) vnc_png=3D"enabled" - ;; --disable-slirp) slirp=3D"disabled" ;; --enable-slirp) slirp=3D"enabled" @@ -1033,113 +915,17 @@ for opt do ;; --enable-slirp=3D*) slirp=3D"$optarg" ;; - --disable-vde) vde=3D"disabled" - ;; - --enable-vde) vde=3D"enabled" - ;; - --disable-netmap) netmap=3D"disabled" - ;; - --enable-netmap) netmap=3D"enabled" - ;; --disable-xen) xen=3D"disabled" ;; --enable-xen) xen=3D"enabled" ;; - --disable-xen-pci-passthrough) xen_pci_passthrough=3D"disabled" - ;; - --enable-xen-pci-passthrough) xen_pci_passthrough=3D"enabled" - ;; - --disable-alsa) alsa=3D"disabled" - ;; - --enable-alsa) alsa=3D"enabled" - ;; - --disable-coreaudio) coreaudio=3D"disabled" - ;; - --enable-coreaudio) coreaudio=3D"enabled" - ;; - --disable-dsound) dsound=3D"disabled" - ;; - --enable-dsound) dsound=3D"enabled" - ;; - --disable-jack) jack=3D"disabled" - ;; - --enable-jack) jack=3D"enabled" - ;; - --disable-oss) oss=3D"disabled" - ;; - --enable-oss) oss=3D"enabled" - ;; - --disable-pa) pa=3D"disabled" - ;; - --enable-pa) pa=3D"enabled" - ;; - --disable-brlapi) brlapi=3D"disabled" - ;; - --enable-brlapi) brlapi=3D"enabled" - ;; - --disable-kvm) kvm=3D"disabled" - ;; - --enable-kvm) kvm=3D"enabled" - ;; - --disable-hax) hax=3D"disabled" - ;; - --enable-hax) hax=3D"enabled" - ;; - --disable-hvf) hvf=3D"disabled" - ;; - --enable-hvf) hvf=3D"enabled" - ;; - --disable-nvmm) nvmm=3D"disabled" - ;; - --enable-nvmm) nvmm=3D"enabled" - ;; - --disable-whpx) whpx=3D"disabled" - ;; - --enable-whpx) whpx=3D"enabled" - ;; - --disable-tcg-interpreter) tcg_interpreter=3D"false" - ;; - --enable-tcg-interpreter) tcg_interpreter=3D"true" - ;; - --disable-cap-ng) cap_ng=3D"disabled" - ;; - --enable-cap-ng) cap_ng=3D"enabled" - ;; --disable-tcg) tcg=3D"disabled" plugins=3D"no" ;; --enable-tcg) tcg=3D"enabled" ;; - --disable-malloc-trim) malloc_trim=3D"disabled" - ;; - --enable-malloc-trim) malloc_trim=3D"enabled" - ;; - --disable-spice) spice=3D"no" - ;; - --enable-spice) - spice_protocol=3D"yes" - spice=3D"yes" - ;; - --disable-spice-protocol) - spice_protocol=3D"no" - spice=3D"no" - ;; - --enable-spice-protocol) spice_protocol=3D"yes" - ;; - --disable-libiscsi) libiscsi=3D"disabled" - ;; - --enable-libiscsi) libiscsi=3D"enabled" - ;; - --disable-libnfs) libnfs=3D"disabled" - ;; - --enable-libnfs) libnfs=3D"enabled" - ;; --enable-profiler) profiler=3D"yes" ;; - --disable-cocoa) cocoa=3D"disabled" - ;; - --enable-cocoa) cocoa=3D"enabled" - ;; --disable-system) softmmu=3D"no" ;; --enable-system) softmmu=3D"yes" @@ -1183,22 +969,6 @@ for opt do ;; --disable-cfi) cfi=3D"false" ;; - --enable-cfi-debug) cfi_debug=3D"true" - ;; - --disable-cfi-debug) cfi_debug=3D"false" - ;; - --disable-curses) curses=3D"disabled" - ;; - --enable-curses) curses=3D"enabled" - ;; - --disable-iconv) iconv=3D"disabled" - ;; - --enable-iconv) iconv=3D"enabled" - ;; - --disable-curl) curl=3D"disabled" - ;; - --enable-curl) curl=3D"enabled" - ;; --disable-fdt) fdt=3D"disabled" ;; --enable-fdt) fdt=3D"enabled" @@ -1207,28 +977,10 @@ for opt do ;; --enable-fdt=3D*) fdt=3D"$optarg" ;; - --disable-linux-aio) linux_aio=3D"disabled" - ;; - --enable-linux-aio) linux_aio=3D"enabled" - ;; - --disable-linux-io-uring) linux_io_uring=3D"disabled" - ;; - --enable-linux-io-uring) linux_io_uring=3D"enabled" - ;; - --disable-attr) attr=3D"disabled" - ;; - --enable-attr) attr=3D"enabled" - ;; --disable-membarrier) membarrier=3D"no" ;; --enable-membarrier) membarrier=3D"yes" ;; - --disable-bpf) bpf=3D"disabled" - ;; - --enable-bpf) bpf=3D"enabled" - ;; - --disable-blobs) blobs=3D"false" - ;; --with-pkgversion=3D*) pkgversion=3D"$optarg" ;; --with-coroutine=3D*) coroutine=3D"$optarg" @@ -1243,10 +995,6 @@ for opt do ;; --disable-crypto-afalg) crypto_afalg=3D"no" ;; - --disable-docs) docs=3D"disabled" - ;; - --enable-docs) docs=3D"enabled" - ;; --disable-vhost-net) vhost_net=3D"no" ;; --enable-vhost-net) vhost_net=3D"yes" @@ -1263,10 +1011,6 @@ for opt do ;; --enable-vhost-vsock) vhost_vsock=3D"yes" ;; - --disable-vhost-user-blk-server) vhost_user_blk_server=3D"disabled" - ;; - --enable-vhost-user-blk-server) vhost_user_blk_server=3D"enabled" - ;; --disable-vhost-user-fs) vhost_user_fs=3D"no" ;; --enable-vhost-user-fs) vhost_user_fs=3D"yes" @@ -1275,60 +1019,16 @@ for opt do ;; --enable-opengl) opengl=3D"yes" ;; - --disable-rbd) rbd=3D"disabled" - ;; - --enable-rbd) rbd=3D"enabled" - ;; --disable-xfsctl) xfs=3D"no" ;; --enable-xfsctl) xfs=3D"yes" ;; - --disable-smartcard) smartcard=3D"disabled" - ;; - --enable-smartcard) smartcard=3D"enabled" - ;; - --disable-u2f) u2f=3D"disabled" - ;; - --enable-u2f) u2f=3D"enabled" - ;; - --disable-libusb) libusb=3D"disabled" - ;; - --enable-libusb) libusb=3D"enabled" - ;; - --disable-usb-redir) usb_redir=3D"disabled" - ;; - --enable-usb-redir) usb_redir=3D"enabled" - ;; --disable-zlib-test) ;; - --disable-lzo) lzo=3D"disabled" - ;; - --enable-lzo) lzo=3D"enabled" - ;; - --disable-snappy) snappy=3D"disabled" - ;; - --enable-snappy) snappy=3D"enabled" - ;; - --disable-bzip2) bzip2=3D"disabled" - ;; - --enable-bzip2) bzip2=3D"enabled" - ;; - --enable-lzfse) lzfse=3D"enabled" - ;; - --disable-lzfse) lzfse=3D"disabled" - ;; - --disable-zstd) zstd=3D"disabled" - ;; - --enable-zstd) zstd=3D"enabled" - ;; --enable-guest-agent) guest_agent=3D"yes" ;; --disable-guest-agent) guest_agent=3D"no" ;; - --enable-guest-agent-msi) guest_agent_msi=3D"enabled" - ;; - --disable-guest-agent-msi) guest_agent_msi=3D"disabled" - ;; --with-vss-sdk) vss_win32_sdk=3D"" ;; --with-vss-sdk=3D*) vss_win32_sdk=3D"$optarg" @@ -1345,12 +1045,6 @@ for opt do ;; --disable-tools) want_tools=3D"no" ;; - --enable-seccomp) seccomp=3D"enabled" - ;; - --disable-seccomp) seccomp=3D"disabled" - ;; - --disable-glusterfs) glusterfs=3D"disabled" - ;; --disable-avx2) avx2_opt=3D"no" ;; --enable-avx2) avx2_opt=3D"yes" @@ -1359,9 +1053,6 @@ for opt do ;; --enable-avx512f) avx512f_opt=3D"yes" ;; - - --enable-glusterfs) glusterfs=3D"enabled" - ;; --disable-virtio-blk-data-plane|--enable-virtio-blk-data-plane) echo "$0: $opt is obsolete, virtio-blk data-plane is always on" >&2 ;; @@ -1371,28 +1062,8 @@ for opt do --enable-uuid|--disable-uuid) echo "$0: $opt is obsolete, UUID support is always built" >&2 ;; - --disable-gtk) gtk=3D"disabled" - ;; - --enable-gtk) gtk=3D"enabled" - ;; --tls-priority=3D*) tls_priority=3D"$optarg" ;; - --disable-gnutls) gnutls=3D"disabled" - ;; - --enable-gnutls) gnutls=3D"enabled" - ;; - --disable-nettle) nettle=3D"disabled" - ;; - --enable-nettle) nettle=3D"enabled" - ;; - --disable-gcrypt) gcrypt=3D"disabled" - ;; - --enable-gcrypt) gcrypt=3D"enabled" - ;; - --disable-auth-pam) auth_pam=3D"disabled" - ;; - --enable-auth-pam) auth_pam=3D"enabled" - ;; --enable-rdma) rdma=3D"yes" ;; --disable-rdma) rdma=3D"no" @@ -1401,14 +1072,6 @@ for opt do ;; --disable-pvrdma) pvrdma=3D"no" ;; - --disable-vte) vte=3D"disabled" - ;; - --enable-vte) vte=3D"enabled" - ;; - --disable-virglrenderer) virglrenderer=3D"disabled" - ;; - --enable-virglrenderer) virglrenderer=3D"enabled" - ;; --disable-tpm) tpm=3D"no" ;; --enable-tpm) tpm=3D"yes" @@ -1425,18 +1088,6 @@ for opt do ;; --enable-numa) numa=3D"yes" ;; - --disable-libxml2) libxml2=3D"disabled" - ;; - --enable-libxml2) libxml2=3D"enabled" - ;; - --disable-tcmalloc) tcmalloc=3D"no" - ;; - --enable-tcmalloc) tcmalloc=3D"yes" - ;; - --disable-jemalloc) jemalloc=3D"no" - ;; - --enable-jemalloc) jemalloc=3D"yes" - ;; --disable-replication) replication=3D"no" ;; --enable-replication) replication=3D"yes" @@ -1502,14 +1153,6 @@ for opt do ;; --disable-debug-mutex) debug_mutex=3Dno ;; - --enable-libpmem) libpmem=3D"enabled" - ;; - --disable-libpmem) libpmem=3D"disabled" - ;; - --enable-xkbcommon) xkbcommon=3D"enabled" - ;; - --disable-xkbcommon) xkbcommon=3D"disabled" - ;; --enable-plugins) if test "$mingw32" =3D "yes"; then error_exit "TCG plugins not currently supported on= Windows platforms" else @@ -1522,10 +1165,6 @@ for opt do ;; --disable-containers) use_containers=3D"no" ;; - --enable-fuzzing) fuzzing=3Dtrue - ;; - --disable-fuzzing) fuzzing=3Dfalse - ;; --gdb=3D*) gdb_bin=3D"$optarg" ;; --enable-rng-none) rng_none=3Dyes @@ -1536,22 +1175,6 @@ for opt do ;; --disable-keyring) secret_keyring=3D"no" ;; - --enable-libdaxctl) libdaxctl=3D"enabled" - ;; - --disable-libdaxctl) libdaxctl=3D"disabled" - ;; - --enable-fuse) fuse=3D"enabled" - ;; - --disable-fuse) fuse=3D"disabled" - ;; - --enable-fuse-lseek) fuse_lseek=3D"enabled" - ;; - --disable-fuse-lseek) fuse_lseek=3D"disabled" - ;; - --enable-multiprocess) multiprocess=3D"enabled" - ;; - --disable-multiprocess) multiprocess=3D"disabled" - ;; --enable-gio) gio=3Dyes ;; --disable-gio) gio=3Dno @@ -1560,6 +1183,16 @@ for opt do ;; --disable-slirp-smbd) slirp_smbd=3Dno ;; + # backwards compatibility options + --enable-trace-backend=3D*) meson_option_parse "--enable-trace-backends= =3D$optarg" "$optarg" + ;; + --disable-blobs) meson_option_parse --disable-install-blobs "" + ;; + --enable-tcmalloc) meson_option_parse --enable-malloc=3Dtcmalloc tcmalloc + ;; + --enable-jemalloc) meson_option_parse --enable-malloc=3Djemalloc jemalloc + ;; + # everything else has the same name in configure and meson --enable-* | --disable-*) meson_option_parse "$opt" "$optarg" ;; *) @@ -1716,9 +1349,6 @@ for config in $mak_wilds; do fi done =20 -# Enumerate public trace backends for --help output -trace_backend_list=3D$(echo $(grep -le '^PUBLIC =3D True$' "$source_path"/= scripts/tracetool/backend/*.py | sed -e 's/^.*\/\(.*\)\.py$/\1/')) - if test x"$show_help" =3D x"yes" ; then cat << EOF =20 @@ -1795,18 +1425,12 @@ Advanced options (experts only): (by default affects only QEMU, not tools like q= emu-img) --enable-block-drv-whitelist-in-tools use block whitelist also in tools instead of on= ly QEMU - --enable-trace-backends=3DB Set trace backend - Available backends: $trace_backend_list --with-trace-file=3DNAME Full PATH,NAME of file to store traces Default:trace- - --disable-slirp disable SLIRP userspace network connectivity - --enable-tcg-interpreter enable TCI (TCG with bytecode interpreter, expe= rimental and slow) - --enable-malloc-trim enable libc malloc_trim() for memory optimizati= on --cpu=3DCPU Build for host CPU [$cpu] --with-coroutine=3DBACKEND coroutine backend. Supported options: ucontext, sigaltstack, windows --enable-gcov enable test coverage analysis with gcov - --disable-blobs disable installing provided firmware blobs --with-vss-sdk=3DSDK-path enable Windows VSS support in QEMU Guest Agent --with-win-sdk=3DSDK-path path to Windows Platform SDK (to build VSS .t= lb) --tls-priority default TLS protocol/cipher priority string @@ -1825,110 +1449,34 @@ cat << EOF user supported user emulation targets linux-user all linux usermode emulation targets bsd-user all BSD usermode emulation targets - docs build documentation guest-agent build the QEMU Guest Agent - guest-agent-msi build guest agent Windows MSI installation package pie Position Independent Executables modules modules support (non-Windows) module-upgrades try to load modules from alternate paths for upgrades debug-tcg TCG debugging (default is disabled) debug-info debugging information lto Enable Link-Time Optimization. - sparse sparse checker safe-stack SafeStack Stack Smash Protection. Depends on clang/llvm >=3D 3.7 and requires coroutine backend ucont= ext. - cfi Enable Control-Flow Integrity for indirect function call= s. - In case of a cfi violation, QEMU is terminated with SIGI= LL - Depends on lto and is incompatible with modules - Automatically enables Link-Time Optimization (lto) - cfi-debug In case of a cfi violation, a message containing the lin= e that - triggered the error is written to stderr. After the erro= r, - QEMU is still terminated with SIGILL - gnutls GNUTLS cryptography support - nettle nettle cryptography support - gcrypt libgcrypt cryptography support - auth-pam PAM access control - sdl SDL UI - sdl-image SDL Image support for icons - gtk gtk UI - vte vte support for the gtk UI - curses curses UI - iconv font glyph conversion support - vnc VNC UI support - vnc-sasl SASL encryption for VNC server - vnc-jpeg JPEG lossy compression for VNC server - vnc-png PNG compression for VNC server - cocoa Cocoa UI (Mac OS X only) - virtfs VirtFS - virtiofsd build virtiofs daemon (virtiofsd) - libudev Use libudev to enumerate host devices - mpath Multipath persistent reservation passthrough - xen xen backend driver support - xen-pci-passthrough PCI passthrough support for Xen - alsa ALSA sound support - coreaudio CoreAudio sound support - dsound DirectSound sound support - jack JACK sound support - oss OSS sound support - pa PulseAudio sound support - brlapi BrlAPI (Braile) - curl curl connectivity membarrier membarrier system call (for Linux 4.14+ or Windows) - fdt fdt device tree - kvm KVM acceleration support - hax HAX acceleration support - hvf Hypervisor.framework acceleration support - nvmm NVMM acceleration support - whpx Windows Hypervisor Platform acceleration support rdma Enable RDMA-based migration pvrdma Enable PVRDMA support - vde support for vde network - netmap support for netmap network - linux-aio Linux AIO support - linux-io-uring Linux io_uring support - cap-ng libcap-ng support - attr attr and xattr support vhost-net vhost-net kernel acceleration support vhost-vsock virtio sockets device support vhost-scsi vhost-scsi kernel target support vhost-crypto vhost-user-crypto backend support vhost-kernel vhost kernel backend support vhost-user vhost-user backend support - vhost-user-blk-server vhost-user-blk server support vhost-vdpa vhost-vdpa kernel backend support - bpf BPF kernel support - spice spice - spice-protocol spice-protocol - rbd rados block device (rbd) - libiscsi iscsi support - libnfs nfs support - smartcard smartcard support (libcacard) - u2f U2F support (u2f-emu) - libusb libusb (for usb passthrough) live-block-migration Block migration in the main migration stream - usb-redir usb network redirection support - lzo support of lzo compression library - snappy support of snappy compression library - bzip2 support of bzip2 compression library - (for reading bzip2-compressed dmg images) - lzfse support of lzfse compression library - (for reading lzfse-compressed dmg images) - zstd support for zstd compression library - (for migration compression and qcow2 cluster compression) - seccomp seccomp support coroutine-pool coroutine freelist (better performance) - glusterfs GlusterFS backend tpm TPM support libssh ssh block device support numa libnuma support - libxml2 for Parallels image format - tcmalloc tcmalloc support - jemalloc jemalloc support avx2 AVX2 optimization support avx512f AVX512F optimization support replication replication support opengl opengl support - virglrenderer virgl rendering support xfsctl xfsctl support qom-cast-debug cast debugging support tools build qemu-io, qemu-nbd and qemu-img tools @@ -1941,15 +1489,8 @@ cat << EOF qed qed image format support parallels parallels image format support crypto-afalg Linux AF_ALG crypto backend driver - capstone capstone disassembler support debug-mutex mutex debugging support - libpmem libpmem support - xkbcommon xkbcommon support rng-none dummy RNG, avoid using /dev/(u)random and getrandom() - libdaxctl libdaxctl support - fuse FUSE block device export - fuse-lseek SEEK_HOLE/SEEK_DATA support for FUSE exports - multiprocess Out of process device emulation support gio libgio support slirp-smbd use smbd (at path --smbd=3D*) in slirp networking =20 @@ -3173,16 +2714,6 @@ EOF fi fi =20 -malloc=3Dsystem -if test "$tcmalloc" =3D "yes" && test "$jemalloc" =3D "yes" ; then - echo "ERROR: tcmalloc && jemalloc can't be used at the same time" - exit 1 -elif test "$tcmalloc" =3D "yes" ; then - malloc=3Dtcmalloc -elif test "$jemalloc" =3D "yes" ; then - malloc=3Djemalloc -fi - # check for usbfs have_usbfs=3Dno if test "$linux_user" =3D "yes"; then @@ -4513,40 +4044,23 @@ if test "$skip_meson" =3D no; then --sysconfdir "$sysconfdir" \ --localedir "$localedir" \ --localstatedir "$local_statedir" \ + -Daudio_drv_list=3D$audio_drv_list \ + -Ddefault_devices=3D$default_devices \ -Ddocdir=3D"$docdir" \ -Dqemu_firmwarepath=3D"$firmwarepath" \ -Dqemu_suffix=3D"$qemu_suffix" \ + -Dsphinx_build=3D"$sphinx_build" \ + -Dtrace_file=3D"$trace_file" \ -Doptimization=3D$(if test "$debug" =3D yes; then echo 0; else ech= o 2; fi) \ -Ddebug=3D$(if test "$debug_info" =3D yes; then echo true; else ec= ho false; fi) \ -Dwerror=3D$(if test "$werror" =3D yes; then echo true; else echo = false; fi) \ -Dstrip=3D$(if test "$strip_opt" =3D yes; then echo true; else ech= o false; fi) \ -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) \ - -Db_lto=3D$lto -Dcfi=3D$cfi -Dcfi_debug=3D$cfi_debug -Dfuzzing=3D$= fuzzing \ + -Db_lto=3D$lto -Dcfi=3D$cfi -Dtcg=3D$tcg -Dxen=3D$xen \ + -Dcapstone=3D$capstone -Dfdt=3D$fdt -Dslirp=3D$slirp \ $(test -n "${LIB_FUZZING_ENGINE+xxx}" && echo "-Dfuzzing_engine=3D= $LIB_FUZZING_ENGINE") \ - -Dmalloc=3D$malloc -Dmalloc_trim=3D$malloc_trim -Dsparse=3D$sparse= \ - -Dkvm=3D$kvm -Dhax=3D$hax -Dwhpx=3D$whpx -Dhvf=3D$hvf -Dnvmm=3D$nv= mm \ - -Dxen=3D$xen -Dxen_pci_passthrough=3D$xen_pci_passthrough -Dtcg=3D= $tcg \ - -Dcocoa=3D$cocoa -Dgtk=3D$gtk -Dmpath=3D$mpath -Dsdl=3D$sdl -Dsdl_= image=3D$sdl_image \ - -Dlibusb=3D$libusb -Dsmartcard=3D$smartcard -Dusb_redir=3D$usb_red= ir -Dvte=3D$vte \ - -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 \ - -Dcurl=3D$curl -Dglusterfs=3D$glusterfs -Dbzip2=3D$bzip2 -Dlibiscs= i=3D$libiscsi \ - -Dlibnfs=3D$libnfs -Diconv=3D$iconv -Dcurses=3D$curses -Dlibudev= =3D$libudev\ - -Drbd=3D$rbd -Dlzo=3D$lzo -Dsnappy=3D$snappy -Dlzfse=3D$lzfse -Dli= bxml2=3D$libxml2 \ - -Dlibdaxctl=3D$libdaxctl -Dlibpmem=3D$libpmem -Dlinux_io_uring=3D$= linux_io_uring \ - -Dgnutls=3D$gnutls -Dnettle=3D$nettle -Dgcrypt=3D$gcrypt -Dauth_pa= m=3D$auth_pam \ - -Dzstd=3D$zstd -Dseccomp=3D$seccomp -Dvirtfs=3D$virtfs -Dcap_ng=3D= $cap_ng \ - -Dattr=3D$attr -Ddefault_devices=3D$default_devices -Dvirglrendere= r=3D$virglrenderer \ - -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\ $(if test "$default_feature" =3D no; then echo "-Dauto_features=3D= disabled"; fi) \ - -Dalsa=3D$alsa -Dcoreaudio=3D$coreaudio -Ddsound=3D$dsound -Djack= =3D$jack -Doss=3D$oss \ - -Dpa=3D$pa -Daudio_drv_list=3D$audio_drv_list -Dtcg_interpreter=3D= $tcg_interpreter \ - -Dtrace_backends=3D$trace_backends -Dtrace_file=3D$trace_file -Dli= nux_aio=3D$linux_aio \ - -Dnetmap=3D$netmap -Dvde=3D$vde \ "$@" $cross_arg "$PWD" "$source_path" } eval run_meson $meson_options diff --git a/docs/devel/build-system.rst b/docs/devel/build-system.rst index 0f636d620e..7f106d2f1c 100644 --- a/docs/devel/build-system.rst +++ b/docs/devel/build-system.rst @@ -42,73 +42,21 @@ perform a build: ../configure make =20 -For now, checks on the compilation environment are found in configure -rather than meson.build, though this is expected to change. The command -line is parsed in the configure script and, whenever needed, converted -into the appropriate options to Meson. - -New checks should be added to Meson, which usually comprises the -following tasks: - - - Add a Meson build option to meson_options.txt. - - - Add support to the command line arg parser to handle any new - ``--enable-XXX``/``--disable-XXX`` flags required by the feature. - - - Add information to the help output message to report on the new - feature flag. - - - Add code to perform the actual feature check. - - - Add code to include the feature status in ``config-host.h`` - - - Add code to print out the feature status in the configure summary - upon completion. - - -Taking the probe for SDL2_Image as an example, we have the following pieces -in configure:: - - # Initial variable state - sdl_image=3Dauto - - ..snip.. - - # Configure flag processing - --disable-sdl-image) sdl_image=3Ddisabled - ;; - --enable-sdl-image) sdl_image=3Denabled - ;; - - ..snip.. - - # Help output feature message - sdl-image SDL Image support for icons - - ..snip.. - - # Meson invocation - -Dsdl_image=3D$sdl_image - -In meson_options.txt:: - - option('sdl', type : 'feature', value : 'auto', - description: 'SDL Image support for icons') - -In meson.build:: - - # Detect dependency - sdl_image =3D dependency('SDL2_image', required: get_option('sdl_image'), - method: 'pkg-config', - kwargs: static_kwargs) - - # Create config-host.h (if applicable) - config_host_data.set('CONFIG_SDL_IMAGE', sdl_image.found()) - - # Summary - summary_info +=3D {'SDL image support': sdl_image.found()} +The configure script automatically recognizes +command line options for which a same-named Meson option exists; +dashes in the command line are replaced with underscores. =20 +Many checks on the compilation environment are still found in configure +rather than `meson.build`, but new checks should be added directly to +`meson.build`. =20 +Patches are also welcome to move existing checks from the configure +phase to `meson.build`. When doing so, ensure that `meson.build` does +not use anymore the keys that you have removed from `config-host.mak`. +Typically these will be replaced in `meson.build` by boolean variables, +``get_option('optname')`` invocations, or `dep.found()` expressions. +In general, the remaining checks have little or no interdependencies, +so they can be moved one by one. =20 Helper functions ---------------- @@ -335,6 +283,60 @@ new target, or enabling new devices or hardware for a = particular system/userspace emulation target =20 =20 +Adding checks +------------- + +New checks should be added to Meson. Compiler checks can be as simple as +the following:: + + config_host_data.set('HAVE_BTRFS_H', cc.has_header('linux/btrfs.h')) + +A more complex task such as adding a new dependency usually +comprises the following tasks: + + - Add a Meson build option to meson_options.txt. + + - Add code to perform the actual feature check. + + - Add code to include the feature status in `config-host.h` + + - Add code to print out the feature status in the configure summary + upon completion. + +Taking the probe for SDL2_Image as an example, we have the following +in ``meson_options.txt``:: + + option('sdl_image', type : 'feature', value : 'auto', + description: 'SDL Image support for icons') + +Unless the option was given a non-``auto`` value (on the configure +command line), the detection code must be performed only if the +dependency will be used:: + + sdl_image =3D not_found + if not get_option('sdl_image').auto() or have_system + sdl_image =3D dependency('SDL2_image', required: get_option('sdl_image= '), + method: 'pkg-config', + static: enable_static) + endif + +This avoids warnings on static builds of user-mode emulators, for example. +Most of the libraries used by system-mode emulators are not available for +static linking. + +The other supporting code is generally simple:: + + # Create config-host.h (if applicable) + config_host_data.set('CONFIG_SDL_IMAGE', sdl_image.found()) + + # Summary + summary_info +=3D {'SDL image support': sdl_image.found()} + +For the configure script to parse the new option, the +``scripts/meson-buildoptions.sh`` file must be up-to-date; ``make +update-buildoptions`` (or just `make`) will take care of updating it. + + Support scripts --------------- =20 diff --git a/meson_options.txt b/meson_options.txt index 5a140af7f7..4ab4570125 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,3 +1,7 @@ +# These options do not correspond to a --enable/--disable-* option +# on the configure script command line. If you add more, list them in +# scripts/meson-buildoptions.py's SKIP_OPTIONS constant too. + option('qemu_suffix', type : 'string', value: 'qemu', description: 'Suffix for QEMU data/modules/config directories (can = be empty)') option('docdir', type : 'string', value : 'doc', @@ -16,6 +20,10 @@ option('fuzzing_engine', type : 'string', value : '', option('trace_file', type: 'string', value: 'trace', description: 'Trace file prefix for simple backend') =20 +# Everything else can be set via --enable/--disable-* option +# on the configure script command line. After adding an option +# here make sure to run "make update-buildoptions". + option('docs', type : 'feature', value : 'auto', description: 'Documentations build support') option('fuzzing', type : 'boolean', value: false, diff --git a/scripts/meson-buildoptions.py b/scripts/meson-buildoptions.py index d48af99aaf..256523c09d 100755 --- a/scripts/meson-buildoptions.py +++ b/scripts/meson-buildoptions.py @@ -25,10 +25,71 @@ import shlex import sys =20 +SKIP_OPTIONS =3D { + "audio_drv_list", + "default_devices", + "docdir", + "fuzzing_engine", + "qemu_firmwarepath", + "qemu_suffix", + "sphinx_build", + "trace_file", +} + +LINE_WIDTH =3D 76 + + +# Convert the default value of an option to the string used in +# the help message +def value_to_help(value): + if isinstance(value, list): + return ",".join(value) + if isinstance(value, bool): + return "enabled" if value else "disabled" + return str(value) + + +def wrap(left, text, indent): + spaces =3D " " * indent + if len(left) >=3D indent: + yield left + left =3D spaces + else: + left =3D (left + spaces)[0:indent] + yield from textwrap.wrap( + text, width=3DLINE_WIDTH, initial_indent=3Dleft, subsequent_indent= =3Dspaces + ) + + def sh_print(line=3D""): print(' printf "%s\\n"', shlex.quote(line)) =20 =20 +def help_line(left, opt, indent, long): + right =3D f'{opt["description"]}' + if long: + value =3D value_to_help(opt["value"]) + if value !=3D "auto": + right +=3D f" [{value}]" + if "choices" in opt and long: + choices =3D "/".join(sorted(opt["choices"])) + right +=3D f" (choices: {choices})" + for x in wrap(" " + left, right, indent): + sh_print(x) + + +# Return whether the option (a dictionary) can be used with +# arguments. Booleans can never be used with arguments; +# combos allow an argument only if they accept other values +# than "auto", "enabled", and "disabled". +def allow_arg(opt): + if opt["type"] =3D=3D "boolean": + return False + if opt["type"] !=3D "combo": + return True + return not (set(opt["choices"]) <=3D {"auto", "disabled", "enabled"}) + + def load_options(json): json =3D [ x @@ -42,17 +103,48 @@ def load_options(json): =20 def print_help(options): print("meson_options_help() {") + for opt in options: + key =3D opt["name"].replace("_", "-") + # The first section includes options that have an arguments, + # and booleans (i.e., only one of enable/disable makes sense) + if opt["type"] =3D=3D "boolean": + left =3D f"--disable-{key}" if opt["value"] else f"--enable-{k= ey}" + help_line(left, opt, 27, False) + elif allow_arg(opt): + if opt["type"] =3D=3D "combo" and "enabled" in opt["choices"]: + left =3D f"--enable-{key}[=3DCHOICE]" + else: + left =3D f"--enable-{key}=3DCHOICE" + help_line(left, opt, 27, True) + sh_print() sh_print("Optional features, enabled with --enable-FEATURE and") sh_print("disabled with --disable-FEATURE, default is enabled if avail= able") sh_print("(unless built with --without-default-features):") sh_print() + for opt in options: + key =3D opt["name"].replace("_", "-") + if opt["type"] !=3D "boolean" and not allow_arg(opt): + help_line(key, opt, 18, False) print("}") =20 =20 def print_parse(options): print("_meson_option_parse() {") print(" case $1 in") + for opt in options: + key =3D opt["name"].replace("_", "-") + name =3D opt["name"] + if opt["type"] =3D=3D "boolean": + print(f' --enable-{key}) printf "%s" -D{name}=3Dtrue ;;') + print(f' --disable-{key}) printf "%s" -D{name}=3Dfalse ;;') + else: + if opt["type"] =3D=3D "combo" and "enabled" in opt["choices"]: + print(f' --enable-{key}) printf "%s" -D{name}=3Denabled= ;;') + if opt["type"] =3D=3D "combo" and "disabled" in opt["choices"]: + print(f' --disable-{key}) printf "%s" -D{name}=3Ddisabl= ed ;;') + if allow_arg(opt): + print(f' --enable-{key}=3D*) quote_sh "-D{name}=3D$2" ;= ;') print(" *) return 1 ;;") print(" esac") print("}") diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh index c8ae205601..c795a13020 100644 --- a/scripts/meson-buildoptions.sh +++ b/scripts/meson-buildoptions.sh @@ -1,13 +1,270 @@ # This file is generated by meson-buildoptions.py, do not edit! meson_options_help() { + printf "%s\n" ' --enable-capstone[=3DCHOICE]' + printf "%s\n" ' Whether and how to find the ca= pstone library' + printf "%s\n" ' (choices: auto/disabled/enable= d/internal/system)' + printf "%s\n" ' --enable-cfi Control-Flow Integrity (CFI)' + printf "%s\n" ' --enable-cfi-debug Verbose errors in case of CFI = violation' + printf "%s\n" ' --enable-fdt[=3DCHOICE] Whether and how to find the = libfdt library' + printf "%s\n" ' (choices: auto/disabled/enable= d/internal/system)' + printf "%s\n" ' --enable-fuzzing build fuzzing targets' + printf "%s\n" ' --disable-install-blobs install provided firmware blob= s' + printf "%s\n" ' --enable-malloc=3DCHOICE choose memory allocator to u= se [system] (choices:' + printf "%s\n" ' jemalloc/system/tcmalloc)' + printf "%s\n" ' --enable-slirp[=3DCHOICE] Whether and how to find the = slirp library' + printf "%s\n" ' (choices: auto/disabled/enable= d/internal/system)' + printf "%s\n" ' --enable-tcg-interpreter TCG with bytecode interpreter = (experimental and' + printf "%s\n" ' slow)' + printf "%s\n" ' --enable-trace-backends=3DCHOICE' + printf "%s\n" ' Set available tracing backends= [log] (choices:' + printf "%s\n" ' dtrace/ftrace/log/nop/simple/s= yslog/ust)' printf "%s\n" '' printf "%s\n" 'Optional features, enabled with --enable-FEATURE and' printf "%s\n" 'disabled with --disable-FEATURE, default is enabled if av= ailable' printf "%s\n" '(unless built with --without-default-features):' printf "%s\n" '' + printf "%s\n" ' alsa ALSA sound support' + printf "%s\n" ' attr attr/xattr support' + printf "%s\n" ' auth-pam PAM access control' + printf "%s\n" ' bpf eBPF support' + printf "%s\n" ' brlapi brlapi character device driver' + printf "%s\n" ' bzip2 bzip2 support for DMG images' + printf "%s\n" ' cap-ng cap_ng support' + printf "%s\n" ' cocoa Cocoa user interface (macOS only)' + printf "%s\n" ' coreaudio CoreAudio sound support' + printf "%s\n" ' curl CURL block device driver' + printf "%s\n" ' curses curses UI' + printf "%s\n" ' docs Documentations build support' + printf "%s\n" ' dsound DirectSound sound support' + printf "%s\n" ' fuse FUSE block device export' + printf "%s\n" ' fuse-lseek SEEK_HOLE/SEEK_DATA support for FUSE ex= ports' + printf "%s\n" ' gcrypt libgcrypt cryptography support' + printf "%s\n" ' gettext Localization of the GTK+ user interface' + printf "%s\n" ' glusterfs Glusterfs block device driver' + printf "%s\n" ' gnutls GNUTLS cryptography support' + printf "%s\n" ' gtk GTK+ user interface' + printf "%s\n" ' guest-agent-msi Build MSI package for the QEMU Guest Ag= ent' + printf "%s\n" ' hax HAX acceleration support' + printf "%s\n" ' hvf HVF acceleration support' + printf "%s\n" ' iconv Font glyph conversion support' + printf "%s\n" ' jack JACK sound support' + printf "%s\n" ' kvm KVM acceleration support' + printf "%s\n" ' libdaxctl libdaxctl support' + printf "%s\n" ' libiscsi libiscsi userspace initiator' + printf "%s\n" ' libnfs libnfs block device driver' + printf "%s\n" ' libpmem libpmem support' + printf "%s\n" ' libudev Use libudev to enumerate host devices' + printf "%s\n" ' libusb libusb support for USB passthrough' + printf "%s\n" ' libxml2 libxml2 support for Parallels image for= mat' + printf "%s\n" ' linux-aio Linux AIO support' + printf "%s\n" ' linux-io-uring Linux io_uring support' + printf "%s\n" ' lzfse lzfse support for DMG images' + printf "%s\n" ' lzo lzo compression support' + printf "%s\n" ' malloc-trim enable libc malloc_trim() for memory op= timization' + printf "%s\n" ' mpath Multipath persistent reservation passth= rough' + printf "%s\n" ' multiprocess Out of process device emulation support' + printf "%s\n" ' netmap netmap network backend support' + printf "%s\n" ' nettle nettle cryptography support' + printf "%s\n" ' nvmm NVMM acceleration support' + printf "%s\n" ' oss OSS sound support' + printf "%s\n" ' pa PulseAudio sound support' + printf "%s\n" ' rbd Ceph block device driver' + printf "%s\n" ' sdl SDL user interface' + printf "%s\n" ' sdl-image SDL Image support for icons' + printf "%s\n" ' seccomp seccomp support' + printf "%s\n" ' smartcard CA smartcard emulation support' + printf "%s\n" ' snappy snappy compression support' + printf "%s\n" ' sparse sparse checker' + printf "%s\n" ' spice Spice server support' + printf "%s\n" ' spice-protocol Spice protocol support' + printf "%s\n" ' tcg TCG support' + printf "%s\n" ' u2f U2F emulation support' + printf "%s\n" ' usb-redir libusbredir support' + printf "%s\n" ' vde vde network backend support' + printf "%s\n" ' vhost-user-blk-server' + printf "%s\n" ' build vhost-user-blk server' + printf "%s\n" ' virglrenderer virgl rendering support' + printf "%s\n" ' virtfs virtio-9p support' + printf "%s\n" ' virtiofsd build virtiofs daemon (virtiofsd)' + printf "%s\n" ' vnc VNC server' + printf "%s\n" ' vnc-jpeg JPEG lossy compression for VNC server' + printf "%s\n" ' vnc-png PNG compression for VNC server' + printf "%s\n" ' vnc-sasl SASL authentication for VNC server' + printf "%s\n" ' vte vte support for the gtk UI' + printf "%s\n" ' whpx WHPX acceleration support' + printf "%s\n" ' xen Xen backend support' + printf "%s\n" ' xen-pci-passthrough' + printf "%s\n" ' Xen PCI passthrough support' + printf "%s\n" ' xkbcommon xkbcommon support' + printf "%s\n" ' zstd zstd compression support' } _meson_option_parse() { case $1 in + --enable-alsa) printf "%s" -Dalsa=3Denabled ;; + --disable-alsa) printf "%s" -Dalsa=3Ddisabled ;; + --enable-attr) printf "%s" -Dattr=3Denabled ;; + --disable-attr) printf "%s" -Dattr=3Ddisabled ;; + --enable-auth-pam) printf "%s" -Dauth_pam=3Denabled ;; + --disable-auth-pam) printf "%s" -Dauth_pam=3Ddisabled ;; + --enable-bpf) printf "%s" -Dbpf=3Denabled ;; + --disable-bpf) printf "%s" -Dbpf=3Ddisabled ;; + --enable-brlapi) printf "%s" -Dbrlapi=3Denabled ;; + --disable-brlapi) printf "%s" -Dbrlapi=3Ddisabled ;; + --enable-bzip2) printf "%s" -Dbzip2=3Denabled ;; + --disable-bzip2) printf "%s" -Dbzip2=3Ddisabled ;; + --enable-cap-ng) printf "%s" -Dcap_ng=3Denabled ;; + --disable-cap-ng) printf "%s" -Dcap_ng=3Ddisabled ;; + --enable-capstone) printf "%s" -Dcapstone=3Denabled ;; + --disable-capstone) printf "%s" -Dcapstone=3Ddisabled ;; + --enable-capstone=3D*) quote_sh "-Dcapstone=3D$2" ;; + --enable-cfi) printf "%s" -Dcfi=3Dtrue ;; + --disable-cfi) printf "%s" -Dcfi=3Dfalse ;; + --enable-cfi-debug) printf "%s" -Dcfi_debug=3Dtrue ;; + --disable-cfi-debug) printf "%s" -Dcfi_debug=3Dfalse ;; + --enable-cocoa) printf "%s" -Dcocoa=3Denabled ;; + --disable-cocoa) printf "%s" -Dcocoa=3Ddisabled ;; + --enable-coreaudio) printf "%s" -Dcoreaudio=3Denabled ;; + --disable-coreaudio) printf "%s" -Dcoreaudio=3Ddisabled ;; + --enable-curl) printf "%s" -Dcurl=3Denabled ;; + --disable-curl) printf "%s" -Dcurl=3Ddisabled ;; + --enable-curses) printf "%s" -Dcurses=3Denabled ;; + --disable-curses) printf "%s" -Dcurses=3Ddisabled ;; + --enable-docs) printf "%s" -Ddocs=3Denabled ;; + --disable-docs) printf "%s" -Ddocs=3Ddisabled ;; + --enable-dsound) printf "%s" -Ddsound=3Denabled ;; + --disable-dsound) printf "%s" -Ddsound=3Ddisabled ;; + --enable-fdt) printf "%s" -Dfdt=3Denabled ;; + --disable-fdt) printf "%s" -Dfdt=3Ddisabled ;; + --enable-fdt=3D*) quote_sh "-Dfdt=3D$2" ;; + --enable-fuse) printf "%s" -Dfuse=3Denabled ;; + --disable-fuse) printf "%s" -Dfuse=3Ddisabled ;; + --enable-fuse-lseek) printf "%s" -Dfuse_lseek=3Denabled ;; + --disable-fuse-lseek) printf "%s" -Dfuse_lseek=3Ddisabled ;; + --enable-fuzzing) printf "%s" -Dfuzzing=3Dtrue ;; + --disable-fuzzing) printf "%s" -Dfuzzing=3Dfalse ;; + --enable-gcrypt) printf "%s" -Dgcrypt=3Denabled ;; + --disable-gcrypt) printf "%s" -Dgcrypt=3Ddisabled ;; + --enable-gettext) printf "%s" -Dgettext=3Denabled ;; + --disable-gettext) printf "%s" -Dgettext=3Ddisabled ;; + --enable-glusterfs) printf "%s" -Dglusterfs=3Denabled ;; + --disable-glusterfs) printf "%s" -Dglusterfs=3Ddisabled ;; + --enable-gnutls) printf "%s" -Dgnutls=3Denabled ;; + --disable-gnutls) printf "%s" -Dgnutls=3Ddisabled ;; + --enable-gtk) printf "%s" -Dgtk=3Denabled ;; + --disable-gtk) printf "%s" -Dgtk=3Ddisabled ;; + --enable-guest-agent-msi) printf "%s" -Dguest_agent_msi=3Denabled ;; + --disable-guest-agent-msi) printf "%s" -Dguest_agent_msi=3Ddisabled ;; + --enable-hax) printf "%s" -Dhax=3Denabled ;; + --disable-hax) printf "%s" -Dhax=3Ddisabled ;; + --enable-hvf) printf "%s" -Dhvf=3Denabled ;; + --disable-hvf) printf "%s" -Dhvf=3Ddisabled ;; + --enable-iconv) printf "%s" -Diconv=3Denabled ;; + --disable-iconv) printf "%s" -Diconv=3Ddisabled ;; + --enable-install-blobs) printf "%s" -Dinstall_blobs=3Dtrue ;; + --disable-install-blobs) printf "%s" -Dinstall_blobs=3Dfalse ;; + --enable-jack) printf "%s" -Djack=3Denabled ;; + --disable-jack) printf "%s" -Djack=3Ddisabled ;; + --enable-kvm) printf "%s" -Dkvm=3Denabled ;; + --disable-kvm) printf "%s" -Dkvm=3Ddisabled ;; + --enable-libdaxctl) printf "%s" -Dlibdaxctl=3Denabled ;; + --disable-libdaxctl) printf "%s" -Dlibdaxctl=3Ddisabled ;; + --enable-libiscsi) printf "%s" -Dlibiscsi=3Denabled ;; + --disable-libiscsi) printf "%s" -Dlibiscsi=3Ddisabled ;; + --enable-libnfs) printf "%s" -Dlibnfs=3Denabled ;; + --disable-libnfs) printf "%s" -Dlibnfs=3Ddisabled ;; + --enable-libpmem) printf "%s" -Dlibpmem=3Denabled ;; + --disable-libpmem) printf "%s" -Dlibpmem=3Ddisabled ;; + --enable-libudev) printf "%s" -Dlibudev=3Denabled ;; + --disable-libudev) printf "%s" -Dlibudev=3Ddisabled ;; + --enable-libusb) printf "%s" -Dlibusb=3Denabled ;; + --disable-libusb) printf "%s" -Dlibusb=3Ddisabled ;; + --enable-libxml2) printf "%s" -Dlibxml2=3Denabled ;; + --disable-libxml2) printf "%s" -Dlibxml2=3Ddisabled ;; + --enable-linux-aio) printf "%s" -Dlinux_aio=3Denabled ;; + --disable-linux-aio) printf "%s" -Dlinux_aio=3Ddisabled ;; + --enable-linux-io-uring) printf "%s" -Dlinux_io_uring=3Denabled ;; + --disable-linux-io-uring) printf "%s" -Dlinux_io_uring=3Ddisabled ;; + --enable-lzfse) printf "%s" -Dlzfse=3Denabled ;; + --disable-lzfse) printf "%s" -Dlzfse=3Ddisabled ;; + --enable-lzo) printf "%s" -Dlzo=3Denabled ;; + --disable-lzo) printf "%s" -Dlzo=3Ddisabled ;; + --enable-malloc=3D*) quote_sh "-Dmalloc=3D$2" ;; + --enable-malloc-trim) printf "%s" -Dmalloc_trim=3Denabled ;; + --disable-malloc-trim) printf "%s" -Dmalloc_trim=3Ddisabled ;; + --enable-mpath) printf "%s" -Dmpath=3Denabled ;; + --disable-mpath) printf "%s" -Dmpath=3Ddisabled ;; + --enable-multiprocess) printf "%s" -Dmultiprocess=3Denabled ;; + --disable-multiprocess) printf "%s" -Dmultiprocess=3Ddisabled ;; + --enable-netmap) printf "%s" -Dnetmap=3Denabled ;; + --disable-netmap) printf "%s" -Dnetmap=3Ddisabled ;; + --enable-nettle) printf "%s" -Dnettle=3Denabled ;; + --disable-nettle) printf "%s" -Dnettle=3Ddisabled ;; + --enable-nvmm) printf "%s" -Dnvmm=3Denabled ;; + --disable-nvmm) printf "%s" -Dnvmm=3Ddisabled ;; + --enable-oss) printf "%s" -Doss=3Denabled ;; + --disable-oss) printf "%s" -Doss=3Ddisabled ;; + --enable-pa) printf "%s" -Dpa=3Denabled ;; + --disable-pa) printf "%s" -Dpa=3Ddisabled ;; + --enable-rbd) printf "%s" -Drbd=3Denabled ;; + --disable-rbd) printf "%s" -Drbd=3Ddisabled ;; + --enable-sdl) printf "%s" -Dsdl=3Denabled ;; + --disable-sdl) printf "%s" -Dsdl=3Ddisabled ;; + --enable-sdl-image) printf "%s" -Dsdl_image=3Denabled ;; + --disable-sdl-image) printf "%s" -Dsdl_image=3Ddisabled ;; + --enable-seccomp) printf "%s" -Dseccomp=3Denabled ;; + --disable-seccomp) printf "%s" -Dseccomp=3Ddisabled ;; + --enable-slirp) printf "%s" -Dslirp=3Denabled ;; + --disable-slirp) printf "%s" -Dslirp=3Ddisabled ;; + --enable-slirp=3D*) quote_sh "-Dslirp=3D$2" ;; + --enable-smartcard) printf "%s" -Dsmartcard=3Denabled ;; + --disable-smartcard) printf "%s" -Dsmartcard=3Ddisabled ;; + --enable-snappy) printf "%s" -Dsnappy=3Denabled ;; + --disable-snappy) printf "%s" -Dsnappy=3Ddisabled ;; + --enable-sparse) printf "%s" -Dsparse=3Denabled ;; + --disable-sparse) printf "%s" -Dsparse=3Ddisabled ;; + --enable-spice) printf "%s" -Dspice=3Denabled ;; + --disable-spice) printf "%s" -Dspice=3Ddisabled ;; + --enable-spice-protocol) printf "%s" -Dspice_protocol=3Denabled ;; + --disable-spice-protocol) printf "%s" -Dspice_protocol=3Ddisabled ;; + --enable-tcg) printf "%s" -Dtcg=3Denabled ;; + --disable-tcg) printf "%s" -Dtcg=3Ddisabled ;; + --enable-tcg-interpreter) printf "%s" -Dtcg_interpreter=3Dtrue ;; + --disable-tcg-interpreter) printf "%s" -Dtcg_interpreter=3Dfalse ;; + --enable-trace-backends=3D*) quote_sh "-Dtrace_backends=3D$2" ;; + --enable-u2f) printf "%s" -Du2f=3Denabled ;; + --disable-u2f) printf "%s" -Du2f=3Ddisabled ;; + --enable-usb-redir) printf "%s" -Dusb_redir=3Denabled ;; + --disable-usb-redir) printf "%s" -Dusb_redir=3Ddisabled ;; + --enable-vde) printf "%s" -Dvde=3Denabled ;; + --disable-vde) printf "%s" -Dvde=3Ddisabled ;; + --enable-vhost-user-blk-server) printf "%s" -Dvhost_user_blk_server=3D= enabled ;; + --disable-vhost-user-blk-server) printf "%s" -Dvhost_user_blk_server= =3Ddisabled ;; + --enable-virglrenderer) printf "%s" -Dvirglrenderer=3Denabled ;; + --disable-virglrenderer) printf "%s" -Dvirglrenderer=3Ddisabled ;; + --enable-virtfs) printf "%s" -Dvirtfs=3Denabled ;; + --disable-virtfs) printf "%s" -Dvirtfs=3Ddisabled ;; + --enable-virtiofsd) printf "%s" -Dvirtiofsd=3Denabled ;; + --disable-virtiofsd) printf "%s" -Dvirtiofsd=3Ddisabled ;; + --enable-vnc) printf "%s" -Dvnc=3Denabled ;; + --disable-vnc) printf "%s" -Dvnc=3Ddisabled ;; + --enable-vnc-jpeg) printf "%s" -Dvnc_jpeg=3Denabled ;; + --disable-vnc-jpeg) printf "%s" -Dvnc_jpeg=3Ddisabled ;; + --enable-vnc-png) printf "%s" -Dvnc_png=3Denabled ;; + --disable-vnc-png) printf "%s" -Dvnc_png=3Ddisabled ;; + --enable-vnc-sasl) printf "%s" -Dvnc_sasl=3Denabled ;; + --disable-vnc-sasl) printf "%s" -Dvnc_sasl=3Ddisabled ;; + --enable-vte) printf "%s" -Dvte=3Denabled ;; + --disable-vte) printf "%s" -Dvte=3Ddisabled ;; + --enable-whpx) printf "%s" -Dwhpx=3Denabled ;; + --disable-whpx) printf "%s" -Dwhpx=3Ddisabled ;; + --enable-xen) printf "%s" -Dxen=3Denabled ;; + --disable-xen) printf "%s" -Dxen=3Ddisabled ;; + --enable-xen-pci-passthrough) printf "%s" -Dxen_pci_passthrough=3Denab= led ;; + --disable-xen-pci-passthrough) printf "%s" -Dxen_pci_passthrough=3Ddis= abled ;; + --enable-xkbcommon) printf "%s" -Dxkbcommon=3Denabled ;; + --disable-xkbcommon) printf "%s" -Dxkbcommon=3Ddisabled ;; + --enable-zstd) printf "%s" -Dzstd=3Denabled ;; + --disable-zstd) printf "%s" -Dzstd=3Ddisabled ;; *) return 1 ;; esac } --=20 2.31.1