configure: make $targetos lowercase, use windows instead of MINGW32

targetos is already mostly the same as Meson host_machine.system(),
just in CamelCase.  Adjust Windows, which is different, and switch to
lowercase to match Meson.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Paolo Bonzini 2021-11-08 14:47:54 +01:00
parent 90978e15bc
commit ba7c60c203
1 changed files with 25 additions and 33 deletions

58
configure vendored
View File

@ -501,30 +501,30 @@ EOF
} }
if check_define __linux__ ; then if check_define __linux__ ; then
targetos="Linux" targetos=linux
elif check_define _WIN32 ; then elif check_define _WIN32 ; then
targetos='MINGW32' targetos=windows
elif check_define __OpenBSD__ ; then elif check_define __OpenBSD__ ; then
targetos='OpenBSD' targetos=openbsd
elif check_define __sun__ ; then elif check_define __sun__ ; then
targetos='SunOS' targetos=sunos
elif check_define __HAIKU__ ; then elif check_define __HAIKU__ ; then
targetos='Haiku' targetos=haiku
elif check_define __FreeBSD__ ; then elif check_define __FreeBSD__ ; then
targetos='FreeBSD' targetos=freebsd
elif check_define __FreeBSD_kernel__ && check_define __GLIBC__; then elif check_define __FreeBSD_kernel__ && check_define __GLIBC__; then
targetos='GNU/kFreeBSD' targetos=gnu/kfreebsd
elif check_define __DragonFly__ ; then elif check_define __DragonFly__ ; then
targetos='DragonFly' targetos=dragonfly
elif check_define __NetBSD__; then elif check_define __NetBSD__; then
targetos='NetBSD' targetos=netbsd
elif check_define __APPLE__; then elif check_define __APPLE__; then
targetos='Darwin' targetos=darwin
else else
# This is a fatal error, but don't report it yet, because we # This is a fatal error, but don't report it yet, because we
# might be going to just print the --help text, or it might # might be going to just print the --help text, or it might
# be the result of a missing compiler. # be the result of a missing compiler.
targetos='bogus' targetos=bogus
fi fi
# Some host OSes need non-standard checks for which CPU to use. # Some host OSes need non-standard checks for which CPU to use.
@ -532,7 +532,7 @@ fi
# cross-compiling to one of these OSes then you'll need to specify # cross-compiling to one of these OSes then you'll need to specify
# the correct CPU with the --cpu option. # the correct CPU with the --cpu option.
case $targetos in case $targetos in
SunOS) sunos)
# $(uname -m) returns i86pc even on an x86_64 box, so default based on isainfo # $(uname -m) returns i86pc even on an x86_64 box, so default based on isainfo
if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then
cpu="x86_64" cpu="x86_64"
@ -623,40 +623,40 @@ fi
# OS specific # OS specific
case $targetos in case $targetos in
MINGW32*) windows)
mingw32="yes" mingw32="yes"
plugins="no" plugins="no"
pie="no" pie="no"
;; ;;
GNU/kFreeBSD) gnu/kfreebsd)
bsd="yes" bsd="yes"
;; ;;
FreeBSD) freebsd)
bsd="yes" bsd="yes"
bsd_user="yes" bsd_user="yes"
make="${MAKE-gmake}" make="${MAKE-gmake}"
# needed for kinfo_getvmmap(3) in libutil.h # needed for kinfo_getvmmap(3) in libutil.h
;; ;;
DragonFly) dragonfly)
bsd="yes" bsd="yes"
make="${MAKE-gmake}" make="${MAKE-gmake}"
;; ;;
NetBSD) netbsd)
bsd="yes" bsd="yes"
make="${MAKE-gmake}" make="${MAKE-gmake}"
;; ;;
OpenBSD) openbsd)
bsd="yes" bsd="yes"
make="${MAKE-gmake}" make="${MAKE-gmake}"
;; ;;
Darwin) darwin)
bsd="yes" bsd="yes"
darwin="yes" darwin="yes"
# Disable attempts to use ObjectiveC features in os/object.h since they # Disable attempts to use ObjectiveC features in os/object.h since they
# won't work when we're compiling with gcc as a C compiler. # won't work when we're compiling with gcc as a C compiler.
QEMU_CFLAGS="-DOS_OBJECT_USE_OBJC=0 $QEMU_CFLAGS" QEMU_CFLAGS="-DOS_OBJECT_USE_OBJC=0 $QEMU_CFLAGS"
;; ;;
SunOS) sunos)
solaris="yes" solaris="yes"
make="${MAKE-gmake}" make="${MAKE-gmake}"
smbd="${SMBD-/usr/sfw/sbin/smbd}" smbd="${SMBD-/usr/sfw/sbin/smbd}"
@ -665,11 +665,11 @@ SunOS)
# needed for TIOCWIN* defines in termios.h # needed for TIOCWIN* defines in termios.h
QEMU_CFLAGS="-D__EXTENSIONS__ $QEMU_CFLAGS" QEMU_CFLAGS="-D__EXTENSIONS__ $QEMU_CFLAGS"
;; ;;
Haiku) haiku)
pie="no" pie="no"
QEMU_CFLAGS="-DB_USE_POSITIVE_POSIX_ERRORS -D_BSD_SOURCE -fPIC $QEMU_CFLAGS" QEMU_CFLAGS="-DB_USE_POSITIVE_POSIX_ERRORS -D_BSD_SOURCE -fPIC $QEMU_CFLAGS"
;; ;;
Linux) linux)
linux="yes" linux="yes"
linux_user="yes" linux_user="yes"
vhost_user=${default_feature:-yes} vhost_user=${default_feature:-yes}
@ -3334,8 +3334,8 @@ QEMU_GA_MSI_MINGW_DLL_PATH="$($pkg_config --variable=prefix glib-2.0)/bin"
# Mac OS X ships with a broken assembler # Mac OS X ships with a broken assembler
roms= roms=
if { test "$cpu" = "i386" || test "$cpu" = "x86_64"; } && \ if { test "$cpu" = "i386" || test "$cpu" = "x86_64"; } && \
test "$targetos" != "Darwin" && test "$targetos" != "SunOS" && \ test "$targetos" != "darwin" && test "$targetos" != "sunos" && \
test "$targetos" != "Haiku" && test "$softmmu" = yes ; then test "$targetos" != "haiku" && test "$softmmu" = yes ; then
# Different host OS linkers have different ideas about the name of the ELF # Different host OS linkers have different ideas about the name of the ELF
# emulation. Linux and OpenBSD/amd64 use 'elf_i386'; FreeBSD uses the _fbsd # emulation. Linux and OpenBSD/amd64 use 'elf_i386'; FreeBSD uses the _fbsd
# variant; OpenBSD/i386 uses the _obsd variant; and Windows uses i386pe. # variant; OpenBSD/i386 uses the _obsd variant; and Windows uses i386pe.
@ -3903,15 +3903,7 @@ if test "$skip_meson" = no; then
if test "$cross_compile" = "yes"; then if test "$cross_compile" = "yes"; then
cross_arg="--cross-file config-meson.cross" cross_arg="--cross-file config-meson.cross"
echo "[host_machine]" >> $cross echo "[host_machine]" >> $cross
if test "$mingw32" = "yes" ; then echo "system = '$targetos'" >> $cross
echo "system = 'windows'" >> $cross
fi
if test "$linux" = "yes" ; then
echo "system = 'linux'" >> $cross
fi
if test "$darwin" = "yes" ; then
echo "system = 'darwin'" >> $cross
fi
case "$ARCH" in case "$ARCH" in
i386) i386)
echo "cpu_family = 'x86'" >> $cross echo "cpu_family = 'x86'" >> $cross