[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v1 20/33] configure: handle host compiler in probe_target_compile
From: |
Alex Bennée |
Subject: |
[PATCH v1 20/33] configure: handle host compiler in probe_target_compiler |
Date: |
Fri, 27 May 2022 16:35:50 +0100 |
From: Paolo Bonzini <pbonzini@redhat.com>
In preparation for handling more binaries than just cc, handle
the case of "probe_target_compiler $cpu" directly in the function,
setting the target_* variables based on the ones that are used to
build QEMU. The clang check also needs to be moved after this
fallback.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220517092616.1272238-10-pbonzini@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
configure | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/configure b/configure
index 31c1ab2579..addbb0fe44 100755
--- a/configure
+++ b/configure
@@ -954,10 +954,6 @@ case $git_submodules_action in
;;
esac
-if eval test -z "\${cross_cc_$cpu}"; then
- eval "cross_cc_${cpu}=\$cc"
-fi
-
default_target_list=""
mak_wilds=""
@@ -2003,13 +1999,6 @@ probe_target_compiler() {
if eval test -n "\"\${cross_cc_$1}\""; then
if eval has "\"\${cross_cc_$1}\""; then
eval "target_cc=\"\${cross_cc_$1}\""
- case $1 in
- i386|x86_64)
- if $target_cc --version | grep -qi "clang"; then
- unset target_cc
- fi
- ;;
- esac
fi
fi
if eval test -n "\"\${cross_as_$1}\""; then
@@ -2022,6 +2011,20 @@ probe_target_compiler() {
eval "target_ld=\"\${cross_ld_$1}\""
fi
fi
+ if test "$1" = $cpu; then
+ : ${target_cc:=$cc}
+ : ${target_as:=$as}
+ : ${target_ld:=$ld}
+ fi
+ if test -n "$target_cc"; then
+ case $1 in
+ i386|x86_64)
+ if $target_cc --version | grep -qi "clang"; then
+ unset target_cc
+ fi
+ ;;
+ esac
+ fi
}
write_target_makefile() {
--
2.30.2
- [PATCH v1 14/33] build: add a more generic way to specify make->ninja dependencies, (continued)
- [PATCH v1 14/33] build: add a more generic way to specify make->ninja dependencies, Alex Bennée, 2022/05/27
- [PATCH v1 07/33] tests/docker: update debian-armel-cross with lcitool, Alex Bennée, 2022/05/27
- [PATCH v1 26/33] configure: enable cross compilation of vof, Alex Bennée, 2022/05/27
- [PATCH v1 18/33] tests/tcg: merge configure.sh back into main configure script, Alex Bennée, 2022/05/27
- [PATCH v1 17/33] tests/tcg: correct target CPU for sparc32, Alex Bennée, 2022/05/27
- [PATCH v1 29/33] gitlab: convert Cirrus jobs to .base_job_template, Alex Bennée, 2022/05/27
- [PATCH v1 15/33] build: do a full build before running TCG tests, Alex Bennée, 2022/05/27
- [PATCH v1 27/33] configure: remove unused variables from config-host.mak, Alex Bennée, 2022/05/27
- [PATCH v1 20/33] configure: handle host compiler in probe_target_compiler,
Alex Bennée <=
- [PATCH v1 23/33] configure: move symlink configuration earlier, Alex Bennée, 2022/05/27
- [PATCH v1 25/33] configure: enable cross-compilation of optionrom, Alex Bennée, 2022/05/27
- [PATCH v1 13/33] build: clean up ninja invocation, Alex Bennée, 2022/05/27
- [PATCH v1 11/33] tests/docker: update debian-amd64 with lcitool, Alex Bennée, 2022/05/27
- [PATCH v1 33/33] docs/devel: clean-up the CI links in the docs, Alex Bennée, 2022/05/27
- [PATCH v1 24/33] configure: enable cross-compilation of s390-ccw, Alex Bennée, 2022/05/27