Skip to content

Commit

Permalink
scripts: ext-toolchain: add support for musl
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ansuel committed Jul 24, 2022
1 parent 7531197 commit 7be01fe
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions scripts/ext-toolchain.sh
Expand Up @@ -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
Expand Down

0 comments on commit 7be01fe

Please sign in to comment.