qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: [PULL 31/46] configure: move disassembler configuration to meson
Date: Fri,  4 Sep 2020 07:41:07 -0400	[thread overview]
Message-ID: <20200904114122.31307-32-pbonzini@redhat.com> (raw)
In-Reply-To: <20200904114122.31307-1-pbonzini@redhat.com>

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 .gitignore        |  1 -
 configure         | 89 -----------------------------------------------
 disas/meson.build |  4 +--
 meson.build       | 45 +++++++++++++++++++++++-
 4 files changed, 45 insertions(+), 94 deletions(-)

diff --git a/.gitignore b/.gitignore
index f3fbd87ce4..b6fdd34ddf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,7 +2,6 @@
 /build/
 /.doctrees
 /config-devices.*
-/config-all-disas.*
 /config-host.*
 /config-target.*
 /config.status
diff --git a/configure b/configure
index 8b79d6c946..2fdad3c82f 100755
--- a/configure
+++ b/configure
@@ -6605,8 +6605,6 @@ QEMU_LDFLAGS="$fdt_ldflags $QEMU_LDFLAGS"
 
 config_host_mak="config-host.mak"
 
-echo "# Automatically generated by configure - do not modify" >config-all-disas.mak
-
 echo "# Automatically generated by configure - do not modify" > $config_host_mak
 echo >> $config_host_mak
 
@@ -7907,93 +7905,6 @@ if test "$target_bsd_user" = "yes" ; then
   echo "CONFIG_BSD_USER=y" >> $config_target_mak
 fi
 
-
-# generate QEMU_CFLAGS/QEMU_LDFLAGS for targets
-
-disas_config() {
-  echo "CONFIG_${1}_DIS=y" >> $config_target_mak
-  echo "CONFIG_${1}_DIS=y" >> config-all-disas.mak
-}
-
-for i in $ARCH $TARGET_BASE_ARCH ; do
-  case "$i" in
-  alpha)
-    disas_config "ALPHA"
-  ;;
-  aarch64)
-    if test -n "${cxx}"; then
-      disas_config "ARM_A64"
-    fi
-  ;;
-  arm)
-    disas_config "ARM"
-    if test -n "${cxx}"; then
-      disas_config "ARM_A64"
-    fi
-  ;;
-  avr)
-    disas_config "AVR"
-  ;;
-  cris)
-    disas_config "CRIS"
-  ;;
-  hppa)
-    disas_config "HPPA"
-  ;;
-  i386|x86_64|x32)
-    disas_config "I386"
-  ;;
-  lm32)
-    disas_config "LM32"
-  ;;
-  m68k)
-    disas_config "M68K"
-  ;;
-  microblaze*)
-    disas_config "MICROBLAZE"
-  ;;
-  mips*)
-    disas_config "MIPS"
-    if test -n "${cxx}"; then
-      disas_config "NANOMIPS"
-    fi
-  ;;
-  moxie*)
-    disas_config "MOXIE"
-  ;;
-  nios2)
-    disas_config "NIOS2"
-  ;;
-  or1k)
-    disas_config "OPENRISC"
-  ;;
-  ppc*)
-    disas_config "PPC"
-  ;;
-  riscv*)
-    disas_config "RISCV"
-  ;;
-  rx)
-    disas_config "RX"
-  ;;
-  s390*)
-    disas_config "S390"
-  ;;
-  sh4)
-    disas_config "SH4"
-  ;;
-  sparc*)
-    disas_config "SPARC"
-  ;;
-  xtensa*)
-    disas_config "XTENSA"
-  ;;
-  esac
-done
-if test "$tcg_interpreter" = "yes" ; then
-  disas_config "TCI"
-fi
-
 done # for target in $targets
 
 if [ "$fdt" = "git" ]; then
diff --git a/disas/meson.build b/disas/meson.build
index 0527d69128..bde8280c73 100644
--- a/disas/meson.build
+++ b/disas/meson.build
@@ -22,6 +22,4 @@ common_ss.add(when: 'CONFIG_SH4_DIS', if_true: files('sh4.c'))
 common_ss.add(when: 'CONFIG_SPARC_DIS', if_true: files('sparc.c'))
 common_ss.add(when: 'CONFIG_XTENSA_DIS', if_true: files('xtensa.c'))
 
-# TODO: As long as the TCG interpreter and its generated code depend
-# on the QEMU target, we cannot compile the disassembler here.
-#common_ss.add(when: 'CONFIG_TCI_DIS', if_true: files('tci.c'))
+specific_ss.add(when: 'CONFIG_TCG_INTERPRETER', if_true: files('tci.c'))
diff --git a/meson.build b/meson.build
index 037ccd3f4c..84a3e610e7 100644
--- a/meson.build
+++ b/meson.build
@@ -14,7 +14,6 @@ ss = import('sourceset')
 sh = find_program('sh')
 cc = meson.get_compiler('c')
 config_host = keyval.load(meson.current_build_dir() / 'config-host.mak')
-config_all_disas = keyval.load(meson.current_build_dir() / 'config-all-disas.mak')
 enable_modules = 'CONFIG_MODULES' in config_host
 enable_static = 'CONFIG_STATIC' in config_host
 build_docs = 'BUILD_DOCS' in config_host
@@ -456,10 +455,44 @@ genh += configure_file(output: 'config-host.h', configuration: config_host_data)
 
 minikconf = find_program('scripts/minikconf.py')
 config_all_devices = {}
+config_all_disas = {}
 config_devices_mak_list = []
 config_devices_h = {}
 config_target_h = {}
 config_target_mak = {}
+
+disassemblers = {
+  'alpha' : ['CONFIG_ALPHA_DIS'],
+  'arm' : ['CONFIG_ARM_DIS'],
+  'avr' : ['CONFIG_AVR_DIS'],
+  'cris' : ['CONFIG_CRIS_DIS'],
+  'hppa' : ['CONFIG_HPPA_DIS'],
+  'i386' : ['CONFIG_I386_DIS'],
+  'x86_64' : ['CONFIG_I386_DIS'],
+  'x32' : ['CONFIG_I386_DIS'],
+  'lm32' : ['CONFIG_LM32_DIS'],
+  'm68k' : ['CONFIG_M68K_DIS'],
+  'microblaze' : ['CONFIG_MICROBLAZE_DIS'],
+  'mips' : ['CONFIG_MIPS_DIS'],
+  'moxie' : ['CONFIG_MOXIE_DIS'],
+  'nios2' : ['CONFIG_NIOS2_DIS'],
+  'or1k' : ['CONFIG_OPENRISC_DIS'],
+  'ppc' : ['CONFIG_PPC_DIS'],
+  'riscv' : ['CONFIG_RISCV_DIS'],
+  'rx' : ['CONFIG_RX_DIS'],
+  's390' : ['CONFIG_S390_DIS'],
+  'sh4' : ['CONFIG_SH4_DIS'],
+  'sparc' : ['CONFIG_SPARC_DIS'],
+  'xtensa' : ['CONFIG_XTENSA_DIS'],
+}
+if link_language == 'cpp'
+  disassemblers += {
+    'aarch64' : [ 'CONFIG_ARM_A64_DIS'],
+    'arm' : [ 'CONFIG_ARM_DIS', 'CONFIG_ARM_A64_DIS'],
+    'mips' : [ 'CONFIG_MIPS_DIS', 'CONFIG_NANOMIPS_DIS'],
+  }
+endif
+
 kconfig_external_symbols = [
   'CONFIG_KVM',
   'CONFIG_XEN',
@@ -475,9 +508,19 @@ kconfig_external_symbols = [
   'CONFIG_PVRDMA',
 ]
 ignored = ['TARGET_XML_FILES', 'TARGET_ABI_DIR', 'TARGET_DIRS']
+
 foreach target : target_dirs
   config_target = keyval.load(meson.current_build_dir() / target / 'config-target.mak')
 
+  foreach k, v: disassemblers
+    if config_host['ARCH'].startswith(k) or config_target['TARGET_BASE_ARCH'].startswith(k)
+      foreach sym: v
+        config_target += { sym: 'y' }
+        config_all_disas += { sym: 'y' }
+      endforeach
+    endif
+  endforeach
+
   config_target_data = configuration_data()
   foreach k, v: config_target
     if not k.startswith('TARGET_') and not k.startswith('CONFIG_')
-- 
2.26.2




  parent reply	other threads:[~2020-09-04 11:55 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-04 11:40 [PULL 00/46] Next round of Meson bugfixes and cleanups Paolo Bonzini
2020-09-04 11:40 ` [PULL 01/46] qemu-iotests: move check-block back to Makefiles Paolo Bonzini
2020-09-04 11:40 ` [PULL 02/46] tests/Makefile: test-image-locking needs CONFIG_POSIX Paolo Bonzini
2020-09-04 11:40 ` [PULL 03/46] tests: handling signal on win32 properly Paolo Bonzini
2020-09-04 11:40 ` [PULL 04/46] mtest2make: split environment from test command Paolo Bonzini
2020-09-04 11:40 ` [PULL 05/46] mtest2make: split working directory " Paolo Bonzini
2020-09-04 11:40 ` [PULL 06/46] mtest2make: hide output of successful tests Paolo Bonzini
2020-09-04 11:40 ` [PULL 07/46] mtest2make: unify tests that appear in multiple suites Paolo Bonzini
2020-09-04 11:40 ` [PULL 08/46] meson: remove b_lundef option Paolo Bonzini
2020-09-04 11:40 ` [PULL 09/46] configure: do not include absolute paths in -I and -L paths Paolo Bonzini
2020-09-04 11:40 ` [PULL 10/46] configure: include cross sdl2-config in meson cross file Paolo Bonzini
2020-09-04 11:40 ` [PULL 11/46] ninjatool: use constant names for stamp files Paolo Bonzini
2020-09-04 11:40 ` [PULL 12/46] meson: fix libqos linking Paolo Bonzini
2020-09-04 11:40 ` [PULL 13/46] meson: build qapi tests library Paolo Bonzini
2020-09-04 11:40 ` [PULL 14/46] meson: declare tasn1 dependency Paolo Bonzini
2020-09-04 11:40 ` [PULL 15/46] meson: declare keyutils dependency Paolo Bonzini
2020-09-04 11:40 ` [PULL 16/46] meson: convert qht-bench Paolo Bonzini
2020-09-04 11:40 ` [PULL 17/46] meson: convert the unit tests Paolo Bonzini
2020-09-04 11:40 ` [PULL 18/46] meson: move keyutils dependency check Paolo Bonzini
2020-09-04 11:40 ` [PULL 19/46] meson: remove old socket_scm_helper rule Paolo Bonzini
2020-09-04 11:40 ` [PULL 20/46] meson: convert vhost-user-bridge Paolo Bonzini
2020-09-04 11:40 ` [PULL 21/46] meson: convert atomic*-bench Paolo Bonzini
2020-09-04 11:40 ` [PULL 22/46] tests: do not print benchmark output to stdout Paolo Bonzini
2020-09-04 11:40 ` [PULL 23/46] meson: convert the speed tests Paolo Bonzini
2020-09-04 11:41 ` [PULL 24/46] tests/migration/stress: remove unused exit_success Paolo Bonzini
2020-09-04 11:41 ` [PULL 25/46] meson: fix migration/stress compilation with glibc>=2.30 Paolo Bonzini
2020-09-04 11:41 ` [PULL 26/46] meson: convert migration/initrd-stress Paolo Bonzini
2020-09-04 11:41 ` [PULL 27/46] configure: remove dead code for in-tree builds Paolo Bonzini
2020-09-04 11:41 ` [PULL 28/46] meson: compute config_all_devices directly Paolo Bonzini
2020-09-04 11:41 ` [PULL 29/46] Makefile: remove dead variables and includes Paolo Bonzini
2020-09-04 11:41 ` [PULL 30/46] Makefile: inline the relevant parts of rules.mak Paolo Bonzini
2020-09-04 11:41 ` Paolo Bonzini [this message]
2020-09-04 11:41 ` [PULL 32/46] configure: move C++ compiler handling to meson Paolo Bonzini
2020-09-04 11:41 ` [PULL 33/46] meson: keep all compiler flags detection together Paolo Bonzini
2020-09-04 11:41 ` [PULL 34/46] configure: move -ldl test to meson Paolo Bonzini
2020-09-04 11:41 ` [PULL 35/46] configure: remove unnecessary libm test Paolo Bonzini
2020-09-04 11:41 ` [PULL 36/46] configure: do not look for install(1) Paolo Bonzini
2020-09-04 11:41 ` [PULL 37/46] meson: get glib compilation flags from GLIB_CFLAGS Paolo Bonzini
2020-09-04 11:41 ` [PULL 38/46] configure: do not include dependency flags in QEMU_CFLAGS and LIBS Paolo Bonzini
2020-09-04 11:41 ` [PULL 39/46] configure: drop dead variables and functions Paolo Bonzini
2020-09-04 11:41 ` [PULL 40/46] docs: suggest Meson replacements for various configure functions Paolo Bonzini
2020-09-04 11:41 ` [PULL 41/46] configure: update dtc submodule Paolo Bonzini
2020-09-04 11:41 ` [PULL 42/46] oss-fuzz: fix rpath Paolo Bonzini
2020-09-04 11:41 ` [PULL 43/46] meson: specify fuzz linker script as a project arg Paolo Bonzini
2020-09-04 11:41 ` [PULL 44/46] fuzz: Add support for custom fuzzing library Paolo Bonzini
2020-09-04 11:41 ` [PULL 45/46] meson: Convert undefsym.sh to undefsym.py Paolo Bonzini
2020-09-04 11:41 ` [PULL 46/46] meson: remove linkage of sdl to baum Paolo Bonzini
2020-09-06 15:23 ` [PULL 00/46] Next round of Meson bugfixes and cleanups 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=20200904114122.31307-32-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).