2022-11-14 21:41:36 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
|
|
|
|
# Requires cmake ninja-build
|
|
|
|
|
|
|
|
set -x
|
|
|
|
set -e
|
|
|
|
|
|
|
|
ZIGDIR="$(pwd)"
|
2022-11-14 23:04:01 +00:00
|
|
|
ARCH="$(uname -m)"
|
2022-11-14 21:41:36 +00:00
|
|
|
TARGET="$ARCH-linux-musl"
|
|
|
|
MCPU="baseline"
|
|
|
|
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.10.0-dev.4560+828735ac0"
|
2022-11-14 23:04:01 +00:00
|
|
|
PREFIX="$HOME/deps/$CACHE_BASENAME"
|
2022-11-14 21:41:36 +00:00
|
|
|
ZIG="$PREFIX/bin/zig"
|
|
|
|
|
2022-11-14 23:04:01 +00:00
|
|
|
export PATH="$HOME/deps/wasmtime-v2.0.2-aarch64-linux:$PATH"
|
2022-11-14 21:41:36 +00:00
|
|
|
|
|
|
|
mkdir build-release
|
|
|
|
cd build-release
|
|
|
|
cmake .. \
|
|
|
|
-DCMAKE_INSTALL_PREFIX="stage3-release" \
|
|
|
|
-DCMAKE_PREFIX_PATH="$PREFIX" \
|
|
|
|
-DCMAKE_BUILD_TYPE=Release \
|
2022-11-14 23:04:01 +00:00
|
|
|
-DCMAKE_C_COMPILER="$ZIG;cc;-target;$TARGET;-mcpu=$MCPU" \
|
|
|
|
-DCMAKE_CXX_COMPILER="$ZIG;c++;-target;$TARGET;-mcpu=$MCPU" \
|
2022-11-14 21:41:36 +00:00
|
|
|
-DZIG_TARGET_TRIPLE="$TARGET" \
|
|
|
|
-DZIG_TARGET_MCPU="$MCPU" \
|
|
|
|
-DZIG_STATIC=ON \
|
|
|
|
-GNinja
|
|
|
|
|
|
|
|
ninja install
|
|
|
|
|
2022-11-14 23:04:01 +00:00
|
|
|
# TODO: add -fqemu back to this line
|
|
|
|
|
2022-11-14 21:41:36 +00:00
|
|
|
stage3-release/bin/zig build test docs \
|
|
|
|
-fwasmtime \
|
|
|
|
-Dstatic-llvm \
|
|
|
|
-Dtarget=native-native-musl \
|
|
|
|
--search-prefix "$PREFIX" \
|
|
|
|
--zig-lib-dir "$(pwd)/../lib"
|
|
|
|
|
|
|
|
# Produce the experimental std lib documentation.
|
|
|
|
mkdir -p "stage3-release/doc/std"
|
|
|
|
stage3-release/bin/zig test ../lib/std/std.zig \
|
|
|
|
-femit-docs=stage3-release/doc/std \
|
|
|
|
-fno-emit-bin \
|
|
|
|
--zig-lib-dir "$(pwd)/../lib"
|
|
|
|
|
|
|
|
# cp ../LICENSE $RELEASE_STAGING/
|
|
|
|
# cp ../zig-cache/langref.html $RELEASE_STAGING/doc/
|
|
|
|
|
|
|
|
# # Look for HTML errors.
|
|
|
|
# tidy --drop-empty-elements no -qe $RELEASE_STAGING/doc/langref.html
|