diff mbox

[2/3] toolchain-external: handle a special case where glibc check needs TOOLCHAIN_EXTERNAL_CFLAGS

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

Commit Message

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

Add a test to use ARCH_SYSROOT_DIR for glibc check if SYSROOT_DIR is not a
directory.

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

Patch

diff --git a/toolchain/toolchain-external/toolchain-external.mk b/toolchain/toolchain-external/toolchain-external.mk
index 8280b84..f6e51a1 100644
--- a/toolchain/toolchain-external/toolchain-external.mk
+++ b/toolchain/toolchain-external/toolchain-external.mk
@@ -477,7 +477,11 @@  define TOOLCHAIN_EXTERNAL_CONFIGURE_CMDS
 	elif test "$(BR2_TOOLCHAIN_EXTERNAL_MUSL)" = "y" ; then \
 		$(call check_musl,$${SYSROOT_DIR}) ; \
 	else \
-		$(call check_glibc,$${SYSROOT_DIR}) ; \
+		if test -d "$${SYSROOT_DIR}"  ; then \
+			$(call check_glibc,$${SYSROOT_DIR}) ; \
+		else \
+			$(call check_glibc,$${ARCH_SYSROOT_DIR}) ; \
+		fi \
 	fi
 endef