[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v8 04/10] configure: Generate rule to calculate the base architec
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v8 04/10] configure: Generate rule to calculate the base architecture of a target |
Date: |
Mon, 8 Jun 2020 18:38:17 +0200 |
From: Alex Bennée <alex.bennee@linaro.org>
As we encode the base architecture in configure.sh, we can emit
the base-arch() function into config-host.mak.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
configure | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/configure b/configure
index 597e909b53..b48eb893f8 100755
--- a/configure
+++ b/configure
@@ -7756,6 +7756,8 @@ if test "$linux" = "yes" ; then
fi
fi
+target_to_base_map=""
+
for target in $target_list; do
target_dir="$target"
config_target_mak=$target_dir/config-target.mak
@@ -7984,6 +7986,7 @@ target_arch_name="$(upper $TARGET_ARCH)"
echo "TARGET_$target_arch_name=y" >> $config_target_mak
echo "TARGET_NAME=$target_name" >> $config_target_mak
echo "TARGET_BASE_ARCH=$TARGET_BASE_ARCH" >> $config_target_mak
+target_to_base_map="$target_dir,$TARGET_BASE_ARCH $target_to_base_map"
if [ "$TARGET_ABI_DIR" = "" ]; then
TARGET_ABI_DIR=$TARGET_ARCH
fi
@@ -8199,6 +8202,22 @@ if test "$ccache_cpp2" = "yes"; then
echo "export CCACHE_CPP2=y" >> $config_host_mak
fi
+# Export a rule for calculating base arch from target_dir for use by
+# the Kconfig generator
+echo "# Usage: \$(call base-arch, target-dir)" >> $config_host_mak
+echo "# Return the base architecture for a target." >> $config_host_mak
+echo "# e.g \$(call base-arch, aarch64-linux-user) returns 'arm'" >>
$config_host_mak
+echo "base-arch = \$(strip \\" >> $config_host_mak
+close_braces=""
+for pairs in $target_to_base_map
+do
+ dir="${pairs%%,*}"
+ base="${pairs#*,}"
+ echo "\$(if \$(findstring $dir,\$1),$base, \\" >> $config_host_mak
+ close_braces="$close_braces )"
+done
+echo "$close_braces )" >> $config_host_mak
+
# If we're using a separate build tree, set it up now.
# DIRS are directories which we simply mkdir in the build tree;
# LINKS are things to symlink back into the source tree
--
2.21.3
- [PATCH v8 00/10] accel: Allow targets to use Kconfig, Philippe Mathieu-Daudé, 2020/06/08
- [PATCH v8 01/10] MAINTAINERS: Fix KVM path expansion glob, Philippe Mathieu-Daudé, 2020/06/08
- [PATCH v8 02/10] MAINTAINERS: Add an 'overall' entry for accelerators, Philippe Mathieu-Daudé, 2020/06/08
- [PATCH v8 03/10] MAINTAINERS: Cover the HAX accelerator stub, Philippe Mathieu-Daudé, 2020/06/08
- [PATCH v8 04/10] configure: Generate rule to calculate the base architecture of a target,
Philippe Mathieu-Daudé <=
- [PATCH v8 06/10] Makefile: Write MINIKCONF variables as one entry per line, Philippe Mathieu-Daudé, 2020/06/08
- [PATCH v8 07/10] accel/Kconfig: Extract accel selectors into their own config, Philippe Mathieu-Daudé, 2020/06/08
- [PATCH v8 09/10] Makefile: Allow target-specific optional Kconfig, Philippe Mathieu-Daudé, 2020/06/08
- [PATCH v8 05/10] Makefile: Remove dangerous EOL trailing backslash, Philippe Mathieu-Daudé, 2020/06/08
- [PATCH v8 08/10] accel/Kconfig: Add the TCG selector, Philippe Mathieu-Daudé, 2020/06/08
- [PATCH v8 10/10] accel/tcg: Add stub for probe_access(), Philippe Mathieu-Daudé, 2020/06/08
- Re: [PATCH v8 00/10] accel: Allow targets to use Kconfig, Philippe Mathieu-Daudé, 2020/06/15