2022-01-20 05:17:45 +01:00
|
|
|
#! /bin/sh
|
2022-01-16 06:09:36 +01:00
|
|
|
|
|
|
|
set -ex
|
|
|
|
|
2022-01-22 03:10:25 +01:00
|
|
|
srcdir="$(dirname "$0")"
|
2022-01-16 06:09:36 +01:00
|
|
|
test -z "$srcdir" && srcdir=.
|
|
|
|
|
|
|
|
cd "$srcdir"
|
|
|
|
|
2024-01-13 19:59:39 +01:00
|
|
|
STB_COMMIT_HASH=f4a71b13373436a2866c5d68f8f80ac6f0bc1ffe
|
|
|
|
STB_IMAGE_H_HASH=9053a86ea3fab378ad42c740bbc5003c7c2038a466da1446e1d9b943178d131c9add2d41fca23149cc55381a94ba32c4d29f5ce09d80e19809e067bac2ee7b92
|
2023-04-25 02:42:34 +02:00
|
|
|
|
2024-01-13 19:59:39 +01:00
|
|
|
FREESTANDING_TOOLCHAIN_COMMIT_HASH=2ab7a489652291d430a7b693430c97ea9cb7bcbf
|
|
|
|
FREESTANDING_TOOLCHAIN_HASH=558c0a1f4e10aeb32e1331e0139a571cde648fe281b85a2163e1f4b5fe639cec1ba87906d24dcfe52b62540290beac71a2ba3e3c20686933c969b60f122826a5
|
|
|
|
|
2024-01-20 21:35:42 +01:00
|
|
|
FLANTERM_COMMIT_HASH=545ab1faa8ba7493ae7a43064d520e402ad308b5
|
2024-01-13 19:59:39 +01:00
|
|
|
|
|
|
|
FREESTANDING_HEADERS_COMMIT_HASH=dd3abd2d7147efc4170dff478d3b7730bed14147
|
|
|
|
|
2024-01-21 18:26:07 +01:00
|
|
|
CC_RUNTIME_COMMIT_HASH=38942e9a0d11af77c5d9fb45794850f7a1565d2b
|
2024-01-13 19:59:39 +01:00
|
|
|
|
|
|
|
LIMINE_EFI_COMMIT_HASH=c7d42cae902fc7e3f0b20b428186e8d9b1e9f5b5
|
|
|
|
|
|
|
|
TINF_COMMIT_HASH=57ffa1f1d5e3dde19011b2127bd26d01689b694b
|
|
|
|
|
|
|
|
clone_repo_commit() {
|
|
|
|
[ -d $2 ] && (
|
|
|
|
set -e
|
2024-01-21 20:00:27 +01:00
|
|
|
if [ -d $2/.git ]; then
|
2024-01-13 20:04:18 +01:00
|
|
|
git -C $2 checkout $3 || (
|
|
|
|
set -e
|
|
|
|
rm -rf $2
|
|
|
|
)
|
|
|
|
fi
|
2024-01-13 19:59:39 +01:00
|
|
|
)
|
|
|
|
[ -d $2 ] || (
|
|
|
|
set -e
|
|
|
|
git clone $1 $2
|
|
|
|
git -C $2 checkout $3
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
clone_repo_commit https://github.com/mintsuki/flanterm.git common/flanterm $FLANTERM_COMMIT_HASH
|
|
|
|
clone_repo_commit https://github.com/mintsuki/freestanding-headers.git freestanding-headers $FREESTANDING_HEADERS_COMMIT_HASH
|
2024-01-21 18:26:07 +01:00
|
|
|
clone_repo_commit https://github.com/mintsuki/cc-runtime.git common/cc-runtime $CC_RUNTIME_COMMIT_HASH
|
|
|
|
rm -rf decompressor/cc-runtime
|
|
|
|
cp -rp common/cc-runtime decompressor/
|
2024-01-13 19:59:39 +01:00
|
|
|
clone_repo_commit https://github.com/limine-bootloader/limine-efi.git limine-efi $LIMINE_EFI_COMMIT_HASH
|
|
|
|
clone_repo_commit https://github.com/jibsen/tinf.git tinf $TINF_COMMIT_HASH
|
|
|
|
|
|
|
|
########################################################
|
|
|
|
########################################################
|
|
|
|
|
|
|
|
[ -f common/stb/stb_image.h ] && (
|
|
|
|
set -e
|
|
|
|
b2sum common/stb/stb_image.h | grep $STB_IMAGE_H_HASH >/dev/null 2>&1 || (
|
|
|
|
set -e
|
|
|
|
rm -f common/stb/stb_image.h
|
|
|
|
)
|
|
|
|
)
|
2024-01-07 03:26:33 +01:00
|
|
|
[ -f common/stb/stb_image.h ] || (
|
|
|
|
set -e
|
2024-01-13 19:59:39 +01:00
|
|
|
curl -Lo common/stb/stb_image.h https://github.com/nothings/stb/raw/$STB_COMMIT_HASH/stb_image.h
|
2024-01-07 03:26:33 +01:00
|
|
|
patch -p0 < common/stb_image.patch
|
|
|
|
rm -f common/stb/stb_image.h.orig
|
|
|
|
)
|
2024-01-13 19:59:39 +01:00
|
|
|
|
|
|
|
########################################################
|
|
|
|
########################################################
|
|
|
|
|
|
|
|
mkdir -p decompressor/tinf
|
|
|
|
cp tinf/src/tinf.h tinf/src/tinflate.c tinf/src/tinfgzip.c decompressor/tinf/
|
|
|
|
patch -p0 < decompressor/tinf.patch
|
|
|
|
|
|
|
|
########################################################
|
|
|
|
########################################################
|
|
|
|
|
|
|
|
[ -f freestanding-toolchain ] && (
|
|
|
|
set -e
|
|
|
|
b2sum freestanding-toolchain | grep $FREESTANDING_TOOLCHAIN_HASH >/dev/null 2>&1 || (
|
|
|
|
set -e
|
|
|
|
rm -f freestanding-toolchain
|
|
|
|
)
|
|
|
|
)
|
|
|
|
[ -f freestanding-toolchain ] || (
|
2023-06-06 01:16:58 +02:00
|
|
|
set -e
|
2024-01-13 19:59:39 +01:00
|
|
|
curl -Lo freestanding-toolchain https://github.com/mintsuki/freestanding-toolchain/raw/$FREESTANDING_TOOLCHAIN_COMMIT_HASH/freestanding-toolchain
|
|
|
|
chmod +x freestanding-toolchain
|
2023-06-06 01:16:58 +02:00
|
|
|
)
|
2024-01-13 19:59:39 +01:00
|
|
|
|
|
|
|
########################################################
|
|
|
|
########################################################
|
2023-03-16 04:38:59 +01:00
|
|
|
|
2023-11-19 14:34:24 +01:00
|
|
|
autoreconf -fvi -Wall
|
2023-12-26 16:26:29 +01:00
|
|
|
|
|
|
|
# Older versions of autoreconf have a bug where they do not
|
|
|
|
# install auxiliary files, sometimes... Check if that is the
|
|
|
|
# case and work around...
|
|
|
|
for auxfile in config.guess config.sub install-sh; do
|
|
|
|
if ! [ -f build-aux/$auxfile ]; then
|
|
|
|
mkdir -p build-aux
|
|
|
|
cp -v "$(automake --print-libdir)/$auxfile" build-aux/
|
|
|
|
fi
|
|
|
|
done
|