Files
BlockLua/compile.sh
2025-10-05 14:40:43 -04:00

30 lines
836 B
Bash

#!/bin/bash
#
# BlockLua build script for MSYS2/MinGW32
#
# Usage:
# 1. Open the MSYS2 MinGW32 shell.
# 2. Install the required compiler with:
# pacman -S mingw-w64-i686-gcc
# 3. Run this script:
# ./compile.sh
#
# If your MSYS2 installation is not on C:, adjust the g++ path below as needed.
set -e
cd "$(dirname "$0")"
buildargs="-Wall -Werror -m32 -shared -Isrc -Iinc/tsfuncs -Iinc/lua -lpsapi -L. -llua5.1 -static-libgcc -static-libstdc++"
outdir="build"
mkdir -p "$outdir"
set -x
/mingw32/bin/g++ src/bllua4.cpp $buildargs -o "$outdir"/BlockLua.dll && /mingw32/bin/g++ -DBLLUA_UNSAFE src/bllua4.cpp $buildargs -o "$outdir"/BlockLua-Unsafe.dll
set +x
# objdump -d "$outdir"/BlockLua.dll > "$outdir"/BlockLua.dll.dump.txt
# objdump -d "$outdir"/BlockLua-Unsafe.dll > "$outdir"/BlockLua-Unsafe.dll.dump.txt