qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: [PATCH 09/10] configure, meson: move ARCH to meson.build
Date: Thu, 16 Dec 2021 09:51:38 +0100	[thread overview]
Message-ID: <20211216085139.99682-10-pbonzini@redhat.com> (raw)
In-Reply-To: <20211216085139.99682-1-pbonzini@redhat.com>

$ARCH and the HOST_* symbols are only used by the QEMU build; configure
uses $cpu instead.  Remove it from config-host.mak.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure   | 21 ++++-----------------
 meson.build | 26 +++++++++++++++++---------
 2 files changed, 21 insertions(+), 26 deletions(-)

diff --git a/configure b/configure
index 741c33c7ad..2cecbd4c66 100755
--- a/configure
+++ b/configure
@@ -634,11 +634,9 @@ else
   cpu=$(uname -m)
 fi
 
-ARCH=
-# Normalise host CPU name, set ARCH and multilib cflags
+# Normalise host CPU name, set multilib cflags
 # Note that this case should only have supported host CPUs, not guests.
 case "$cpu" in
-  aarch64|riscv) ;;
   armv*b|armv*l|arm)
     cpu="arm" ;;
 
@@ -667,8 +665,7 @@ case "$cpu" in
     CPU_CFLAGS="-m64 -mlittle" ;;
 
   s390)
-    CPU_CFLAGS="-m31"
-    ARCH=unknown ;;
+    CPU_CFLAGS="-m31" ;;
   s390x)
     CPU_CFLAGS="-m64" ;;
 
@@ -677,15 +674,7 @@ case "$cpu" in
     CPU_CFLAGS="-m32 -mv8plus -mcpu=ultrasparc" ;;
   sparc64)
     CPU_CFLAGS="-m64 -mcpu=ultrasparc" ;;
-
-  *)
-    # This will result in either an error or falling back to TCI later
-    ARCH=unknown
-  ;;
 esac
-if test -z "$ARCH"; then
-  ARCH="$cpu"
-fi
 
 : ${make=${MAKE-make}}
 
@@ -3432,8 +3421,6 @@ echo "GIT=$git" >> $config_host_mak
 echo "GIT_SUBMODULES=$git_submodules" >> $config_host_mak
 echo "GIT_SUBMODULES_ACTION=$git_submodules_action" >> $config_host_mak
 
-echo "ARCH=$ARCH" >> $config_host_mak
-
 if test "$debug_tcg" = "yes" ; then
   echo "CONFIG_DEBUG_TCG=y" >> $config_host_mak
 fi
@@ -3914,12 +3901,12 @@ if test "$skip_meson" = no; then
     cross_arg="--cross-file config-meson.cross"
     echo "[host_machine]" >> $cross
     echo "system = '$targetos'" >> $cross
-    case "$ARCH" in
+    case "$cpu" in
         i386)
             echo "cpu_family = 'x86'" >> $cross
             ;;
         *)
-            echo "cpu_family = '$ARCH'" >> $cross
+            echo "cpu_family = '$cpu'" >> $cross
             ;;
     esac
     echo "cpu = '$cpu'" >> $cross
diff --git a/meson.build b/meson.build
index 677ab1b57d..93f296e283 100644
--- a/meson.build
+++ b/meson.build
@@ -67,6 +67,14 @@ endif
 
 targetos = host_machine.system()
 
+if cpu not in supported_cpus
+  host_arch = 'unknown'
+elif cpu == 'x86'
+  host_arch = 'i386'
+else
+  host_arch = cpu
+endif
+
 if cpu in ['x86', 'x86_64']
   kvm_targets = ['i386-softmmu', 'x86_64-softmmu']
 elif cpu == 'aarch64'
@@ -335,9 +343,9 @@ if targetos == 'netbsd'
   endif
 endif
 
-tcg_arch = config_host['ARCH']
+tcg_arch = host_arch
 if not get_option('tcg').disabled()
-  if cpu not in supported_cpus
+  if host_arch == 'unknown'
     if get_option('tcg_interpreter')
       warning('Unsupported CPU @0@, will use TCG with TCI (slow)'.format(cpu))
     else
@@ -353,11 +361,11 @@ if not get_option('tcg').disabled()
   endif
   if get_option('tcg_interpreter')
     tcg_arch = 'tci'
-  elif config_host['ARCH'] == 'sparc64'
+  elif host_arch == 'sparc64'
     tcg_arch = 'sparc'
-  elif config_host['ARCH'] == 'x86_64'
+  elif host_arch == 'x86_64'
     tcg_arch = 'i386'
-  elif config_host['ARCH'] == 'ppc64'
+  elif host_arch == 'ppc64'
     tcg_arch = 'ppc'
   endif
   add_project_arguments('-iquote', meson.current_source_dir() / 'tcg' / tcg_arch,
@@ -1422,6 +1430,8 @@ config_host_data.set_quoted('CONFIG_QEMU_LOCALSTATEDIR', get_option('prefix') /
 config_host_data.set_quoted('CONFIG_QEMU_MODDIR', get_option('prefix') / qemu_moddir)
 config_host_data.set_quoted('CONFIG_SYSCONFDIR', get_option('prefix') / get_option('sysconfdir'))
 
+config_host_data.set('HOST_' + host_arch.to_upper(), 1)
+
 config_host_data.set('CONFIG_ATTR', libattr.found())
 config_host_data.set('CONFIG_BRLAPI', brlapi.found())
 config_host_data.set('CONFIG_COCOA', cocoa.found())
@@ -1770,8 +1780,6 @@ foreach k, v: config_host
       v = '"' + '", "'.join(v.split()) + '", '
     endif
     config_host_data.set(k, v)
-  elif k == 'ARCH'
-    config_host_data.set('HOST_' + v.to_upper(), 1)
   elif strings.contains(k)
     config_host_data.set_quoted(k, v)
   elif k.startswith('CONFIG_')
@@ -1914,7 +1922,7 @@ foreach target : target_dirs
   endif
 
   foreach k, v: disassemblers
-    if config_host['ARCH'].startswith(k) or config_target['TARGET_BASE_ARCH'].startswith(k)
+    if host_arch.startswith(k) or config_target['TARGET_BASE_ARCH'].startswith(k)
       foreach sym: v
         config_target += { sym: 'y' }
         config_all_disas += { sym: 'y' }
@@ -2883,7 +2891,7 @@ foreach target : target_dirs
     endif
     if 'CONFIG_LINUX_USER' in config_target
       base_dir = 'linux-user'
-      target_inc += include_directories('linux-user/host/' / config_host['ARCH'])
+      target_inc += include_directories('linux-user/host/' / host_arch)
     endif
     if 'CONFIG_BSD_USER' in config_target
       base_dir = 'bsd-user'
-- 
2.33.1




  parent reply	other threads:[~2021-12-16  8:56 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-16  8:51 [PATCH 00/10] configure cleanups, mostly wrt $cpu and $targetos Paolo Bonzini
2021-12-16  8:51 ` [PATCH 01/10] configure: simplify creation of plugin symbol list Paolo Bonzini
2021-12-17 20:42   ` Richard Henderson
2021-12-16  8:51 ` [PATCH 02/10] configure: make $targetos lowercase, use windows instead of MINGW32 Paolo Bonzini
2021-12-17 20:44   ` Richard Henderson
2021-12-16  8:51 ` [PATCH 03/10] configure: move target detection before CPU detection Paolo Bonzini
2021-12-16  8:51 ` [PATCH 04/10] configure: do not set bsd_user/linux_user early Paolo Bonzini
2021-12-17 20:49   ` Richard Henderson
2021-12-18 10:16     ` Paolo Bonzini
2021-12-16  8:51 ` [PATCH 05/10] configure: unify two case statements on $cpu Paolo Bonzini
2021-12-17 21:37   ` Richard Henderson
2021-12-16  8:51 ` [PATCH 06/10] configure: unify ppc64 and ppc64le Paolo Bonzini
2021-12-16  9:06   ` Philippe Mathieu-Daudé
2021-12-17 21:43   ` Richard Henderson
2021-12-16  8:51 ` [PATCH 07/10] configure: unify x86_64 and x32 Paolo Bonzini
2021-12-16  9:10   ` Philippe Mathieu-Daudé
2021-12-16 15:30     ` Paolo Bonzini
2021-12-17 21:48       ` Richard Henderson
2021-12-20  9:52         ` Philippe Mathieu-Daudé
2021-12-17 21:46   ` Richard Henderson
2021-12-16  8:51 ` [PATCH 08/10] meson: rename "arch" variable Paolo Bonzini
2021-12-16  9:10   ` Philippe Mathieu-Daudé
2021-12-17 21:49   ` Richard Henderson
2021-12-16  8:51 ` Paolo Bonzini [this message]
2021-12-17 22:02   ` [PATCH 09/10] configure, meson: move ARCH to meson.build Richard Henderson
2021-12-16  8:51 ` [PATCH 10/10] configure: remove unnecessary symlinks Paolo Bonzini
2021-12-17 22:03   ` Richard Henderson

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=20211216085139.99682-10-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).