Skip to content

Commit d0cda6f

Browse files
committed
configure, meson: rename targetos to host_os
This variable is about the host OS, not the target. It is used a lot more since the Meson conversion, but the original sin dates back to 2003. Time to fix it. Signed-off-by: Paolo Bonzini <[email protected]>
1 parent cfc1a88 commit d0cda6f

File tree

33 files changed

+197
-197
lines changed

33 files changed

+197
-197
lines changed

accel/tcg/meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ if get_option('plugins')
1717
tcg_ss.add(files('plugin-gen.c'))
1818
endif
1919
tcg_ss.add(when: libdw, if_true: files('debuginfo.c'))
20-
if targetos == 'linux'
20+
if host_os == 'linux'
2121
tcg_ss.add(files('perf.c'))
2222
endif
2323
specific_ss.add_all(when: 'CONFIG_TCG', if_true: tcg_ss)

backends/meson.build

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ system_ss.add([files(
1010
'confidential-guest-support.c',
1111
), numa])
1212

13-
if targetos != 'windows'
13+
if host_os != 'windows'
1414
system_ss.add(files('rng-random.c'))
1515
system_ss.add(files('hostmem-file.c'))
1616
endif
17-
if targetos == 'linux'
17+
if host_os == 'linux'
1818
system_ss.add(files('hostmem-memfd.c'))
1919
endif
2020
if keyutils.found()

block/meson.build

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,13 @@ if get_option('parallels').allowed()
8888
block_ss.add(files('parallels.c', 'parallels-ext.c'))
8989
endif
9090

91-
if targetos == 'windows'
91+
if host_os == 'windows'
9292
block_ss.add(files('file-win32.c', 'win32-aio.c'))
9393
else
9494
block_ss.add(files('file-posix.c'), coref, iokit)
9595
endif
9696
block_ss.add(when: libiscsi, if_true: files('iscsi-opts.c'))
97-
if targetos == 'linux'
97+
if host_os == 'linux'
9898
block_ss.add(files('nvme.c'))
9999
endif
100100
if get_option('replication').allowed()

bsd-user/meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ kvm = cc.find_library('kvm', required: true)
2424
bsd_user_ss.add(elf, procstat, kvm)
2525

2626
# Pull in the OS-specific build glue, if any
27-
subdir(targetos)
27+
subdir(host_os)
2828

2929
specific_ss.add_all(when: 'CONFIG_BSD_USER', if_true: bsd_user_ss)

chardev/meson.build

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ chardev_ss.add(files(
1212
'char-udp.c',
1313
'char.c',
1414
))
15-
if targetos == 'windows'
15+
if host_os == 'windows'
1616
chardev_ss.add(files(
1717
'char-console.c',
1818
'char-win-stdio.c',
@@ -23,7 +23,7 @@ else
2323
'char-fd.c',
2424
'char-pty.c',
2525
), util)
26-
if targetos in ['linux', 'gnu/kfreebsd', 'freebsd', 'dragonfly']
26+
if host_os in ['linux', 'gnu/kfreebsd', 'freebsd', 'dragonfly']
2727
chardev_ss.add(files('char-parallel.c'))
2828
endif
2929
endif

configure

+29-29
Original file line numberDiff line numberDiff line change
@@ -334,30 +334,30 @@ EOF
334334
}
335335

336336
if check_define __linux__ ; then
337-
targetos=linux
337+
host_os=linux
338338
elif check_define _WIN32 ; then
339-
targetos=windows
339+
host_os=windows
340340
elif check_define __OpenBSD__ ; then
341-
targetos=openbsd
341+
host_os=openbsd
342342
elif check_define __sun__ ; then
343-
targetos=sunos
343+
host_os=sunos
344344
elif check_define __HAIKU__ ; then
345-
targetos=haiku
345+
host_os=haiku
346346
elif check_define __FreeBSD__ ; then
347-
targetos=freebsd
347+
host_os=freebsd
348348
elif check_define __FreeBSD_kernel__ && check_define __GLIBC__; then
349-
targetos=gnu/kfreebsd
349+
host_os=gnu/kfreebsd
350350
elif check_define __DragonFly__ ; then
351-
targetos=dragonfly
351+
host_os=dragonfly
352352
elif check_define __NetBSD__; then
353-
targetos=netbsd
353+
host_os=netbsd
354354
elif check_define __APPLE__; then
355-
targetos=darwin
355+
host_os=darwin
356356
else
357357
# This is a fatal error, but don't report it yet, because we
358358
# might be going to just print the --help text, or it might
359359
# be the result of a missing compiler.
360-
targetos=bogus
360+
host_os=bogus
361361
fi
362362

363363
if test ! -z "$cpu" ; then
@@ -573,13 +573,13 @@ do
573573
fi
574574
done
575575

576-
if test "$targetos" = "windows" ; then
576+
if test "$host_os" = "windows" ; then
577577
EXESUF=".exe"
578578
fi
579579

580580
meson_option_build_array() {
581581
printf '['
582-
(if test "$targetos" = windows; then
582+
(if test "$host_os" = windows; then
583583
IFS=\;
584584
else
585585
IFS=:
@@ -802,7 +802,7 @@ mak_wilds=""
802802

803803
if [ -n "$host_arch" ] && [ -d "$source_path/common-user/host/$host_arch" ]; then
804804
if [ "$linux_user" != no ]; then
805-
if [ "$targetos" = linux ]; then
805+
if [ "$host_os" = linux ]; then
806806
linux_user=yes
807807
elif [ "$linux_user" = yes ]; then
808808
error_exit "linux-user not supported on this architecture"
@@ -813,9 +813,9 @@ if [ -n "$host_arch" ] && [ -d "$source_path/common-user/host/$host_arch" ]; the
813813
fi
814814
if [ "$bsd_user" != no ]; then
815815
if [ "$bsd_user" = "" ]; then
816-
test $targetos = freebsd && bsd_user=yes
816+
test $host_os = freebsd && bsd_user=yes
817817
fi
818-
if [ "$bsd_user" = yes ] && ! [ -d "$source_path/bsd-user/$targetos" ]; then
818+
if [ "$bsd_user" = yes ] && ! [ -d "$source_path/bsd-user/$host_os" ]; then
819819
error_exit "bsd-user not supported on this host OS"
820820
fi
821821
if [ "$bsd_user" = "yes" ]; then
@@ -998,7 +998,7 @@ if test -z "$ninja"; then
998998
fi
999999
fi
10001000

1001-
if test "$targetos" = "bogus"; then
1001+
if test "$host_os" = "bogus"; then
10021002
# Now that we know that we're not printing the help and that
10031003
# the compiler works (so the results of the check_defines we used
10041004
# to identify the OS are reliable), if we didn't recognize the
@@ -1007,7 +1007,7 @@ if test "$targetos" = "bogus"; then
10071007
fi
10081008

10091009
# test for any invalid configuration combinations
1010-
if test "$targetos" = "windows" && ! has "$dlltool"; then
1010+
if test "$host_os" = "windows" && ! has "$dlltool"; then
10111011
if test "$plugins" = "yes"; then
10121012
error_exit "TCG plugins requires dlltool to build on Windows platforms"
10131013
fi
@@ -1041,7 +1041,7 @@ static THREAD int tls_var;
10411041
int main(void) { return tls_var; }
10421042
EOF
10431043

1044-
if test "$targetos" = windows || test "$targetos" = haiku; then
1044+
if test "$host_os" = windows || test "$host_os" = haiku; then
10451045
if test "$pie" = "yes"; then
10461046
error_exit "PIE not available due to missing OS support"
10471047
fi
@@ -1541,8 +1541,8 @@ echo "# Automatically generated by configure - do not modify" > Makefile.prereqs
15411541

15421542
# Mac OS X ships with a broken assembler
15431543
if have_target i386-softmmu x86_64-softmmu && \
1544-
test "$targetos" != "darwin" && test "$targetos" != "sunos" && \
1545-
test "$targetos" != "haiku" && \
1544+
test "$host_os" != "darwin" && test "$host_os" != "sunos" && \
1545+
test "$host_os" != "haiku" && \
15461546
probe_target_compiler i386-softmmu; then
15471547
subdirs="$subdirs pc-bios/optionrom"
15481548
config_mak=pc-bios/optionrom/config.mak
@@ -1606,7 +1606,7 @@ echo "NINJA=$ninja" >> $config_host_mak
16061606
echo "EXESUF=$EXESUF" >> $config_host_mak
16071607

16081608
# use included Linux headers for KVM architectures
1609-
if test "$targetos" = "linux" && test -n "$linux_arch"; then
1609+
if test "$host_os" = "linux" && test -n "$linux_arch"; then
16101610
symlink "$source_path/linux-headers/asm-$linux_arch" linux-headers/asm
16111611
fi
16121612

@@ -1629,13 +1629,13 @@ echo "SRC_PATH=$source_path/contrib/plugins" >> contrib/plugins/$config_host_mak
16291629
echo "PKG_CONFIG=${pkg_config}" >> contrib/plugins/$config_host_mak
16301630
echo "CC=$cc $CPU_CFLAGS" >> contrib/plugins/$config_host_mak
16311631
echo "CFLAGS=${CFLAGS-$default_cflags} $EXTRA_CFLAGS" >> contrib/plugins/$config_host_mak
1632-
if test "$targetos" = windows; then
1632+
if test "$host_os" = windows; then
16331633
echo "DLLTOOL=$dlltool" >> contrib/plugins/$config_host_mak
16341634
fi
1635-
if test "$targetos" = darwin; then
1635+
if test "$host_os" = darwin; then
16361636
echo "CONFIG_DARWIN=y" >> contrib/plugins/$config_host_mak
16371637
fi
1638-
if test "$targetos" = windows; then
1638+
if test "$host_os" = windows; then
16391639
echo "CONFIG_WIN32=y" >> contrib/plugins/$config_host_mak
16401640
fi
16411641

@@ -1715,7 +1715,7 @@ if test "$skip_meson" = no; then
17151715
echo "# environment defaults, can still be overridden on " >> $cross
17161716
echo "# the command line" >> $cross
17171717
if test -e "$source_path/.git" && \
1718-
{ test "$targetos" = linux || test "$targetos" = "windows"; }; then
1718+
{ test "$host_os" = linux || test "$host_os" = "windows"; }; then
17191719
echo 'werror = true' >> $cross
17201720
fi
17211721
echo "[project options]" >> $cross
@@ -1752,7 +1752,7 @@ if test "$skip_meson" = no; then
17521752
echo "windmc = [$(meson_quote $windmc)]" >> $cross
17531753
if test "$cross_compile" = "yes"; then
17541754
echo "[host_machine]" >> $cross
1755-
echo "system = '$targetos'" >> $cross
1755+
echo "system = '$host_os'" >> $cross
17561756
case "$cpu" in
17571757
i386)
17581758
echo "cpu_family = 'x86'" >> $cross
@@ -1778,8 +1778,8 @@ if test "$skip_meson" = no; then
17781778
fi
17791779
mv $cross config-meson.cross
17801780
meson_add_machine_file config-meson.cross
1781-
if test -f "$source_path/configs/meson/$targetos.txt"; then
1782-
meson_add_machine_file $source_path/configs/meson/$targetos.txt
1781+
if test -f "$source_path/configs/meson/$host_os.txt"; then
1782+
meson_add_machine_file $source_path/configs/meson/$host_os.txt
17831783
fi
17841784

17851785
rm -rf meson-private meson-info meson-logs

contrib/ivshmem-client/meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
executable('ivshmem-client', files('ivshmem-client.c', 'main.c'), genh,
22
dependencies: glib,
3-
build_by_default: targetos == 'linux',
3+
build_by_default: host_os == 'linux',
44
install: false)

contrib/ivshmem-server/meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
executable('ivshmem-server', files('ivshmem-server.c', 'main.c'), genh,
22
dependencies: [qemuutil, rt],
3-
build_by_default: targetos == 'linux',
3+
build_by_default: host_os == 'linux',
44
install: false)

contrib/vhost-user-blk/meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
executable('vhost-user-blk', files('vhost-user-blk.c'),
22
dependencies: [qemuutil, vhost_user],
3-
build_by_default: targetos == 'linux',
3+
build_by_default: host_os == 'linux',
44
install: false)

contrib/vhost-user-input/meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
executable('vhost-user-input', files('main.c'),
22
dependencies: [qemuutil, vhost_user],
3-
build_by_default: targetos == 'linux',
3+
build_by_default: host_os == 'linux',
44
install: false)

contrib/vhost-user-scsi/meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
if libiscsi.found()
22
executable('vhost-user-scsi', files('vhost-user-scsi.c'),
33
dependencies: [qemuutil, libiscsi, vhost_user],
4-
build_by_default: targetos == 'linux',
4+
build_by_default: host_os == 'linux',
55
install: false)
66
endif

docs/devel/kconfig.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,6 @@ variable::
316316

317317
host_kconfig = \
318318
(have_tpm ? ['CONFIG_TPM=y'] : []) + \
319-
(targetos == 'linux' ? ['CONFIG_LINUX=y'] : []) + \
319+
(host_os == 'linux' ? ['CONFIG_LINUX=y'] : []) + \
320320
(have_ivshmem ? ['CONFIG_IVSHMEM=y'] : []) + \
321321
...

fsdev/meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ fsdev_ss.add(when: ['CONFIG_FSDEV_9P'], if_true: files(
55
'9p-marshal.c',
66
'qemu-fsdev.c',
77
), if_false: files('qemu-fsdev-dummy.c'))
8-
if targetos in ['linux', 'darwin']
8+
if host_os in ['linux', 'darwin']
99
system_ss.add_all(fsdev_ss)
1010
endif
1111

hw/9pfs/meson.build

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ fs_ss.add(files(
1313
'coth.c',
1414
'coxattr.c',
1515
))
16-
if targetos == 'darwin'
16+
if host_os == 'darwin'
1717
fs_ss.add(files('9p-util-darwin.c'))
18-
elif targetos == 'linux'
18+
elif host_os == 'linux'
1919
fs_ss.add(files('9p-util-linux.c'))
2020
endif
2121
fs_ss.add(when: 'CONFIG_XEN_BUS', if_true: files('xen-9p-backend.c'))

hw/display/meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ if config_all_devices.has_key('CONFIG_VIRTIO_GPU')
6969
virtio_gpu_ss = ss.source_set()
7070
virtio_gpu_ss.add(when: 'CONFIG_VIRTIO_GPU',
7171
if_true: [files('virtio-gpu-base.c', 'virtio-gpu.c'), pixman])
72-
if targetos == 'linux'
72+
if host_os == 'linux'
7373
virtio_gpu_ss.add(files('virtio-gpu-udmabuf.c'))
7474
else
7575
virtio_gpu_ss.add(files('virtio-gpu-udmabuf-stubs.c'))

hw/ppc/meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ ppc_ss.add(when: ['CONFIG_PSERIES', 'CONFIG_TCG'], if_true: files(
3434
'spapr_softmmu.c',
3535
))
3636
ppc_ss.add(when: 'CONFIG_SPAPR_RNG', if_true: files('spapr_rng.c'))
37-
if targetos == 'linux'
37+
if host_os == 'linux'
3838
ppc_ss.add(when: 'CONFIG_PSERIES', if_true: files(
3939
'spapr_pci_vfio.c',
4040
))

hw/usb/meson.build

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ system_ss.add(when: 'CONFIG_USB_STORAGE_UAS', if_true: files('dev-uas.c'))
4444
system_ss.add(when: 'CONFIG_USB_AUDIO', if_true: files('dev-audio.c'))
4545
system_ss.add(when: 'CONFIG_USB_SERIAL', if_true: files('dev-serial.c'))
4646
system_ss.add(when: 'CONFIG_USB_NETWORK', if_true: files('dev-network.c'))
47-
if targetos != 'windows'
47+
if host_os != 'windows'
4848
system_ss.add(when: 'CONFIG_USB_STORAGE_MTP', if_true: files('dev-mtp.c'))
4949
endif
5050

@@ -60,7 +60,7 @@ endif
6060

6161
# U2F
6262
system_ss.add(when: 'CONFIG_USB_U2F', if_true: files('u2f.c'))
63-
if targetos == 'linux'
63+
if host_os == 'linux'
6464
system_ss.add(when: 'CONFIG_USB_U2F', if_true: [libudev, files('u2f-passthru.c')])
6565
endif
6666
if u2f.found()

0 commit comments

Comments
 (0)