All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: [PULL 11/18] configure, meson: move config-poison.h to meson
Date: Mon, 10 Jan 2022 15:40:27 +0100	[thread overview]
Message-ID: <20220110144034.67410-12-pbonzini@redhat.com> (raw)
In-Reply-To: <20220110144034.67410-1-pbonzini@redhat.com>

This ensures that the file is regenerated properly whenever config-target.h
or config-devices.h files change.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 Makefile                      |  2 +-
 configure                     | 11 -----------
 meson.build                   | 12 ++++++++++++
 scripts/make-config-poison.sh | 16 ++++++++++++++++
 4 files changed, 29 insertions(+), 12 deletions(-)
 create mode 100755 scripts/make-config-poison.sh

diff --git a/Makefile b/Makefile
index 8037f73b35..9e2e3bf004 100644
--- a/Makefile
+++ b/Makefile
@@ -221,7 +221,7 @@ qemu-%.tar.bz2:
 
 distclean: clean
 	-$(quiet-@)test -f build.ninja && $(NINJA) $(NINJAFLAGS) -t clean -g || :
-	rm -f config-host.mak config-poison.h
+	rm -f config-host.mak
 	rm -f tests/tcg/config-*.mak
 	rm -f config.status
 	rm -f roms/seabios/config.mak
diff --git a/configure b/configure
index 56c113bd83..0026388343 100755
--- a/configure
+++ b/configure
@@ -3834,17 +3834,6 @@ if test -n "${deprecated_features}"; then
     echo "  features: ${deprecated_features}"
 fi
 
-# Create list of config switches that should be poisoned in common code...
-# but filter out CONFIG_TCG and CONFIG_USER_ONLY which are special.
-target_configs_h=$(ls *-config-devices.h *-config-target.h 2>/dev/null)
-if test -n "$target_configs_h" ; then
-    sed -n -e '/CONFIG_TCG/d' -e '/CONFIG_USER_ONLY/d' \
-        -e '/^#define / { s///; s/ .*//; s/^/#pragma GCC poison /p; }' \
-        $target_configs_h | sort -u > config-poison.h
-else
-    :> config-poison.h
-fi
-
 # Save the configure command line for later reuse.
 cat <<EOD >config.status
 #!/bin/sh
diff --git a/meson.build b/meson.build
index 5a57906e98..36fc720ba3 100644
--- a/meson.build
+++ b/meson.build
@@ -2028,6 +2028,18 @@ config_all += {
   'CONFIG_ALL': true,
 }
 
+target_configs_h = []
+foreach target: target_dirs
+  target_configs_h += config_target_h[target]
+  target_configs_h += config_devices_h.get(target, [])
+endforeach
+genh += custom_target('config-poison.h',
+                      input: [target_configs_h],
+                      output: 'config-poison.h',
+                      capture: true,
+                      command: [find_program('scripts/make-config-poison.sh'),
+                                target_configs_h])
+
 ##############
 # Submodules #
 ##############
diff --git a/scripts/make-config-poison.sh b/scripts/make-config-poison.sh
new file mode 100755
index 0000000000..d222a04304
--- /dev/null
+++ b/scripts/make-config-poison.sh
@@ -0,0 +1,16 @@
+#! /bin/sh
+
+if test $# = 0; then
+  exit 0
+fi
+
+# Create list of config switches that should be poisoned in common code...
+# but filter out CONFIG_TCG and CONFIG_USER_ONLY which are special.
+exec sed -n \
+  -e' /CONFIG_TCG/d' \
+  -e '/CONFIG_USER_ONLY/d' \
+  -e '/^#define / {' \
+  -e    's///' \
+  -e    's/ .*//' \
+  -e    's/^/#pragma GCC poison /p' \
+  -e '}' "$@"
-- 
2.33.1




  parent reply	other threads:[~2022-01-10 15:11 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-10 14:40 [PULL v4 00/18] Build system and KVM changes for 2021-12-23 Paolo Bonzini
2022-01-10 14:40 ` [PULL 01/18] meson: reuse common_user_inc when building files specific to user-mode emulators Paolo Bonzini
2022-01-10 14:40 ` [PULL 02/18] user: move common-user includes to a subdirectory of {bsd, linux}-user/ Paolo Bonzini
2022-01-10 14:40 ` [PULL 03/18] meson: cleanup common-user/ build Paolo Bonzini
2022-01-10 14:40 ` [PULL 04/18] block/file-posix: Simplify the XFS_IOC_DIOINFO handling Paolo Bonzini
2022-01-10 14:40 ` [PULL 05/18] configure: simplify creation of plugin symbol list Paolo Bonzini
2022-01-10 14:40 ` [PULL 06/18] configure: do not set bsd_user/linux_user early Paolo Bonzini
2022-01-10 14:40 ` [PULL 07/18] configure, makefile: remove traces of really old files Paolo Bonzini
2022-01-10 14:40 ` [PULL 08/18] configure: parse --enable/--disable-strip automatically, flip default Paolo Bonzini
2022-01-10 14:40 ` [PULL 09/18] configure: move non-command-line variables away from command-line parsing section Paolo Bonzini
2022-01-10 14:40 ` [PULL 10/18] meson: build contrib/ executables after generated headers Paolo Bonzini
2022-01-10 14:40 ` Paolo Bonzini [this message]
2022-01-10 14:40 ` [PULL 12/18] meson: add comments in the target-specific flags section Paolo Bonzini
2022-01-10 14:40 ` [PULL 13/18] KVM: use KVM_{GET|SET}_SREGS2 when supported Paolo Bonzini
2022-01-10 14:40 ` [PULL 14/18] KVM: x86: ignore interrupt_bitmap field of KVM_GET/SET_SREGS Paolo Bonzini
2022-01-10 14:40 ` [PULL 15/18] tests/tcg: Fix target-specific Makefile variables path for user-mode Paolo Bonzini
2022-01-10 14:40 ` [PULL 16/18] configure: do not create roms/seabios/config.mak if SeaBIOS not present Paolo Bonzini
2022-01-10 14:40 ` [PULL 17/18] meson: build all modules by default Paolo Bonzini
2022-01-10 14:40 ` [PULL 18/18] meson: reenable filemonitor-inotify compilation Paolo Bonzini
2022-01-11 10:12 ` [PULL v4 00/18] Build system and KVM changes for 2021-12-23 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=20220110144034.67410-12-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.