2022-10-17 20:45:26 +02:00
|
|
|
#!/bin/ksh
|
|
|
|
set -e
|
|
|
|
cd -- "$(dirname -- "${0}")/../../.."
|
|
|
|
|
|
|
|
if [ -z "${cc_path}" ]; then
|
2024-11-15 21:23:15 +01:00
|
|
|
cc_path="/usr/pkg/gcc14/bin/gcc"
|
2022-10-17 20:45:26 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
mk_slunk() {
|
|
|
|
gmake -B CC="${cc_path}" MARCH=${2} MTUNE=${3} STATIC=1 STRIP=1
|
|
|
|
cp -vf "frontend/bin/slunkcrypt" "out/slunkcrypt-${1}"
|
|
|
|
}
|
|
|
|
|
2024-06-05 00:23:48 +02:00
|
|
|
if [ "$(uname -s)" != "NetBSD" ]; then
|
|
|
|
echo "This script is supposed to run on the NetBSD platform !!!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2022-10-17 20:45:26 +02:00
|
|
|
rm -rf "out" && mkdir -p "out"
|
|
|
|
|
|
|
|
case "$(uname -m)" in
|
|
|
|
amd64)
|
|
|
|
mk_slunk "x86_64" "x86-64" "nocona"
|
|
|
|
;;
|
|
|
|
i386)
|
|
|
|
mk_slunk "i686" "pentiumpro" "pentium3"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Unknown host CPU type !!!"
|
|
|
|
exit 1
|
|
|
|
esac
|
|
|
|
|
2024-06-05 00:23:48 +02:00
|
|
|
./etc/build/build_info.sh "${cc_path}" > "out/.build_info"
|
|
|
|
|
2022-10-17 20:45:26 +02:00
|
|
|
echo "Build completed successfully."
|