Commit 322f2a8a

322f2a8a9edeMerged

Yasuhiro Matsumoto <[email protected]> · 7 months ago · 2 files · +1 added · ~1 modified

Description

feat: spinel.bat wrapper and Windows-aware spinel shell script

  • spinel.bat: cmd.exe-native wrapper mirroring the POSIX spinel script. Passes -E UTF-8:UTF-8 to the Ruby fallback paths so Japanese strings in source files round-trip correctly under codepage 932, and adds -Wl,--stack,67108864 to the compile step for MinGW's 1MB default.
  • spinel (sh): on MINGW/MSYS/CYGWIN hosts only, fall back to $PARSE_BIN.exe / $CODEGEN_BIN.exe when the unsuffixed paths are absent, and append the 64MB stack flag. Linux/macOS paths unchanged.

Details

Commit
322f2a8a9ede
Parent
32885d0ab5cc

spinelmodifiedView file

@@ -22,6 +22,15 @@
2222 CODEGEN_RB="$DIR/spinel_codegen.rb"
2323 CODEGEN_BIN="$DIR/spinel_codegen"
2424
25+# On Windows (MSYS2 / Cygwin / MinGW) the compiled binaries carry a .exe
26+# suffix; fall back to that when the unsuffixed path is absent.
27+case "$(uname -s 2>/dev/null)" in
28+ MINGW*|MSYS*|CYGWIN*)
29+ [ ! -x "$PARSE_BIN" ] && [ -x "$PARSE_BIN.exe" ] && PARSE_BIN="$PARSE_BIN.exe"
30+ [ ! -x "$CODEGEN_BIN" ] && [ -x "$CODEGEN_BIN.exe" ] && CODEGEN_BIN="$CODEGEN_BIN.exe"
31+ ;;
32+esac
33+
2534 SOURCE=""
2635 OUTPUT=""
2736 C_ONLY=0
@@ -134,6 +143,12 @@
134143 else
135144 GC_FLAG="-Wl,--gc-sections"
136145 fi
146+
147+# MinGW's default 1MB stack overflows on nontrivial programs; reserve 64MB.
148+case "$(uname -s 2>/dev/null)" in
149+ MINGW*|MSYS*|CYGWIN*) EXTRA_FLAGS="$EXTRA_FLAGS -Wl,--stack,67108864" ;;
150+esac
151+
137152 $CC_CMD -O${OPT_LEVEL} -Wno-all -ffunction-sections -fdata-sections $INCLUDE_FLAGS "$C_FILE" -lm $EXTRA_FLAGS $GC_FLAG -o "$BIN_FILE"
138153 if [ $? -ne 0 ]; then
139154 echo "spinel: C compilation failed" >&2