Some improvements to musl libc build script.

This commit is contained in:
LoRd_MuldeR 2022-05-07 18:55:22 +02:00
parent 207039f4f7
commit fc2784b256
Signed by: mulder
GPG Key ID: 2B5913365F57E03F

View File

@ -10,10 +10,11 @@ function mk_musl() {
rm -rf "${build}" && mkdir -p "${build}"
tar -xvf "musl-latest.tar.gz" --strip-components=1 -C "${build}"
pushd "${build}"
local optdirs="$(find './src' -mindepth 1 -maxdepth 1 -type d -printf '%f,' | sed 's/,$//g')"
if [ -z "${2}" ]; then
./configure --prefix="${outdir}"
./configure --enable-optimize="${optdirs}" --disable-shared --prefix="${outdir}"
else
./configure --host="${2}" --prefix="${outdir}"
./configure --enable-optimize="${optdirs}" --disable-shared --prefix="${outdir}" --host="${2}"
fi
make
sudo rm -rf "${outdir}"