[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 12/15] configure, meson: move config-poison.h to meson
From: |
Paolo Bonzini |
Subject: |
[PULL 12/15] configure, meson: move config-poison.h to meson |
Date: |
Thu, 23 Dec 2021 12:51:31 +0100 |
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 06ad8a61e1..2f80f56a4a 100644
--- a/Makefile
+++ b/Makefile
@@ -220,7 +220,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 8eb8e4c2cc..d2f12bc2d6 100755
--- a/configure
+++ b/configure
@@ -3827,17 +3827,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 993a591983..a61eb7cee5 100644
--- a/meson.build
+++ b/meson.build
@@ -2006,6 +2006,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
- [PULL 06/15] configure: simplify creation of plugin symbol list, (continued)
- [PULL 06/15] configure: simplify creation of plugin symbol list, Paolo Bonzini, 2021/12/23
- [PULL 10/15] configure: move non-command-line variables away from command-line parsing section, Paolo Bonzini, 2021/12/23
- [PULL 11/15] meson: build contrib/ executables after generated headers, Paolo Bonzini, 2021/12/23
- [PULL 04/15] meson: cleanup common-user/ build, Paolo Bonzini, 2021/12/23
- [PULL 05/15] block/file-posix: Simplify the XFS_IOC_DIOINFO handling, Paolo Bonzini, 2021/12/23
- [PULL 14/15] KVM: use KVM_{GET|SET}_SREGS2 when supported., Paolo Bonzini, 2021/12/23
- [PULL 09/15] configure: parse --enable/--disable-strip automatically, flip default, Paolo Bonzini, 2021/12/23
- [PULL 08/15] configure, makefile: remove traces of really old files, Paolo Bonzini, 2021/12/23
- [PULL 15/15] KVM: x86: ignore interrupt_bitmap field of KVM_GET/SET_SREGS, Paolo Bonzini, 2021/12/23
- [PULL 13/15] meson: add comments in the target-specific flags section, Paolo Bonzini, 2021/12/23
- [PULL 12/15] configure, meson: move config-poison.h to meson,
Paolo Bonzini <=