scripts: ext-toolchain: add support for info.mk in probe_cc
[openwrt/staging/hauke.git] / scripts / ext-toolchain.sh
index c9ceb150c1969683e146a5d38edea45a08a77c27..1f8eca30769a81cf599c439c8466220752f44801 100755 (executable)
@@ -463,6 +463,13 @@ probe_cpp() {
 }
 
 probe_libc() {
+       if [ -f $TOOLCHAIN/info.mk ]; then
+               LIBC_TYPE=$(grep LIBC_TYPE $TOOLCHAIN/info.mk | sed 's/LIBC_TYPE=//')
+               return 0
+       fi
+
+       echo "Warning! Can't find info.mk, trying to detect with alternative way."
+
        if [ -z "$LIBC_TYPE" ]; then
                if test_uclibc; then
                        LIBC_TYPE="uclibc"
@@ -546,6 +553,7 @@ while [ -n "$1" ]; do
 
                --config)
                        if probe_cc; then
+                               probe_libc
                                print_config "$1"
                                exit $?
                        fi