fix: support MSYS2 builds on gmake

uname -s under MSYS2 never reports Windows_NT, so build.sh picked
bmake.mk and gmake.mk's platform branches silently fell through to
the Linux path (.so + -ldl), breaking the link. Detect MINGW/MSYS/
UCRT/CLANG uname prefixes in build.sh and route to gmake.mk; export
UNAME_S once so make doesn't call uname again. gmake.mk, test/gmake.mk,
and module_template/gmake.mk now derive Windows-vs-Unix from uname
instead of $(OS), with the cmd.exe/batch command path reserved for
environments without a POSIX shell (MSYS2 keeps mkdir -p/rm -rf).
This commit is contained in:
anth64 committed 2026-11-10 19:08:11 +01:00
1 parent 270808e602
commit b860b0d607
8 files changed
+100 -37

No files matched your search

+8 -6
View File
@@ -1,12 +1,14 @@
#!/bin/sh
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
UNAME_S=$(uname -s)
export UNAME_S
if [ "$OS" = "linux" ]; then
MK_FILE="gmake.mk"
else
MK_FILE="bmake.mk"
fi
OS=$(echo "$UNAME_S" | tr '[:upper:]' '[:lower:]')
case "$OS" in
linux|mingw*|msys*|ucrt*|clang*) MK_FILE="gmake.mk" ;;
*) MK_FILE="bmake.mk" ;;
esac
HAS_INSTALL=0
HAS_UNINSTALL=0