summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2012-01-18 04:03:15 +0000
committerJo-Philipp Wich <jow@openwrt.org>2012-01-18 04:03:15 +0000
commit989c73848f2d643bbf47df00230e7012b77f182a (patch)
tree75f9eeca52a18f8cadfaec13a8e19a74e0539130 /scripts
parent25630dd5a56e3899a60247a7f63d490135d7dba0 (diff)
downloadmtk-20170518-989c73848f2d643bbf47df00230e7012b77f182a.zip
mtk-20170518-989c73848f2d643bbf47df00230e7012b77f182a.tar.gz
mtk-20170518-989c73848f2d643bbf47df00230e7012b77f182a.tar.bz2
ext-toolchain.sh: properly handle toolchains without sysroot support
SVN-Revision: 29772
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/ext-toolchain.sh15
1 files changed, 6 insertions, 9 deletions
diff --git a/scripts/ext-toolchain.sh b/scripts/ext-toolchain.sh
index 7283bf9..26dc198 100755
--- a/scripts/ext-toolchain.sh
+++ b/scripts/ext-toolchain.sh
@@ -89,9 +89,9 @@ test_softfloat() {
test_uclibc() {
local sysroot="$("$CC" $CFLAGS -print-sysroot 2>/dev/null)"
- if [ -d "$sysroot" ]; then
+ if [ -d "${sysroot:-$TOOLCHAIN}" ]; then
local lib
- for lib in "$sysroot"/{lib,usr/lib,usr/local/lib}/ld-uClibc*.so*; do
+ for lib in "${sysroot:-$TOOLCHAIN}"/{lib,usr/lib,usr/local/lib}/ld-uClibc*.so*; do
if [ -f "$lib" ] && [ ! -h "$lib" ]; then
return 0
fi
@@ -124,7 +124,7 @@ test_feature() {
local inc
local sysroot="$("$CC" "$@" -muclibc -print-sysroot 2>/dev/null)"
for inc in "include" "usr/include" "usr/local/include"; do
- local conf="$sysroot/$inc/bits/uClibc_config.h"
+ local conf="${sysroot:-$TOOLCHAIN}/$inc/bits/uClibc_config.h"
if [ -f "$conf" ]; then
case "$feature" in
lfs) grep -q '__UCLIBC_HAS_LFS__ 1' "$conf"; return $?;;
@@ -174,12 +174,9 @@ find_bins() {
local bindir bindirs
for bindir in $(
- echo "$sysroot/bin";
- echo "$sysroot/usr/bin";
- echo "$sysroot/usr/local/bin";
- echo "$TOOLCHAIN/bin";
- echo "$TOOLCHAIN/usr/bin";
- echo "$TOOLCHAIN/usr/local/bin";
+ echo "${sysroot:-$TOOLCHAIN}/bin";
+ echo "${sysroot:-$TOOLCHAIN}/usr/bin";
+ echo "${sysroot:-$TOOLCHAIN}/usr/local/bin";
"$CPP" $CFLAGS -v -x c /dev/null 2>&1 | \
sed -ne 's#:# #g; s#^COMPILER_PATH=##p'
); do