From nobody Wed Nov 27 00:40:47 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=1703179315; cv=none; d=zohomail.com; s=zohoarc; b=jG45Nnz4y75P2J01hJR8BneY/6Cxh12GqEBLY5oc3YP5eHINXlKdofA7UFvYFc1dbd/2rOQSxPbeZHYYZPQiTV2Go1Y4TvGZ+wNwHQmdrN9vz6vSKcGSlJvAxCUFDZJ9LQL4ARK6ZKBXWGYGhXUr+rBYN+QqYAPbK+q8VnaVCog= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1703179315; 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=kWX1izeVukWi7Nfv8LDo3lFb0JpfVrIp/K6uYQjHhN0=; b=awsJ56Fr2nyTHZtfFsxeklpoZuGiI6eBs3GUfDfOfK/8nfvq/24RlMNhbxopuXyFhnhATdxEPSvOFvelexCjxkJLH5aHT8en7CyjwIpASltZdoWBo1w/OBx/Z7m+L78noKQUbON8R7AlRL17Gpgtv/egkHihJz2kd0JCWHVRlwo= 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 1703179315932848.5807449899161; Thu, 21 Dec 2023 09:21:55 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rGMie-0007Zs-KB; Thu, 21 Dec 2023 12:20:24 -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 1rGMid-0007Zi-Ve for qemu-devel@nongnu.org; Thu, 21 Dec 2023 12:20:23 -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 1rGMic-0004Uv-08 for qemu-devel@nongnu.org; Thu, 21 Dec 2023 12:20:23 -0500 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-348-MeJzScT_PPCiFME36pyhWw-1; Thu, 21 Dec 2023 12:20:19 -0500 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-3368250f2a3so664078f8f.3 for ; Thu, 21 Dec 2023 09:20:19 -0800 (PST) Received: from [192.168.10.118] ([2001:b07:6468:f312:4783:a68:c1ee:15c5]) by smtp.gmail.com with ESMTPSA id c18-20020a5d4f12000000b00336788c812fsm2455678wru.88.2023.12.21.09.20.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 09:20:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1703179221; 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=kWX1izeVukWi7Nfv8LDo3lFb0JpfVrIp/K6uYQjHhN0=; b=eMB4BlirkE0pHZ1+Wn7lssVnl4D07W0T4HTffKb/UIRvJjU35vx+utkHfcoEqra/RkHZgi PTGlNww3bP/GcHqZV6P3+Bbu76fWYaR5diUsNeJZ/GKeApu/6A+O56uIo7vcZCHJHHp5Gm Ot1K7FQH1IEMmxmlwmNlFcq6WTc4O/U= X-MC-Unique: MeJzScT_PPCiFME36pyhWw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703179217; x=1703784017; 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=kWX1izeVukWi7Nfv8LDo3lFb0JpfVrIp/K6uYQjHhN0=; b=cMif+rOxm8NfaVu/s5a3nlImtYVVpIcR+VcXj2uiNcvTgNFCIN0kjSRtthjxwYliYI vAw6Yg545Oh56x+ofX7ZTxMzDWn/eLXQaWHE9cQRFKIQ3CsDnmfJFYv5PxzAPlAq9j1O RwTUw/v7umUK/tMExod9yHtOUjM9AaFaaa7WsTdspVNOvMY0wpLTNoJhi2rf4VLSsygz eNlaGcBI1ifxoIFn8V6mzta3Ip0akjVCEH4LCSHTObUB2i5sC7p+QRRwmraEWcNaM/Em 4GB8PmsbSFACxNceNO9LqIvIIL5kubjx5dI/ePbuVOykiU1hJNWRTir58VAY9g4rWkW9 VUlA== X-Gm-Message-State: AOJu0Ywx+DpecFSPYWJyBOuyI1lJ5dp58sbJUpHgybHM1WQzBRGXEzma UQVv+dJ8+p0+tUCxmR+f6P4r2RfYFCLKzxNuIBoafPXtwj4hZ55ommwxZzpuQY0mYYT+p6jp+NQ QBE5dIcSd2jwao18pvFe/z8bO8Xy8Bf4/tPEVf5QQrl8TlQpH3BFoTyVZMgQijsSAcipbrTVXps gPPQZ/lOk= X-Received: by 2002:a5d:5692:0:b0:336:71a7:cdf with SMTP id f18-20020a5d5692000000b0033671a70cdfmr28699wrv.229.1703179217548; Thu, 21 Dec 2023 09:20:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IHVVs81izvpIuP/zeHPKruwEBPm76BIR9pXjOqjORH8U8Ert9dY4+xQm4I9tPTVKLS7sUaLnw== X-Received: by 2002:a5d:5692:0:b0:336:71a7:cdf with SMTP id f18-20020a5d5692000000b0033671a70cdfmr28695wrv.229.1703179217075; Thu, 21 Dec 2023 09:20:17 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 09/21] meson: remove CONFIG_POSIX and CONFIG_WIN32 from config_targetos Date: Thu, 21 Dec 2023 18:19:46 +0100 Message-ID: <20231221171958.59350-10-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: 1703179317731100002 Content-Type: text/plain; charset="utf-8" For consistency with other OSes, use if...endif for rules that are target-independent. Signed-off-by: Paolo Bonzini --- backends/meson.build | 6 ++++-- block/meson.build | 7 +++++-- chardev/meson.build | 26 ++++++++++++++------------ hw/usb/meson.build | 4 +++- meson.build | 11 ++++++----- qga/meson.build | 33 ++++++++++++++++++--------------- ui/meson.build | 8 ++++++-- util/meson.build | 44 +++++++++++++++++++++++--------------------- 8 files changed, 79 insertions(+), 60 deletions(-) diff --git a/backends/meson.build b/backends/meson.build index 248ce4923c6..6dee4e9203b 100644 --- a/backends/meson.build +++ b/backends/meson.build @@ -10,8 +10,10 @@ system_ss.add([files( 'confidential-guest-support.c', ), numa]) =20 -system_ss.add(when: 'CONFIG_POSIX', if_true: files('rng-random.c')) -system_ss.add(when: 'CONFIG_POSIX', if_true: files('hostmem-file.c')) +if targetos !=3D 'windows' + system_ss.add(files('rng-random.c')) + system_ss.add(files('hostmem-file.c')) +endif if targetos =3D=3D 'linux' system_ss.add(files('hostmem-memfd.c')) endif diff --git a/block/meson.build b/block/meson.build index 7faed96c1e7..ddea1e40070 100644 --- a/block/meson.build +++ b/block/meson.build @@ -88,8 +88,11 @@ if get_option('parallels').allowed() block_ss.add(files('parallels.c', 'parallels-ext.c')) endif =20 -block_ss.add(when: 'CONFIG_WIN32', if_true: files('file-win32.c', 'win32-a= io.c')) -block_ss.add(when: 'CONFIG_POSIX', if_true: [files('file-posix.c'), coref,= iokit]) +if targetos =3D=3D 'windows' + block_ss.add(files('file-win32.c', 'win32-aio.c')) +else + block_ss.add(files('file-posix.c'), coref, iokit) +endif block_ss.add(when: libiscsi, if_true: files('iscsi-opts.c')) if targetos =3D=3D 'linux' block_ss.add(files('nvme.c')) diff --git a/chardev/meson.build b/chardev/meson.build index 6d56ad32fdb..9564ace868b 100644 --- a/chardev/meson.build +++ b/chardev/meson.build @@ -12,20 +12,22 @@ chardev_ss.add(files( 'char-udp.c', 'char.c', )) -chardev_ss.add(when: 'CONFIG_POSIX', if_true: [files( - 'char-fd.c', - 'char-pty.c', -), util]) -if targetos in ['linux', 'gnu/kfreebsd', 'freebsd', 'dragonfly'] - chardev_ss.add(files('char-parallel.c')) +if targetos =3D=3D 'windows' + chardev_ss.add(files( + 'char-console.c', + 'char-win-stdio.c', + 'char-win.c', + )) +else + chardev_ss.add(files( + 'char-fd.c', + 'char-pty.c', + ), util) + if targetos in ['linux', 'gnu/kfreebsd', 'freebsd', 'dragonfly'] + chardev_ss.add(files('char-parallel.c')) + endif endif =20 -chardev_ss.add(when: 'CONFIG_WIN32', if_true: files( - 'char-console.c', - 'char-win-stdio.c', - 'char-win.c', -)) - chardev_ss =3D chardev_ss.apply(config_targetos, strict: false) =20 system_ss.add(files( diff --git a/hw/usb/meson.build b/hw/usb/meson.build index 4b44db39cd3..b7755b638fc 100644 --- a/hw/usb/meson.build +++ b/hw/usb/meson.build @@ -44,7 +44,9 @@ system_ss.add(when: 'CONFIG_USB_STORAGE_UAS', if_true: fi= les('dev-uas.c')) system_ss.add(when: 'CONFIG_USB_AUDIO', if_true: files('dev-audio.c')) system_ss.add(when: 'CONFIG_USB_SERIAL', if_true: files('dev-serial.c')) system_ss.add(when: 'CONFIG_USB_NETWORK', if_true: files('dev-network.c')) -system_ss.add(when: ['CONFIG_POSIX', 'CONFIG_USB_STORAGE_MTP'], if_true: f= iles('dev-mtp.c')) +if targetos !=3D 'windows' + system_ss.add(when: 'CONFIG_USB_STORAGE_MTP', if_true: files('dev-mtp.c'= )) +endif =20 # smartcard system_ss.add(when: 'CONFIG_USB_SMARTCARD', if_true: files('dev-smartcard-= reader.c')) diff --git a/meson.build b/meson.build index ac11adc6c13..0a0c68050e7 100644 --- a/meson.build +++ b/meson.build @@ -2840,9 +2840,7 @@ endif ######################## =20 minikconf =3D find_program('scripts/minikconf.py') -config_targetos =3D { - (targetos =3D=3D 'windows' ? 'CONFIG_WIN32' : 'CONFIG_POSIX'): 'y' -} +config_targetos =3D {} =20 config_all =3D {} config_all_devices =3D {} @@ -3456,8 +3454,11 @@ if have_block =20 # os-posix.c contains POSIX-specific functions used by qemu-storage-daem= on, # os-win32.c does not - blockdev_ss.add(when: 'CONFIG_POSIX', if_true: files('os-posix.c')) - system_ss.add(when: 'CONFIG_WIN32', if_true: [files('os-win32.c')]) + if targetos =3D=3D 'windows' + system_ss.add(files('os-win32.c')) + else + blockdev_ss.add(files('os-posix.c')) + endif endif =20 common_ss.add(files('cpu-common.c')) diff --git a/qga/meson.build b/qga/meson.build index 50edaf1c3d4..1113e7c7fae 100644 --- a/qga/meson.build +++ b/qga/meson.build @@ -67,22 +67,25 @@ qga_ss.add(files( 'main.c', 'cutils.c', )) -qga_ss.add(when: 'CONFIG_POSIX', if_true: files( - 'channel-posix.c', - 'commands-posix.c', - 'commands-posix-ssh.c', -)) -if targetos =3D=3D 'linux' - qga_ss.add(files('commands-linux.c')) -elif targetos in bsd_oses - qga_ss.add(files('commands-bsd.c')) +if targetos =3D=3D 'windows' + qga_ss.add(files( + 'channel-win32.c', + 'commands-win32.c', + 'service-win32.c', + 'vss-win32.c' + )) +else + qga_ss.add(files( + 'channel-posix.c', + 'commands-posix.c', + 'commands-posix-ssh.c', + )) + if targetos =3D=3D 'linux' + qga_ss.add(files('commands-linux.c')) + elif targetos in bsd_oses + qga_ss.add(files('commands-bsd.c')) + endif endif -qga_ss.add(when: 'CONFIG_WIN32', if_true: files( - 'channel-win32.c', - 'commands-win32.c', - 'service-win32.c', - 'vss-win32.c' -)) =20 qga_ss =3D qga_ss.apply(config_targetos, strict: false) =20 diff --git a/ui/meson.build b/ui/meson.build index 8379a788a1a..a370494c4ab 100644 --- a/ui/meson.build +++ b/ui/meson.build @@ -105,7 +105,9 @@ if dbus_display endif =20 if gtk.found() - system_ss.add(when: 'CONFIG_WIN32', if_true: files('win32-kbd-hook.c')) + if targetos =3D=3D 'windows' + system_ss.add(files('win32-kbd-hook.c')) + endif =20 gtk_ss =3D ss.source_set() gtk_ss.add(gtk, vte, pixman, files('gtk.c')) @@ -119,7 +121,9 @@ if gtk.found() endif =20 if sdl.found() - system_ss.add(when: 'CONFIG_WIN32', if_true: files('win32-kbd-hook.c')) + if targetos =3D=3D 'windows' + system_ss.add(files('win32-kbd-hook.c')) + endif =20 sdl_ss =3D ss.source_set() sdl_ss.add(sdl, sdl_image, pixman, glib, files( diff --git a/util/meson.build b/util/meson.build index 98dd7fa5340..4e970d2b488 100644 --- a/util/meson.build +++ b/util/meson.build @@ -3,28 +3,31 @@ util_ss.add(files('thread-context.c'), numa) if not config_host_data.get('CONFIG_ATOMIC64') util_ss.add(files('atomic64.c')) endif -util_ss.add(when: 'CONFIG_POSIX', if_true: files('aio-posix.c')) -util_ss.add(when: 'CONFIG_POSIX', if_true: files('fdmon-poll.c')) -if config_host_data.get('CONFIG_EPOLL_CREATE1') - util_ss.add(files('fdmon-epoll.c')) +if targetos !=3D 'windows' + util_ss.add(files('aio-posix.c')) + util_ss.add(files('fdmon-poll.c')) + if config_host_data.get('CONFIG_EPOLL_CREATE1') + util_ss.add(files('fdmon-epoll.c')) + endif + util_ss.add(files('compatfd.c')) + util_ss.add(files('event_notifier-posix.c')) + util_ss.add(files('mmap-alloc.c')) + freebsd_dep =3D [] + if targetos =3D=3D 'freebsd' + freebsd_dep =3D util + endif + util_ss.add(files('oslib-posix.c'), freebsd_dep) + util_ss.add(files('qemu-thread-posix.c')) + util_ss.add(files('memfd.c')) + util_ss.add(files('drm.c')) +else + util_ss.add(files('aio-win32.c')) + util_ss.add(files('event_notifier-win32.c')) + util_ss.add(files('oslib-win32.c')) + util_ss.add(files('qemu-thread-win32.c')) + util_ss.add(winmm, pathcch) endif util_ss.add(when: linux_io_uring, if_true: files('fdmon-io_uring.c')) -util_ss.add(when: 'CONFIG_POSIX', if_true: files('compatfd.c')) -util_ss.add(when: 'CONFIG_POSIX', if_true: files('event_notifier-posix.c')) -util_ss.add(when: 'CONFIG_POSIX', if_true: files('mmap-alloc.c')) -freebsd_dep =3D [] -if targetos =3D=3D 'freebsd' - freebsd_dep =3D util -endif -util_ss.add(when: 'CONFIG_POSIX', if_true: [files('oslib-posix.c'), freebs= d_dep]) -util_ss.add(when: 'CONFIG_POSIX', if_true: files('qemu-thread-posix.c')) -util_ss.add(when: 'CONFIG_POSIX', if_true: files('memfd.c')) -util_ss.add(when: 'CONFIG_WIN32', if_true: files('aio-win32.c')) -util_ss.add(when: 'CONFIG_WIN32', if_true: files('event_notifier-win32.c')) -util_ss.add(when: 'CONFIG_WIN32', if_true: files('oslib-win32.c')) -util_ss.add(when: 'CONFIG_WIN32', if_true: files('qemu-thread-win32.c')) -util_ss.add(when: 'CONFIG_WIN32', if_true: winmm) -util_ss.add(when: 'CONFIG_WIN32', if_true: pathcch) if glib_has_gslice util_ss.add(files('qtree.c')) endif @@ -56,7 +59,6 @@ util_ss.add(files('reserved-region.c')) util_ss.add(files('stats64.c')) util_ss.add(files('systemd.c')) util_ss.add(files('transactions.c')) -util_ss.add(when: 'CONFIG_POSIX', if_true: files('drm.c')) util_ss.add(files('guest-random.c')) util_ss.add(files('yank.c')) util_ss.add(files('int128.c')) --=20 2.43.0