summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2009-07-17 08:53:55 +0200
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2009-07-17 08:53:55 +0200
commit901b468e24ff546760ffdf6456d731f6388bad00 (patch)
tree6900f9bdcbeb015c093522b94eb385c022fb123e
parent82bf777ed73f449587aea59a6ce5b41164a6819f (diff)
external toolchain: check cross-compiler existence
As a minimal test to the external toolchain, check that $(TARGET_CC) is actually an existing executable file. That way, if the user misconfigures the toolchain path and/or prefix, a meaningful error message will be shown. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-rw-r--r--toolchain/external-toolchain/ext-tool.mk10
1 files changed, 10 insertions, 0 deletions
diff --git a/toolchain/external-toolchain/ext-tool.mk b/toolchain/external-toolchain/ext-tool.mk
index c9692a1ab..d441a9252 100644
--- a/toolchain/external-toolchain/ext-tool.mk
+++ b/toolchain/external-toolchain/ext-tool.mk
@@ -181,6 +181,15 @@ check_arm_abi = \
exit 1 ; \
fi ; \
+#
+# Check that the cross-compiler given in the configuration exists
+#
+check_cross_compiler_exists = \
+ if ! test -x $(TARGET_CC) ; then \
+ echo "Cannot find cross-compiler $(TARGET_CC)" ; \
+ exit 1 ; \
+ fi ; \
+
uclibc: dependencies $(STAMP_DIR)/ext-toolchain-installed
EXTERNAL_LIBS=libc.so libcrypt.so libdl.so libgcc_s.so libm.so libnsl.so libpthread.so libresolv.so librt.so libutil.so
@@ -198,6 +207,7 @@ SYSROOT_DIR=$(shell LANG=C $(TARGET_CC) -v 2>&1 | grep ^Configured | tr " " "\n"
$(STAMP_DIR)/ext-toolchain-installed:
@echo "Checking external toolchain settings"
+ $(Q)$(call check_cross_compiler_exists)
ifeq ($(strip $(SYSROOT_DIR)),)
@echo "External toolchain doesn't support --sysroot. Cannot use."
exit 1