Commit 3b7aee23 authored by Yann E. MORIN's avatar Yann E. MORIN Committed by Peter Korsgaard
Browse files

external toolchain: fix sysroot location if the toolchain was moved



Sysrooted toolchain can be relocated. In this case, the sysroot is no
longer located at the place it was configured at.

Signed-off-by: default avatarYann E. MORIN <yann.morin.1998@anciens.enib.fr>
Acked-By: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: default avatarPeter Korsgaard <jacmet@sunsite.dk>
parent 0fd37245
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -205,7 +205,14 @@ ifeq ($(BR2_INSTALL_LIBSTDCPP),y)
EXTERNAL_LIBS+=libstdc++.so
endif

SYSROOT_DIR=$(shell LANG=C $(TARGET_CC) -v 2>&1 | grep ^Configured | tr " " "\n" | grep -- "--with-sysroot" | cut -f2 -d=)
# This dance is needed because the toolchain may have been relocated, so the
# configured paths may no longer match; fortunately, the sysroot moves along
# the toolchain, so is always at the same place relative to the toolchain's
# current location.
CFG_PREFIX_DIR=$(shell LANG=C $(TARGET_CC) -v 2>&1 | grep ^Configured | tr " " "\n" | grep -- "--prefix=" | cut -f2 -d=)
CFG_SYSROOT_DIR=$(shell LANG=C $(TARGET_CC) -v 2>&1 | grep ^Configured | tr " " "\n" | grep -- "--with-sysroot=" | cut -f2 -d=)
REL_SYSROOT_DIR=$(shell echo "$(CFG_SYSROOT_DIR)" |sed -r -e 's:^$(CFG_PREFIX_DIR)::;')
SYSROOT_DIR=$(TOOLCHAIN_EXTERNAL_PATH)/$(REL_SYSROOT_DIR)

$(STAMP_DIR)/ext-toolchain-installed:
	@echo "Checking external toolchain settings"