mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-20 22:23:27 +00:00
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 7be01fe13b
)
This commit is contained in:
parent
462c5653e1
commit
fd90eed40c
@ -369,8 +369,18 @@ print_config() {
|
|||||||
echo "CONFIG_TOOLCHAIN_PREFIX=\"$prefix\"" >> "$config"
|
echo "CONFIG_TOOLCHAIN_PREFIX=\"$prefix\"" >> "$config"
|
||||||
echo "CONFIG_TARGET_NAME=\"$target\"" >> "$config"
|
echo "CONFIG_TARGET_NAME=\"$target\"" >> "$config"
|
||||||
|
|
||||||
if [ "$LIBC_TYPE" != glibc ]; then
|
if [ -f "$config" ]; then
|
||||||
echo "CONFIG_TOOLCHAIN_LIBC=\"$LIBC_TYPE\"" >> "$config"
|
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
|
fi
|
||||||
|
|
||||||
local lib
|
local lib
|
||||||
|
Loading…
Reference in New Issue
Block a user