2022-01-20 07:17:45 +03:00
|
|
|
#! /bin/sh
|
2022-01-16 08:09:36 +03:00
|
|
|
|
|
|
|
set -ex
|
|
|
|
|
2022-01-22 05:10:25 +03:00
|
|
|
srcdir="$(dirname "$0")"
|
2022-01-16 08:09:36 +03:00
|
|
|
test -z "$srcdir" && srcdir=.
|
|
|
|
|
|
|
|
cd "$srcdir"
|
|
|
|
|
2024-01-25 03:46:47 +03:00
|
|
|
FREESTANDING_TOOLCHAIN_COMMIT_HASH=18a5e52483344e117d45738c9afb2b34792cbced
|
2024-01-13 21:59:39 +03:00
|
|
|
FREESTANDING_HEADERS_COMMIT_HASH=dd3abd2d7147efc4170dff478d3b7730bed14147
|
2024-01-21 20:26:07 +03:00
|
|
|
CC_RUNTIME_COMMIT_HASH=38942e9a0d11af77c5d9fb45794850f7a1565d2b
|
2024-01-21 22:34:31 +03:00
|
|
|
LIMINE_EFI_COMMIT_HASH=f49bfc29a344f1bd57a6a99d8c71fcc133cd72c7
|
2024-01-13 21:59:39 +03:00
|
|
|
TINF_COMMIT_HASH=57ffa1f1d5e3dde19011b2127bd26d01689b694b
|
2024-02-01 01:46:15 +03:00
|
|
|
FLANTERM_COMMIT_HASH=545ab1faa8ba7493ae7a43064d520e402ad308b5
|
|
|
|
STB_COMMIT_HASH=f4a71b13373436a2866c5d68f8f80ac6f0bc1ffe
|
2024-01-13 21:59:39 +03:00
|
|
|
|
|
|
|
clone_repo_commit() {
|
|
|
|
[ -d $2 ] && (
|
|
|
|
set -e
|
2024-01-21 22:00:27 +03:00
|
|
|
if [ -d $2/.git ]; then
|
2024-01-13 22:04:18 +03:00
|
|
|
git -C $2 checkout $3 || (
|
|
|
|
set -e
|
|
|
|
rm -rf $2
|
|
|
|
)
|
|
|
|
fi
|
2024-01-13 21:59:39 +03:00
|
|
|
)
|
|
|
|
[ -d $2 ] || (
|
|
|
|
set -e
|
|
|
|
git clone $1 $2
|
|
|
|
git -C $2 checkout $3
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2024-01-26 03:13:18 +03:00
|
|
|
clone_repo_commit https://github.com/mintsuki/freestanding-toolchain.git build-aux/freestanding-toolchain $FREESTANDING_TOOLCHAIN_COMMIT_HASH
|
2024-02-01 01:46:15 +03:00
|
|
|
clone_repo_commit https://github.com/mintsuki/freestanding-headers.git freestanding-headers $FREESTANDING_HEADERS_COMMIT_HASH
|
2024-01-26 03:13:18 +03:00
|
|
|
|
2024-01-22 06:09:45 +03:00
|
|
|
clone_repo_commit https://github.com/mintsuki/cc-runtime.git decompressor/cc-runtime $CC_RUNTIME_COMMIT_HASH
|
|
|
|
rm -rf common/cc-runtime
|
|
|
|
cp -rp decompressor/cc-runtime common/
|
|
|
|
for f in common/cc-runtime/*.c; do
|
|
|
|
mv "$f" "$(echo "$f" | sed 's/\.c/.s2.c/g')"
|
|
|
|
done
|
2024-01-13 21:59:39 +03:00
|
|
|
|
2024-01-26 03:13:18 +03:00
|
|
|
clone_repo_commit https://github.com/limine-bootloader/limine-efi.git limine-efi $LIMINE_EFI_COMMIT_HASH
|
2024-01-13 21:59:39 +03:00
|
|
|
|
2024-01-26 03:13:18 +03:00
|
|
|
clone_repo_commit https://github.com/jibsen/tinf.git tinf $TINF_COMMIT_HASH
|
2024-01-13 21:59:39 +03: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
|
2024-01-26 03:13:18 +03:00
|
|
|
rm -f tinf/src/tinf.h.orig tinf/src/tinflate.c.orig tinf/src/tinfgzip.c.orig
|
2024-01-13 21:59:39 +03:00
|
|
|
|
2024-02-01 01:46:15 +03:00
|
|
|
clone_repo_commit https://github.com/mintsuki/flanterm.git common/flanterm $FLANTERM_COMMIT_HASH
|
|
|
|
|
2024-01-26 03:13:18 +03:00
|
|
|
clone_repo_commit https://github.com/nothings/stb.git stb $STB_COMMIT_HASH
|
|
|
|
cp stb/stb_image.h common/lib/
|
|
|
|
patch -p0 < common/stb_image.patch
|
|
|
|
rm -f common/lib/stb_image.h.orig
|
2023-03-16 06:38:59 +03:00
|
|
|
|
2023-11-19 16:34:24 +03:00
|
|
|
autoreconf -fvi -Wall
|
2023-12-26 18:26:29 +03: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
|