2021-05-08 19:23:57 +02:00
|
|
|
#!/bin/bash
|
2024-06-05 00:23:48 +02:00
|
|
|
# See "etc/build/linux/mk-musl.sh" in order to build musl libc!
|
2021-05-08 19:23:57 +02:00
|
|
|
set -e
|
2022-12-18 14:34:42 +01:00
|
|
|
cd -- "$(dirname -- "${BASH_SOURCE[0]}")/../../.."
|
2021-05-08 19:23:57 +02:00
|
|
|
|
2022-04-19 20:47:15 +02:00
|
|
|
function mk_slunk() {
|
2024-06-05 00:23:48 +02:00
|
|
|
if [ ! -e "/usr/local/musl/${1}/bin/musl-gcc" ]; then
|
|
|
|
echo "Warning: Musl libc compiler for target \"${1}\" not found -> skipping!"
|
|
|
|
return
|
|
|
|
fi
|
2022-05-21 17:21:09 +02:00
|
|
|
local command="make -B CC=/usr/local/musl/${1}/bin/musl-gcc STATIC=1 STRIP=1 FLTO=1"
|
2022-09-20 21:53:57 +02:00
|
|
|
$BASH -x -c "${command}${2:+ ${2}}"
|
2022-04-19 20:47:15 +02:00
|
|
|
cp -vf "frontend/bin/slunkcrypt" "out/slunkcrypt-${1}"
|
|
|
|
}
|
|
|
|
|
2022-12-18 14:34:42 +01:00
|
|
|
if [[ "$OSTYPE" != "linux"* ]]; then
|
2022-06-18 14:38:42 +02:00
|
|
|
echo "This script is supposed to run on the linux platform !!!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2022-04-19 20:47:15 +02:00
|
|
|
rm -rf "out" && mkdir -p "out"
|
|
|
|
|
2022-04-04 23:47:10 +02:00
|
|
|
$BASH -x -c "make clean"
|
|
|
|
|
2022-05-21 17:21:09 +02:00
|
|
|
mk_slunk "x86_64" "MARCH=x86-64 MTUNE=nocona"
|
2022-09-23 00:10:07 +02:00
|
|
|
mk_slunk "i686" "MARCH=pentiumpro MTUNE=pentium3"
|
2024-06-05 00:23:48 +02:00
|
|
|
|
|
|
|
mk_slunk "arm64"
|
2022-06-18 14:38:42 +02:00
|
|
|
mk_slunk "armel"
|
|
|
|
mk_slunk "armhf"
|
2024-06-05 00:23:48 +02:00
|
|
|
mk_slunk "mips"
|
|
|
|
mk_slunk "mips64"
|
2022-06-18 14:38:42 +02:00
|
|
|
mk_slunk "mips64el"
|
2024-06-05 00:23:48 +02:00
|
|
|
mk_slunk "mips64r6"
|
|
|
|
mk_slunk "mips64r6el"
|
|
|
|
mk_slunk "mipsel"
|
|
|
|
mk_slunk "mipsr6"
|
|
|
|
mk_slunk "mipsr6el"
|
|
|
|
mk_slunk "riscv64"
|
|
|
|
mk_slunk "s390x"
|
|
|
|
|
|
|
|
./etc/build/build_info.sh "/usr/local/musl/x86_64/bin/musl-gcc" > "out/.build_info"
|
2021-05-08 19:23:57 +02:00
|
|
|
|
|
|
|
printf "\033[1;32m\nBuild completed successfully.\033[0m\n\n"
|