Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
Somewhat ironically, we still can't build the C bindings under MSYS and MSYS2, the Unix-like shells for MinGW, using the make utilities they provide. This is because Charmonizer invokes shell commands via C's system function which always delegates to cmd.exe under MinGW, whether under MSYS or not. As a result, backslashes are used as directory separators. This causes problems when commands from the generated Makefile are executed by the MSYS shell. Building with mingw32-make works, though.
That's what you get when writing a build system based on C instead of a command shell!
One solution is to keep using cmd.exe and convert backslashes to forward slashes before writing them to the Makefile. But doing this manually in charmonizer.main is extremely cumbersome and I'm not sure whether this could be automated reliably.
I think a better solution is to detect whether we're running in a (mostly) POSIX-compatible environment under Windows and execute POSIX commands via sh.exe (make cmd.exe call sh.exe to be precise).