aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/ext-toolchain.sh
diff options
context:
space:
mode:
authorChristian Marangi <ansuelsmth@gmail.com>2022-07-17 17:56:59 +0200
committerChristian Marangi <ansuelsmth@gmail.com>2022-12-04 16:07:35 +0100
commitfd90eed40ce6828a1bbd11d1a394e7c6368d0577 (patch)
tree9863dafb77f96f2b7f86cfbac113ac747558c4d3 /scripts/ext-toolchain.sh
parent462c5653e18f0bd2c9ec66a2b154bf26d8f4aa1d (diff)
downloadupstream-fd90eed40ce6828a1bbd11d1a394e7c6368d0577.tar.gz
upstream-fd90eed40ce6828a1bbd11d1a394e7c6368d0577.tar.bz2
upstream-fd90eed40ce6828a1bbd11d1a394e7c6368d0577.zip
scripts: ext-toolchain: add support for musl
Openwrt now supports only glibc and musl. Add support for musl and rework the libc check to handle the new config flags and correctly compile package basend on that. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> (cherry picked from commit 7be01fe13b4517e5edb8a4818f437d60144cdcb4)
Diffstat (limited to 'scripts/ext-toolchain.sh')
-rwxr-xr-xscripts/ext-toolchain.sh14
1 files changed, 12 insertions, 2 deletions
diff --git a/scripts/ext-toolchain.sh b/scripts/ext-toolchain.sh
index 1f8eca3076..fe1024c18e 100755
--- a/scripts/ext-toolchain.sh
+++ b/scripts/ext-toolchain.sh
@@ -369,8 +369,18 @@ print_config() {
echo "CONFIG_TOOLCHAIN_PREFIX=\"$prefix\"" >> "$config"
echo "CONFIG_TARGET_NAME=\"$target\"" >> "$config"
- if [ "$LIBC_TYPE" != glibc ]; then
- echo "CONFIG_TOOLCHAIN_LIBC=\"$LIBC_TYPE\"" >> "$config"
+ if [ -f "$config" ]; then
+ sed -i '/CONFIG_EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL/d' "$config"
+ sed -i '/CONFIG_EXTERNAL_TOOLCHAIN_LIBC_USE_GLIBC/d' "$config"
+ fi
+
+ if [ "$LIBC_TYPE" == glibc ]; then
+ echo "CONFIG_EXTERNAL_TOOLCHAIN_LIBC_USE_GLIBC=y" >> "$config"
+ elif [ "$LIBC_TYPE" == musl ]; then
+ echo "CONFIG_EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL=y" >> "$config"
+ else
+ echo "Can't detect LIBC type. Aborting!" >&2
+ return 1
fi
local lib