diff mbox

[3/3] toolchain-external: fix Sourcery Codebench symlink

Message ID 1405277160-4686-4-git-send-email-romain.naour@openwide.fr
State Changes Requested
Headers show

Commit Message

Romain Naour July 13, 2014, 6:46 p.m. UTC
With the Sourcery Codebench standard edition, the sysroot returned
point to a non existant directory if no CFLAGS is specified.

When copying external toolchain sysroot to staging, we need to
create the symbolic link that matches the name of the subdirectory
for the architecture variant in the original sysroot (ie: sgxx-glibc)

To do that, SYSROOT_DIR must be different than ARCH_SYSROOT_DIR.
So, set SYSROOT_DIR deduced from ARCH_SYSROOT_DIR  by removing
arch specific part at the end of the path.

Signed-off-by: Romain Naour <romain.naour@openwide.fr>
---
 toolchain/toolchain-external/toolchain-external.mk | 3 +++
 1 file changed, 3 insertions(+)
diff mbox

Patch

diff --git a/toolchain/toolchain-external/toolchain-external.mk b/toolchain/toolchain-external/toolchain-external.mk
index f6e51a1..212fbc9 100644
--- a/toolchain/toolchain-external/toolchain-external.mk
+++ b/toolchain/toolchain-external/toolchain-external.mk
@@ -555,6 +555,9 @@  define TOOLCHAIN_EXTERNAL_INSTALL_CORE
 		exit 1 ; \
 	fi ; \
 	ARCH_SYSROOT_DIR="$(call toolchain_find_sysroot,$(TOOLCHAIN_EXTERNAL_CC) $(TOOLCHAIN_EXTERNAL_CFLAGS))" ; \
+	if test ! -d "$${SYSROOT_DIR}"  ; then \
+		SYSROOT_DIR=$$(echo -n "$${ARCH_SYSROOT_DIR}" | sed -r 's:(/libc/)([^&]*):\1:') ; \
+	fi ; \
 	ARCH_LIB_DIR="$(call toolchain_find_libdir,$(TOOLCHAIN_EXTERNAL_CC) $(TOOLCHAIN_EXTERNAL_CFLAGS))" ; \
 	SUPPORT_LIB_DIR="" ; \
 	if test `find $${ARCH_SYSROOT_DIR} -name 'libstdc++.a' | wc -l` -eq 0 ; then \