qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 02/10] configure: make $targetos lowercase, use windows instead o


From: Paolo Bonzini
Subject: [PATCH 02/10] configure: make $targetos lowercase, use windows instead of MINGW32
Date: Thu, 16 Dec 2021 09:51:31 +0100

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.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure | 58 ++++++++++++++++++++++++-------------------------------
 1 file changed, 25 insertions(+), 33 deletions(-)

diff --git a/configure b/configure
index ba7ab435a6..63438c1900 100755
--- a/configure
+++ b/configure
@@ -502,30 +502,30 @@ EOF
 }
 
 if check_define __linux__ ; then
-  targetos="Linux"
+  targetos=linux
 elif check_define _WIN32 ; then
-  targetos='MINGW32'
+  targetos=windows
 elif check_define __OpenBSD__ ; then
-  targetos='OpenBSD'
+  targetos=openbsd
 elif check_define __sun__ ; then
-  targetos='SunOS'
+  targetos=sunos
 elif check_define __HAIKU__ ; then
-  targetos='Haiku'
+  targetos=haiku
 elif check_define __FreeBSD__ ; then
-  targetos='FreeBSD'
+  targetos=freebsd
 elif check_define __FreeBSD_kernel__ && check_define __GLIBC__; then
-  targetos='GNU/kFreeBSD'
+  targetos=gnu/kfreebsd
 elif check_define __DragonFly__ ; then
-  targetos='DragonFly'
+  targetos=dragonfly
 elif check_define __NetBSD__; then
-  targetos='NetBSD'
+  targetos=netbsd
 elif check_define __APPLE__; then
-  targetos='Darwin'
+  targetos=darwin
 else
   # 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
   # be the result of a missing compiler.
-  targetos='bogus'
+  targetos=bogus
 fi
 
 # Some host OSes need non-standard checks for which CPU to use.
@@ -533,7 +533,7 @@ fi
 # cross-compiling to one of these OSes then you'll need to specify
 # the correct CPU with the --cpu option.
 case $targetos in
-SunOS)
+sunos)
   # $(uname -m) returns i86pc even on an x86_64 box, so default based on 
isainfo
   if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then
     cpu="x86_64"
@@ -624,40 +624,40 @@ fi
 # OS specific
 
 case $targetos in
-MINGW32*)
+windows)
   mingw32="yes"
   plugins="no"
   pie="no"
 ;;
-GNU/kFreeBSD)
+gnu/kfreebsd)
   bsd="yes"
 ;;
-FreeBSD)
+freebsd)
   bsd="yes"
   bsd_user="yes"
   make="${MAKE-gmake}"
   # needed for kinfo_getvmmap(3) in libutil.h
 ;;
-DragonFly)
+dragonfly)
   bsd="yes"
   make="${MAKE-gmake}"
 ;;
-NetBSD)
+netbsd)
   bsd="yes"
   make="${MAKE-gmake}"
 ;;
-OpenBSD)
+openbsd)
   bsd="yes"
   make="${MAKE-gmake}"
 ;;
-Darwin)
+darwin)
   bsd="yes"
   darwin="yes"
   # 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.
   QEMU_CFLAGS="-DOS_OBJECT_USE_OBJC=0 $QEMU_CFLAGS"
 ;;
-SunOS)
+sunos)
   solaris="yes"
   make="${MAKE-gmake}"
   smbd="${SMBD-/usr/sfw/sbin/smbd}"
@@ -666,11 +666,11 @@ SunOS)
 # needed for TIOCWIN* defines in termios.h
   QEMU_CFLAGS="-D__EXTENSIONS__ $QEMU_CFLAGS"
 ;;
-Haiku)
+haiku)
   pie="no"
   QEMU_CFLAGS="-DB_USE_POSITIVE_POSIX_ERRORS -D_BSD_SOURCE -fPIC $QEMU_CFLAGS"
 ;;
-Linux)
+linux)
   linux="yes"
   linux_user="yes"
   vhost_user=${default_feature:-yes}
@@ -3355,8 +3355,8 @@ QEMU_GA_MSI_MINGW_DLL_PATH="$($pkg_config 
--variable=prefix glib-2.0)/bin"
 # Mac OS X ships with a broken assembler
 roms=
 if { test "$cpu" = "i386" || test "$cpu" = "x86_64"; } && \
-        test "$targetos" != "Darwin" && test "$targetos" != "SunOS" && \
-        test "$targetos" != "Haiku" && test "$softmmu" = yes ; then
+        test "$targetos" != "darwin" && test "$targetos" != "sunos" && \
+        test "$targetos" != "haiku" && test "$softmmu" = yes ; then
     # 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
     # variant; OpenBSD/i386 uses the _obsd variant; and Windows uses i386pe.
@@ -3914,15 +3914,7 @@ if test "$skip_meson" = no; then
   if test "$cross_compile" = "yes"; then
     cross_arg="--cross-file config-meson.cross"
     echo "[host_machine]" >> $cross
-    if test "$mingw32" = "yes" ; then
-        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
+    echo "system = '$targetos'" >> $cross
     case "$ARCH" in
         i386)
             echo "cpu_family = 'x86'" >> $cross
-- 
2.33.1





reply via email to

[Prev in Thread] Current Thread [Next in Thread]