瀏覽代碼

scripts: ext-toolchain: add support for info.mk in probe_cc

Openwrt generate info.mk that contains the libc type. For probe_cc check
if the file exist and parse directly it for LIBC type.

Signed-off-by: Christian Marangi <[email protected]>
Christian Marangi 3 年之前
父節點
當前提交
75311977f5
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      scripts/ext-toolchain.sh

+ 7 - 0
scripts/ext-toolchain.sh

@@ -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"