17 lines
1.2 KiB
Bash
Executable File
17 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
# Cross-build OctoUpdater.exe (static, no DLL deps) with mingw-w64; zstd 1.5.7 decoder compiled in.
|
|
set -euo pipefail
|
|
H=$(cd "$(dirname "$0")" && pwd); Z=/mnt/Games/@project/tools/zstd-1.5.7-src/zstd-1.5.7/lib
|
|
O=${1:-$H/out}; mkdir -p "$O/obj"
|
|
python3 "$H/gen_pubkey.py" "$H/../patch-manifest-public.pem" "$H/pubkey.h"
|
|
for f in $Z/common/*.c $Z/decompress/*.c; do
|
|
x86_64-w64-mingw32-gcc -O2 -DZSTD_DISABLE_ASM -DZSTD_MULTITHREAD=0 -DZSTD_LEGACY_SUPPORT=0 -I$Z -I$Z/common -c "$f" -o "$O/obj/$(basename "${f%.c}").o"
|
|
done
|
|
J=/mnt/Games/@project/tools/casc-tool/vendor/CascLib/src/jenkins # Jenkins lookup3: CASC index/header checksums (STORE steps)
|
|
x86_64-w64-mingw32-gcc -O2 -c "$J/lookup3.c" -o "$O/obj/lookup3.o"
|
|
ZL=/mnt/Games/@project/tools/casc-tool/vendor/CascLib/src/zlib # zlib inflate: ENCODING 'Z' chunks (store compaction)
|
|
for f in adler32 crc32 inffast inflate inftrees zutil; do x86_64-w64-mingw32-gcc -O2 -c "$ZL/$f.c" -o "$O/obj/z_$f.o"; done
|
|
x86_64-w64-mingw32-g++ -std=c++20 -O2 -municode -I$Z -I"$ZL" -I"$H" "$H/OctoUpdater.cpp" "$O"/obj/*.o -o "$O/OctoUpdater.exe" \
|
|
-static -static-libgcc -static-libstdc++ -lwinhttp -lbcrypt -lole32 -lshell32 -luuid
|
|
x86_64-w64-mingw32-strip "$O/OctoUpdater.exe"; ls -la "$O/OctoUpdater.exe"
|