forked from oven-sh/bun
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathall-dependencies.sh
More file actions
executable file
·68 lines (59 loc) · 1.38 KB
/
all-dependencies.sh
File metadata and controls
executable file
·68 lines (59 loc) · 1.38 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
#!/usr/bin/env bash
set -euo pipefail
source "$(dirname -- "${BASH_SOURCE[0]}")/env.sh"
FORCE=
while getopts "f" opt; do
case ${opt} in
f)
FORCE=1
;;
\?)
echo "Usage: all-dependencies.sh [-h] [-f]"
echo "Options:"
echo " h Print this help message"
echo " f Set force to 1"
exit 1
;;
esac
done
BUILT_ANY=0
dep() {
local script="$1"
if [ -z "$FORCE" ]; then
HAS_ALL_DEPS=1
shift
for lib in "$@"; do
if [ ! -f "$BUN_DEPS_OUT_DIR/$lib" ]; then
HAS_ALL_DEPS=0
break
fi
done
if [ "$HAS_ALL_DEPS" == "1" ]; then
printf "%s - already built\n" "$script"
return
fi
fi
printf "building %s\n" "$script"
set +e
bash "$SCRIPT_DIR/build-$script.sh"
EXIT=$?
if [ "$EXIT" -ne 0 ]; then
printf "Failed to build %s\n" "$script"
exit "$EXIT"
fi
set -e
BUILT_ANY=1
}
dep boringssl libcrypto.a libssl.a libdecrepit.a
dep cares libcares.a
dep libarchive libarchive.a
dep lolhtml liblolhtml.a
dep mimalloc-debug libmimalloc-debug.a libmimalloc-debug.o
dep mimalloc libmimalloc.a libmimalloc.o
dep tinycc libtcc.a
dep zlib libz.a
dep zstd libzstd.a
dep lshpack liblshpack.a
if [ "$BUILT_ANY" -eq 0 ]; then
printf "(run with -f to rebuild)\n"
fi