summaryrefslogtreecommitdiff
path: root/toolchain/helpers.mk
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2011-05-08 18:52:27 +0200
committerPeter Korsgaard <jacmet@sunsite.dk>2011-05-08 21:56:10 +0200
commitc59d0247541a85c62227b79d4fdb77405c4e6c99 (patch)
treed2fb55d1d3d4734b6fad7debf88d4359b873587b /toolchain/helpers.mk
parent8451c2329e000baf64c986889e8d5b3ac1c8d698 (diff)
external-toolchain: fix support
The recent commit adding the external toolchain wrapper has broken the support for external toolchain. The check_arm_eabi, check_cplusplus and check_cross_compiler_exists functions were using TARGET_CC, which points to the toolchain wrapper, but at the moment those functions are called, the wrapper hasn't been generated yet. We fix this by passing to these functions the path to the C or C++ compiler they should use for their tests. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'toolchain/helpers.mk')
-rw-r--r--toolchain/helpers.mk17
1 files changed, 13 insertions, 4 deletions
diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk
index db7c7f1c5..13dbebbee 100644
--- a/toolchain/helpers.mk
+++ b/toolchain/helpers.mk
@@ -201,8 +201,11 @@ check_uclibc = \
# Check that the Buildroot configuration of the ABI matches the
# configuration of the external toolchain.
#
+# $1: cross-gcc path
+#
check_arm_abi = \
- EXT_TOOLCHAIN_TARGET=$(shell LANG=C $(TARGET_CC) -v 2>&1 | grep ^Target | cut -f2 -d ' ') ; \
+ __CROSS_CC=$(strip $1) ; \
+ EXT_TOOLCHAIN_TARGET=`LANG=C $${__CROSS_CC} -v 2>&1 | grep ^Target | cut -f2 -d ' '` ; \
if echo $${EXT_TOOLCHAIN_TARGET} | grep -q 'eabi$$' ; then \
EXT_TOOLCHAIN_ABI="eabi" ; \
else \
@@ -220,8 +223,11 @@ check_arm_abi = \
#
# Check that the external toolchain supports C++
#
+# $1: cross-g++ path
+#
check_cplusplus = \
- $(TARGET_CXX) -v > /dev/null 2>&1 ; \
+ __CROSS_CXX=$(strip $1) ; \
+ $${__CROSS_CXX} -v > /dev/null 2>&1 ; \
if test $$? -ne 0 ; then \
echo "C++ support is selected but is not available in external toolchain" ; \
exit 1 ; \
@@ -230,9 +236,12 @@ check_cplusplus = \
#
# Check that the cross-compiler given in the configuration exists
#
+# $1: cross-gcc path
+#
check_cross_compiler_exists = \
- $(TARGET_CC) -v > /dev/null 2>&1 ; \
+ __CROSS_CC=$(strip $1) ; \
+ $${__CROSS_CC} -v > /dev/null 2>&1 ; \
if test $$? -ne 0 ; then \
- echo "Cannot execute cross-compiler '$(TARGET_CC)'" ; \
+ echo "Cannot execute cross-compiler '$${__CROSS_CC}'" ; \
exit 1 ; \
fi