From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: [PULL 40/46] meson: remove OS definitions from config_targetos
Date: Sun, 31 Dec 2023 09:44:56 +0100 [thread overview]
Message-ID: <20231231084502.235366-41-pbonzini@redhat.com> (raw)
In-Reply-To: <20231231084502.235366-1-pbonzini@redhat.com>
CONFIG_DARWIN, CONFIG_LINUX and CONFIG_BSD are used in some rules, but
only CONFIG_LINUX has substantial use. Convert them all to if...endif.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
accel/tcg/meson.build | 4 +++-
backends/meson.build | 4 +++-
block/meson.build | 4 +++-
fsdev/meson.build | 5 +++--
hw/9pfs/meson.build | 7 +++++--
hw/display/meson.build | 7 +++++--
hw/ppc/meson.build | 8 +++++---
hw/usb/meson.build | 4 +++-
meson.build | 8 --------
net/can/meson.build | 4 +++-
qga/meson.build | 11 +++++------
scsi/meson.build | 8 +++++---
system/meson.build | 4 +++-
ui/meson.build | 7 +++----
util/meson.build | 14 ++++++++------
15 files changed, 57 insertions(+), 42 deletions(-)
diff --git a/accel/tcg/meson.build b/accel/tcg/meson.build
index 8783edd06ee..1dad6bbbfbd 100644
--- a/accel/tcg/meson.build
+++ b/accel/tcg/meson.build
@@ -17,7 +17,9 @@ if get_option('plugins')
tcg_ss.add(files('plugin-gen.c'))
endif
tcg_ss.add(when: libdw, if_true: files('debuginfo.c'))
-tcg_ss.add(when: 'CONFIG_LINUX', if_true: files('perf.c'))
+if targetos == 'linux'
+ tcg_ss.add(files('perf.c'))
+endif
specific_ss.add_all(when: 'CONFIG_TCG', if_true: tcg_ss)
specific_ss.add(when: ['CONFIG_SYSTEM_ONLY', 'CONFIG_TCG'], if_true: files(
diff --git a/backends/meson.build b/backends/meson.build
index 9a5cea480d1..248ce4923c6 100644
--- a/backends/meson.build
+++ b/backends/meson.build
@@ -12,7 +12,9 @@ system_ss.add([files(
system_ss.add(when: 'CONFIG_POSIX', if_true: files('rng-random.c'))
system_ss.add(when: 'CONFIG_POSIX', if_true: files('hostmem-file.c'))
-system_ss.add(when: 'CONFIG_LINUX', if_true: files('hostmem-memfd.c'))
+if targetos == 'linux'
+ system_ss.add(files('hostmem-memfd.c'))
+endif
if keyutils.found()
system_ss.add(keyutils, files('cryptodev-lkcf.c'))
endif
diff --git a/block/meson.build b/block/meson.build
index 59ff6d380c0..7faed96c1e7 100644
--- a/block/meson.build
+++ b/block/meson.build
@@ -91,7 +91,9 @@ endif
block_ss.add(when: 'CONFIG_WIN32', if_true: files('file-win32.c', 'win32-aio.c'))
block_ss.add(when: 'CONFIG_POSIX', if_true: [files('file-posix.c'), coref, iokit])
block_ss.add(when: libiscsi, if_true: files('iscsi-opts.c'))
-block_ss.add(when: 'CONFIG_LINUX', if_true: files('nvme.c'))
+if targetos == 'linux'
+ block_ss.add(files('nvme.c'))
+endif
if get_option('replication').allowed()
block_ss.add(files('replication.c'))
endif
diff --git a/fsdev/meson.build b/fsdev/meson.build
index 1bec0659245..c76347615df 100644
--- a/fsdev/meson.build
+++ b/fsdev/meson.build
@@ -6,8 +6,9 @@ fsdev_ss.add(when: ['CONFIG_FSDEV_9P'], if_true: files(
'9p-marshal.c',
'qemu-fsdev.c',
), if_false: files('qemu-fsdev-dummy.c'))
-system_ss.add_all(when: 'CONFIG_LINUX', if_true: fsdev_ss)
-system_ss.add_all(when: 'CONFIG_DARWIN', if_true: fsdev_ss)
+if targetos in ['linux', 'darwin']
+ system_ss.add_all(fsdev_ss)
+endif
if have_virtfs_proxy_helper
executable('virtfs-proxy-helper',
diff --git a/hw/9pfs/meson.build b/hw/9pfs/meson.build
index 2944ea63c38..3eee7c268a9 100644
--- a/hw/9pfs/meson.build
+++ b/hw/9pfs/meson.build
@@ -13,8 +13,11 @@ fs_ss.add(files(
'coth.c',
'coxattr.c',
))
-fs_ss.add(when: 'CONFIG_LINUX', if_true: files('9p-util-linux.c'))
-fs_ss.add(when: 'CONFIG_DARWIN', if_true: files('9p-util-darwin.c'))
+if targetos == 'darwin'
+ fs_ss.add(files('9p-util-darwin.c'))
+elif targetos == 'linux'
+ fs_ss.add(files('9p-util-linux.c'))
+endif
fs_ss.add(when: 'CONFIG_XEN_BUS', if_true: files('xen-9p-backend.c'))
system_ss.add_all(when: 'CONFIG_FSDEV_9P', if_true: fs_ss)
diff --git a/hw/display/meson.build b/hw/display/meson.build
index 344dfe3d8c2..02b0044c9ec 100644
--- a/hw/display/meson.build
+++ b/hw/display/meson.build
@@ -69,8 +69,11 @@ if config_all_devices.has_key('CONFIG_VIRTIO_GPU')
virtio_gpu_ss = ss.source_set()
virtio_gpu_ss.add(when: 'CONFIG_VIRTIO_GPU',
if_true: [files('virtio-gpu-base.c', 'virtio-gpu.c'), pixman])
- virtio_gpu_ss.add(when: 'CONFIG_LINUX', if_true: files('virtio-gpu-udmabuf.c'),
- if_false: files('virtio-gpu-udmabuf-stubs.c'))
+ if targetos == 'linux'
+ virtio_gpu_ss.add(files('virtio-gpu-udmabuf.c'))
+ else
+ virtio_gpu_ss.add(files('virtio-gpu-udmabuf-stubs.c'))
+ endif
virtio_gpu_ss.add(when: 'CONFIG_VHOST_USER_GPU', if_true: files('vhost-user-gpu.c'))
hw_display_modules += {'virtio-gpu': virtio_gpu_ss}
diff --git a/hw/ppc/meson.build b/hw/ppc/meson.build
index ea44856d43b..3dedcf3043d 100644
--- a/hw/ppc/meson.build
+++ b/hw/ppc/meson.build
@@ -34,9 +34,11 @@ ppc_ss.add(when: ['CONFIG_PSERIES', 'CONFIG_TCG'], if_true: files(
'spapr_softmmu.c',
))
ppc_ss.add(when: 'CONFIG_SPAPR_RNG', if_true: files('spapr_rng.c'))
-ppc_ss.add(when: ['CONFIG_PSERIES', 'CONFIG_LINUX'], if_true: files(
- 'spapr_pci_vfio.c',
-))
+if targetos == 'linux'
+ ppc_ss.add(when: 'CONFIG_PSERIES', if_true: files(
+ 'spapr_pci_vfio.c',
+ ))
+endif
# IBM PowerNV
ppc_ss.add(when: 'CONFIG_POWERNV', if_true: files(
diff --git a/hw/usb/meson.build b/hw/usb/meson.build
index e94149ebdeb..4b44db39cd3 100644
--- a/hw/usb/meson.build
+++ b/hw/usb/meson.build
@@ -58,7 +58,9 @@ endif
# U2F
system_ss.add(when: 'CONFIG_USB_U2F', if_true: files('u2f.c'))
-system_ss.add(when: ['CONFIG_LINUX', 'CONFIG_USB_U2F'], if_true: [libudev, files('u2f-passthru.c')])
+if targetos == 'linux'
+ system_ss.add(when: 'CONFIG_USB_U2F', if_true: [libudev, files('u2f-passthru.c')])
+endif
if u2f.found()
system_ss.add(when: 'CONFIG_USB_U2F', if_true: [u2f, files('u2f-emulated.c')])
endif
diff --git a/meson.build b/meson.build
index 7344e363826..cf224e252c6 100644
--- a/meson.build
+++ b/meson.build
@@ -2888,14 +2888,6 @@ minikconf = find_program('scripts/minikconf.py')
config_targetos = {
(targetos == 'windows' ? 'CONFIG_WIN32' : 'CONFIG_POSIX'): 'y'
}
-if targetos == 'darwin'
- config_targetos += {'CONFIG_DARWIN': 'y'}
-elif targetos == 'linux'
- config_targetos += {'CONFIG_LINUX': 'y'}
-endif
-if targetos in bsd_oses
- config_targetos += {'CONFIG_BSD': 'y'}
-endif
config_all = {}
config_all_devices = {}
diff --git a/net/can/meson.build b/net/can/meson.build
index 45693c82c9d..bdf6f8eee16 100644
--- a/net/can/meson.build
+++ b/net/can/meson.build
@@ -1,5 +1,7 @@
can_ss = ss.source_set()
can_ss.add(files('can_core.c', 'can_host.c'))
-can_ss.add(when: 'CONFIG_LINUX', if_true: files('can_socketcan.c'))
+if targetos == 'linux'
+ can_ss.add(files('can_socketcan.c'))
+endif
system_ss.add_all(when: 'CONFIG_CAN_BUS', if_true: can_ss)
diff --git a/qga/meson.build b/qga/meson.build
index a6af614891a..50edaf1c3d4 100644
--- a/qga/meson.build
+++ b/qga/meson.build
@@ -72,12 +72,11 @@ qga_ss.add(when: 'CONFIG_POSIX', if_true: files(
'commands-posix.c',
'commands-posix-ssh.c',
))
-qga_ss.add(when: 'CONFIG_LINUX', if_true: files(
- 'commands-linux.c',
-))
-qga_ss.add(when: 'CONFIG_BSD', if_true: files(
- 'commands-bsd.c',
-))
+if targetos == 'linux'
+ qga_ss.add(files('commands-linux.c'))
+elif targetos in bsd_oses
+ qga_ss.add(files('commands-bsd.c'))
+endif
qga_ss.add(when: 'CONFIG_WIN32', if_true: files(
'channel-win32.c',
'commands-win32.c',
diff --git a/scsi/meson.build b/scsi/meson.build
index 53f3a1f7169..0ff2b3affe0 100644
--- a/scsi/meson.build
+++ b/scsi/meson.build
@@ -1,4 +1,6 @@
block_ss.add(files('utils.c'))
-block_ss.add(when: 'CONFIG_LINUX',
- if_true: files('pr-manager.c', 'pr-manager-helper.c'),
- if_false: files('pr-manager-stub.c'))
+if targetos == 'linux'
+ block_ss.add(files('pr-manager.c', 'pr-manager-helper.c'))
+else
+ block_ss.add(files('pr-manager-stub.c'))
+endif
diff --git a/system/meson.build b/system/meson.build
index 3a64dd89de1..0632a3daa8a 100644
--- a/system/meson.build
+++ b/system/meson.build
@@ -33,4 +33,6 @@ endif
system_ss.add(when: seccomp, if_true: files('qemu-seccomp.c'))
system_ss.add(when: fdt, if_true: files('device_tree.c'))
-system_ss.add(when: 'CONFIG_LINUX', if_true: files('async-teardown.c'))
+if targetos == 'linux'
+ system_ss.add('async-teardown.c')
+endif
diff --git a/ui/meson.build b/ui/meson.build
index 0ccb3387ee6..8379a788a1a 100644
--- a/ui/meson.build
+++ b/ui/meson.build
@@ -25,10 +25,9 @@ endif
system_ss.add([spice_headers, files('spice-module.c')])
system_ss.add(when: spice_protocol, if_true: files('vdagent.c'))
-system_ss.add(when: 'CONFIG_LINUX', if_true: files(
- 'input-linux.c',
- 'udmabuf.c',
-))
+if targetos == 'linux'
+ system_ss.add(files('input-linux.c', 'udmabuf.c'))
+endif
system_ss.add(when: cocoa, if_true: files('cocoa.m'))
vnc_ss = ss.source_set()
diff --git a/util/meson.build b/util/meson.build
index 174c133368a..98dd7fa5340 100644
--- a/util/meson.build
+++ b/util/meson.build
@@ -71,7 +71,9 @@ endif
if have_system
util_ss.add(files('crc-ccitt.c'))
util_ss.add(when: gio, if_true: files('dbus.c'))
- util_ss.add(when: 'CONFIG_LINUX', if_true: files('userfaultfd.c'))
+ if targetos == 'linux'
+ util_ss.add(files('userfaultfd.c'))
+ endif
endif
if have_block or have_ga
@@ -92,9 +94,6 @@ if have_block
util_ss.add(files('iova-tree.c'))
util_ss.add(files('iov.c', 'uri.c'))
util_ss.add(files('nvdimm-utils.c'))
- util_ss.add(when: 'CONFIG_LINUX', if_true: [
- files('vhost-user-server.c'), vhost_user
- ])
util_ss.add(files('block-helpers.c'))
util_ss.add(files('qemu-coroutine-sleep.c'))
util_ss.add(files('qemu-co-shared-resource.c'))
@@ -107,8 +106,11 @@ if have_block
else
util_ss.add(files('filemonitor-stub.c'))
endif
- util_ss.add(when: 'CONFIG_LINUX', if_true: files('vfio-helpers.c'))
- util_ss.add(when: 'CONFIG_LINUX', if_true: files('chardev_open.c'))
+ if targetos == 'linux'
+ util_ss.add(files('vhost-user-server.c'), vhost_user)
+ util_ss.add(files('vfio-helpers.c'))
+ util_ss.add(files('chardev_open.c'))
+ endif
endif
if cpu == 'aarch64'
--
2.43.0
next prev parent reply other threads:[~2023-12-31 8:53 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-31 8:44 [PULL 00/46] (mostly) target/i386 and meson changes for 2023-12-31 Paolo Bonzini
2023-12-31 8:44 ` [PULL 01/46] configure: use a native non-cross compiler for linux-user Paolo Bonzini
2023-12-31 8:44 ` [PULL 02/46] target/i386: optimize computation of JL and JLE from flags Paolo Bonzini
2023-12-31 8:44 ` [PULL 03/46] target/i386: speedup JO/SETO after MUL or IMUL Paolo Bonzini
2023-12-31 8:44 ` [PULL 04/46] target/i386: remove unnecessary arguments from raise_interrupt Paolo Bonzini
2023-12-31 8:44 ` [PULL 05/46] target/i386: remove unnecessary truncations Paolo Bonzini
2023-12-31 8:44 ` [PULL 06/46] target/i386: clean up cpu_cc_compute_all Paolo Bonzini
2023-12-31 8:44 ` [PULL 07/46] target/i386: document more deviations from the manual Paolo Bonzini
2023-12-31 8:44 ` [PULL 08/46] target/i386: reimplement check for validity of LOCK prefix Paolo Bonzini
2023-12-31 8:44 ` [PULL 09/46] target/i386: avoid trunc and ext for MULX and RORX Paolo Bonzini
2023-12-31 8:44 ` [PULL 10/46] target/i386: rename zext0/zext2 and make them closer to the manual Paolo Bonzini
2023-12-31 8:44 ` [PULL 11/46] target/i386: add X86_SPECIALs for MOVSX and MOVZX Paolo Bonzini
2023-12-31 8:44 ` [PULL 12/46] target/i386: do not decode string source/destination into decode->mem Paolo Bonzini
2023-12-31 8:44 ` [PULL 13/46] target/i386: do not clobber A0 in POP translation Paolo Bonzini
2023-12-31 8:44 ` [PULL 14/46] target/i386: do not clobber T0 on string operations Paolo Bonzini
2023-12-31 8:44 ` [PULL 15/46] target/i386: split eflags computation out of gen_compute_eflags Paolo Bonzini
2023-12-31 8:44 ` [PULL 16/46] target/i386: do not use s->tmp4 for push Paolo Bonzini
2023-12-31 8:44 ` [PULL 17/46] target/i386: do not use s->tmp0 for jumps on ECX ==/!= 0 Paolo Bonzini
2023-12-31 8:44 ` [PULL 18/46] target/i386: prepare for implementation of STOS/SCAS in new decoder Paolo Bonzini
2023-12-31 8:44 ` [PULL 19/46] target/i386: move operand load and writeback out of gen_cmovcc1 Paolo Bonzini
2023-12-31 8:44 ` [PULL 20/46] target/i386: adjust decoding of J operand Paolo Bonzini
2023-12-31 8:44 ` [PULL 21/46] target/i386: introduce flags writeback mechanism Paolo Bonzini
2023-12-31 8:44 ` [PULL 22/46] target/i386: implement CMPccXADD Paolo Bonzini
2023-12-31 8:44 ` [PULL 23/46] target/i386: the sgx_epc_get_section stub is reachable Paolo Bonzini
2023-12-31 8:44 ` [PULL 24/46] esp: check for NULL result from scsi_device_find() Paolo Bonzini
2023-12-31 8:44 ` [PULL 25/46] meson: fix type of "relocatable" option Paolo Bonzini
2023-12-31 8:44 ` [PULL 26/46] meson: remove unused variable Paolo Bonzini
2023-12-31 8:44 ` [PULL 27/46] meson: use version_compare() to compare version Paolo Bonzini
2023-12-31 8:44 ` [PULL 28/46] Makefile: clean qemu-iotests output Paolo Bonzini
2023-12-31 8:44 ` [PULL 29/46] configure: remove unnecessary subshell Paolo Bonzini
2023-12-31 8:44 ` [PULL 30/46] configure: unify again the case arms in probe_target_compiler Paolo Bonzini
2023-12-31 8:44 ` [PULL 31/46] meson: add more sections to main meson.build Paolo Bonzini
2023-12-31 8:44 ` [PULL 32/46] meson: move program checks together Paolo Bonzini
2023-12-31 8:44 ` [PULL 33/46] meson: move option validation together Paolo Bonzini
2023-12-31 8:44 ` [PULL 34/46] meson: move accelerator dependency checks together Paolo Bonzini
2023-12-31 8:44 ` [PULL 35/46] meson: keep subprojects together Paolo Bonzini
2023-12-31 8:44 ` [PULL 36/46] meson: move CFI detection code with other compiler flags Paolo Bonzini
2023-12-31 8:44 ` [PULL 37/46] meson: move config-host.h definitions together Paolo Bonzini
2023-12-31 8:44 ` [PULL 38/46] meson: move subdirs to "Collect sources" section Paolo Bonzini
2023-12-31 8:44 ` [PULL 39/46] meson: always probe u2f and canokey if the option is enabled Paolo Bonzini
2023-12-31 8:44 ` Paolo Bonzini [this message]
2023-12-31 8:44 ` [PULL 41/46] meson: remove CONFIG_POSIX and CONFIG_WIN32 from config_targetos Paolo Bonzini
2023-12-31 8:44 ` [PULL 42/46] meson: remove config_targetos Paolo Bonzini
2023-12-31 8:44 ` [PULL 43/46] meson: remove CONFIG_ALL Paolo Bonzini
2023-12-31 8:45 ` [PULL 44/46] meson: rename config_all Paolo Bonzini
2023-12-31 8:45 ` [PULL 45/46] configure, meson: rename targetos to host_os Paolo Bonzini
2023-12-31 8:45 ` [PULL 46/46] meson.build: report graphics backends separately Paolo Bonzini
2024-01-05 12:53 ` [PULL 00/46] (mostly) target/i386 and meson changes for 2023-12-31 Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231231084502.235366-41-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).