# 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 \
#
# 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 ; \
#
# 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
TOOLCHAIN_EXTERNAL_CROSS=$(TOOLCHAIN_EXTERNAL_BIN)/$(TOOLCHAIN_EXTERNAL_PREFIX)-
TOOLCHAIN_EXTERNAL_CC=$(TOOLCHAIN_EXTERNAL_CROSS)gcc
+TOOLCHAIN_EXTERNAL_CXX=$(TOOLCHAIN_EXTERNAL_CROSS)g++
TOOLCHAIN_EXTERNAL_WRAPPER_ARGS = \
-DBR_CROSS_PATH='"$(TOOLCHAIN_EXTERNAL_BIN)/"' \
-DBR_SYSROOT='"$(STAGING_DIR)"'
# type of C library and all C library features.
$(STAMP_DIR)/ext-toolchain-checked:
@echo "Checking external toolchain settings"
- $(Q)$(call check_cross_compiler_exists)
+ $(Q)$(call check_cross_compiler_exists,$(TOOLCHAIN_EXTERNAL_CC))
$(Q)SYSROOT_DIR=`$(TOOLCHAIN_EXTERNAL_CC) -print-sysroot 2>/dev/null` ; \
if test -z "$${SYSROOT_DIR}" ; then \
SYSROOT_DIR=`readlink -f $$(LANG=C $(TOOLCHAIN_EXTERNAL_CC) -print-file-name=libc.a) |sed -r -e 's:usr/lib/libc\.a::;'` ; \
exit 1 ; \
fi ; \
if test x$(BR2_arm) == x"y" ; then \
- $(call check_arm_abi) ; \
+ $(call check_arm_abi,$(TOOLCHAIN_EXTERNAL_CC)) ; \
fi ; \
if test x$(BR2_INSTALL_LIBSTDCPP) == x"y" ; then \
- $(call check_cplusplus) ; \
+ $(call check_cplusplus,$(TOOLCHAIN_EXTERNAL_CXX)) ; \
fi ; \
if test x$(BR2_TOOLCHAIN_EXTERNAL_UCLIBC) == x"y" ; then \
$(call check_uclibc,$${SYSROOT_DIR}) ; \