mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 10:58:56 +00:00
* Updated Dependencies Script * demo * fix submodule hell!!! * lol * attmept 2 * install nasm in ci * setup sh 1 * yeah * better zlib building * codegen stuff * attempt 2 at bun codegen ci * o * deps improvements * generaet part of compile-cpp-only.ps1 * restore these * good enough for Unix * remove libuv submodule lol * pass over docs
67 lines
1.3 KiB
Bash
Executable File
67 lines
1.3 KiB
Bash
Executable File
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" -eq 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 base64 libbase64.a
|
|
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
|
|
dep mimalloc libmimalloc.a
|
|
dep tinycc libtcc.a
|
|
dep zlib libz.a
|
|
dep zstd libzstd.a
|
|
|
|
if [ "$BUILT_ANY" -eq 0 ]; then
|
|
printf "(run with -f to rebuild)\n"
|
|
fi |