From 279361f241f7f23411bd024cd0c3d755e5e7594f Mon Sep 17 00:00:00 2001 From: Connor O'Connor Date: Fri, 3 Oct 2025 14:18:56 -0400 Subject: [PATCH] compile.sh --- compile.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 compile.sh diff --git a/compile.sh b/compile.sh new file mode 100644 index 0000000..270ecf8 --- /dev/null +++ b/compile.sh @@ -0,0 +1,26 @@ +#!/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++" + +set -x +/mingw32/bin/g++ src/bllua4.cpp $buildargs -o BlockLua.dll && /mingw32/bin/g++ -DBLLUA_UNSAFE src/bllua4.cpp $buildargs -o BlockLua-Unsafe.dll +set +x + +# objdump -d BlockLua.dll > BlockLua.dll.dump.txt +# objdump -d BlockLua-Unsafe.dll > BlockLua-Unsafe.dll.dump.txt