-
Notifications
You must be signed in to change notification settings - Fork 191
Expand file tree
/
Copy pathbootstrap
More file actions
executable file
·133 lines (113 loc) · 3.64 KB
/
bootstrap
File metadata and controls
executable file
·133 lines (113 loc) · 3.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#! /bin/sh
set -ex
srcdir="$(dirname "$0")"
test -z "$srcdir" && srcdir=.
: "${AUTORECONF:=autoreconf}"
: "${AUTOMAKE:=automake}"
cd "$srcdir"
AUXFILES="config.guess config.sub install-sh"
clone_repo_commit() {
if test -d "$2/.git"; then
git -C "$2" reset --hard
git -C "$2" clean -fd
if ! git -C "$2" -c advice.detachedHead=false checkout $3; then
rm -rf "$2"
fi
else
if test -d "$2"; then
set +x
echo "error: '$2' is not a Git repository" 1>&2
exit 1
fi
fi
if ! test -d "$2"; then
git clone $1 "$2"
if ! git -C "$2" -c advice.detachedHead=false checkout $3; then
rm -rf "$2"
exit 1
fi
fi
}
if ! test -f version; then
clone_repo_commit \
https://github.com/osdev0/freestnd-c-hdrs-0bsd.git \
freestnd-c-hdrs \
097259a899d30f0a4b7a694de2de5fdda942e923
clone_repo_commit \
https://github.com/osdev0/cc-runtime.git \
cc-runtime \
dae79833b57a01b9fd3e359ee31def69f5ae899b
cp cc-runtime/src/cc-runtime.c common/cc-runtime.s2.c
clone_repo_commit \
https://github.com/iczelia/pdgzip.git \
pdgzip \
ce578d3f815bf591b78d1689c09b05acf173c095
cp pdgzip/pdgzip.c common/compress/pdgzip.c
cp pdgzip/pdgzip.h common/compress/pdgzip.h
clone_repo_commit \
https://github.com/Limine-Bootloader/limine-protocol.git \
limine-protocol \
5b9d13e557590d8eab93fa7449bdd1d7ed72ba8c
clone_repo_commit \
https://github.com/PicoEFI/PicoEFI.git \
picoefi \
af14129ec21ba482873289e36311ec02f1e19964
clone_repo_commit \
https://github.com/Mintsuki/Flanterm.git \
flanterm \
dfa1922c0749faf64c4423a81b233a20c08a7db7
clone_repo_commit \
https://github.com/Mintsuki/stbi-hardened.git \
stbi-hardened \
b85b7e87f6f87300f32f7de3d94e1ed083a71263
cp stbi-hardened/include/stb_image.h common/lib/stb_image.h
patch -p0 < common/stb_image.patch
rm -f common/lib/stb_image.h.orig
clone_repo_commit \
https://github.com/osdev0/libfdt.git \
libfdt \
7bf94e6347129d17eca263112296ad170dec28a9
fi
# Create timestamps file
if test -d .git && git log -1 >/dev/null 2>&1; then
cat >timestamps <<EOF
REGEN_DATE="$(git log -1 --pretty=%cd --date='format:%B %Y')"
SOURCE_DATE_EPOCH="$(git log -1 --pretty=%ct)"
SOURCE_DATE_EPOCH_TOUCH="$(git log -1 --pretty=%cI | head -c 16 | sed 's/-//g;s/T//g;s/://g')"
EOF
else
if ! test -f timestamps; then
cat >timestamps <<EOF
REGEN_DATE="UNVERSIONED"
SOURCE_DATE_EPOCH="1546297200"
SOURCE_DATE_EPOCH_TOUCH="201901010000"
EOF
fi
fi
for auxfile in $AUXFILES; do
rm -f build-aux/$auxfile
done
$AUTORECONF -fvi -Wall
# 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 $AUXFILES; do
if ! test -f build-aux/$auxfile; then
if ! $AUTOMAKE --print-libdir >/dev/null 2>&1; then
set +x
echo "error: Broken autoreconf detected, but missing or broken automake." 1>&2
echo " Please make sure automake is installed and working." 1>&2
exit 1
fi
AUTOMAKE_LIBDIR="$($AUTOMAKE --print-libdir)"
if test -z "$AUTOMAKE_LIBDIR"; then
# Assume `true` was passed as $AUTOMAKE
continue
fi
mkdir -p build-aux
cp -v "$AUTOMAKE_LIBDIR/$auxfile" build-aux/
chmod +x build-aux/$auxfile
fi
done
set +x
printf "\nSource tree bootstrapped successfully!\n"