From nobody Wed Nov 27 00:24:08 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=1703179372; cv=none; d=zohomail.com; s=zohoarc; b=fFdu1De+CRw5ppVgmAZpTF4PvrqulKeZLNngtFcRPhvkBpWwbTybE5d4/lXCXc7Hwl0Br5H0nVv802yKDgojFLa35GvTswI5W49lxD/BW8JYm7Y6FbRxYLmnFogfmpXTOc8fgQV2Sy9PeH9tRZVXgqgr7B+gjo7ummDlfI1WzWc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1703179372; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=aC+zFBXfg2XfUMrGRAwKHIKbBC2VYBZ5admwocdXPY8=; b=NbgkzbPs1vu5sJz9O1242V/bjic7PCqNEY0vqoZHau40gZdXJZSKZwOcA5gZPbAVgpSwYK61PuQEWNJjiGhT+dBFlCGWuemxBm0JicZfHHRvU/wQub6k+emY6yVjJBuCqY3BvXEd2unWgsCwQ/AE6V/1rB32yHAq7ShRThStBks= 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 1703179372466734.5671525912304; Thu, 21 Dec 2023 09:22:52 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rGMip-0007cr-Pc; Thu, 21 Dec 2023 12:20:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rGMio-0007cU-2X for qemu-devel@nongnu.org; Thu, 21 Dec 2023 12:20:34 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rGMim-0004YL-Jc for qemu-devel@nongnu.org; Thu, 21 Dec 2023 12:20:33 -0500 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-600-Cws0quYCO6G0aoH4SCM5uA-1; Thu, 21 Dec 2023 12:20:30 -0500 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-40c4297e070so7313645e9.3 for ; Thu, 21 Dec 2023 09:20:30 -0800 (PST) Received: from [192.168.10.118] ([2001:b07:6468:f312:4783:a68:c1ee:15c5]) by smtp.gmail.com with ESMTPSA id bh20-20020a05600c3d1400b0040d15dcb77asm11834336wmb.23.2023.12.21.09.20.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 09:20:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1703179232; 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=aC+zFBXfg2XfUMrGRAwKHIKbBC2VYBZ5admwocdXPY8=; b=LYXlHYRSrABFmYRbiFG2XlMBMj0rQUTebAFrYJX6qd7MvFEQHodh2TDN993ccYs0tP4PCg +A/7e1cBp0V9hDmmS6NKDeCtJs9mLzmJah+BfJJtNQSgKt+C/u1MA2y2nOf7JflCQRBOyt 51rin6k5hqT0L4HJqccbEkzLK926UVk= X-MC-Unique: Cws0quYCO6G0aoH4SCM5uA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703179229; x=1703784029; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aC+zFBXfg2XfUMrGRAwKHIKbBC2VYBZ5admwocdXPY8=; b=gVJ28hkdsU60Wzh2AEDxoBxBw9VfmNyj3z3/k8tmo9jM+Pn9C+tTsb70zT61OilIWT cevdF+6jnHV9oqzqFNKkxuBYnWA7HmHjwxXznNasodVe/QxP20m44CeZwRve1PFQnOEd G7ppOyMR2JHAtx9u/bVXUsOlLNXv7CEmTMEVVUgl1Chrx3O0ebTqJmABin/ow7EUbAyQ SsakfecAR4OCV9kWeWp4+IdPf/onBDL3dg79y3rsYUXmzdn7FfMDTGsQeoWE/oVnzEbT R5X3UtlUBvv5GomLFbMgpvgIYnhNYYvtMF/6epq5B5bD7cgRRGJTzzd5xR2TmvhHIWTr +1Xg== X-Gm-Message-State: AOJu0YwBYYI09uiDrRfjBAgXgWRJbC/lb4658haDhYDw6ukmUlygWB5I oILmcf5MPsMoUYwepKrBROTvF5o3RottZS7kEDPPpBWEYMar+f5+Zb37OU5wyo+EhwgSDnH1L3I EB9sGnaRFGUvGmeOUklVj2a8TRavUiy0Mjaee5zk0Cjzh6sar/LyBqSwQS8Fnj/gKpWATqgvOEp +1viPjREo= X-Received: by 2002:a05:600c:4f41:b0:40c:32f2:a302 with SMTP id m1-20020a05600c4f4100b0040c32f2a302mr25285wmq.94.1703179228965; Thu, 21 Dec 2023 09:20:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IGlZO6QrfiDWLpFRvV7NnBDz2RfpWCdV83LW/JrEFpfh7Z8PY6aYlN+kkaBtH8EzVrD54dsMg== X-Received: by 2002:a05:600c:4f41:b0:40c:32f2:a302 with SMTP id m1-20020a05600c4f4100b0040c32f2a302mr25280wmq.94.1703179228645; Thu, 21 Dec 2023 09:20:28 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 15/21] meson: move option validation a bit closer Date: Thu, 21 Dec 2023 18:19:52 +0100 Message-ID: <20231221171958.59350-16-pbonzini@redhat.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221171958.59350-1-pbonzini@redhat.com> References: <20231221171958.59350-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=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.061, 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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1703179373931100003 Content-Type: text/plain; charset="utf-8" Not entirely possible for option that depend on compiler or dependency chec= ks, but it's a start. Signed-off-by: Paolo Bonzini --- meson.build | 52 ++++++++++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/meson.build b/meson.build index 1a1e006ba13..f7e7deeabdc 100644 --- a/meson.build +++ b/meson.build @@ -52,30 +52,6 @@ supported_cpus =3D ['ppc', 'ppc64', 's390x', 'riscv32', = 'riscv64', 'x86', 'x86_64' cpu =3D host_machine.cpu_family() =20 target_dirs =3D config_host['TARGET_DIRS'].split() -have_linux_user =3D false -have_bsd_user =3D false -have_system =3D false -foreach target : target_dirs - have_linux_user =3D have_linux_user or target.endswith('linux-user') - have_bsd_user =3D have_bsd_user or target.endswith('bsd-user') - have_system =3D have_system or target.endswith('-softmmu') -endforeach -have_user =3D have_linux_user or have_bsd_user -have_tools =3D get_option('tools') \ - .disable_auto_if(not have_system) \ - .allowed() -have_ga =3D get_option('guest_agent') \ - .disable_auto_if(not have_system and not have_tools) \ - .require(targetos in ['sunos', 'linux', 'windows', 'freebsd', 'netbsd', = 'openbsd'], - error_message: 'unsupported OS for QEMU guest agent') \ - .allowed() -enable_modules =3D get_option('modules') \ - .require(targetos !=3D 'windows', - error_message: 'Modules are not available for Windows') \ - .require(not get_option('prefer_static'), - error_message: 'Modules are incompatible with static linking') \ - .allowed() -have_block =3D have_system or have_tools =20 ############ # Programs # @@ -576,6 +552,34 @@ have_tpm =3D get_option('tpm') \ .require(targetos !=3D 'windows', error_message: 'TPM emulation only ava= ilable on POSIX systems') \ .allowed() =20 +# type of binaries to build +have_linux_user =3D false +have_bsd_user =3D false +have_system =3D false +foreach target : target_dirs + have_linux_user =3D have_linux_user or target.endswith('linux-user') + have_bsd_user =3D have_bsd_user or target.endswith('bsd-user') + have_system =3D have_system or target.endswith('-softmmu') +endforeach +have_user =3D have_linux_user or have_bsd_user + +have_tools =3D get_option('tools') \ + .disable_auto_if(not have_system) \ + .allowed() +have_ga =3D get_option('guest_agent') \ + .disable_auto_if(not have_system and not have_tools) \ + .require(targetos in ['sunos', 'linux', 'windows', 'freebsd', 'netbsd', = 'openbsd'], + error_message: 'unsupported OS for QEMU guest agent') \ + .allowed() + +have_block =3D have_system or have_tools +enable_modules =3D get_option('modules') \ + .require(targetos !=3D 'windows', + error_message: 'Modules are not available for Windows') \ + .require(not get_option('prefer_static'), + error_message: 'Modules are incompatible with static linking') \ + .allowed() + # vhost have_vhost_user =3D get_option('vhost_user') \ .disable_auto_if(targetos !=3D 'linux') \ --=20 2.43.0