Search code examples
cygwinsconsmsysmsys2

distinguish between MSYS and MSYS2 and CYGWIN


How can you distinguish between MSYS and MSYS2 and CYGWIN, e.g via a command or a predefined environment variable?

This distinction would be needed by tools like Scons to adapt generated command lines, e.g. by issuing double backslashed c:\\path\\to\\file or backticked `cygpath -w /c/path/to/file`.

Background: I would like to use MSYS2, because of its superior package management. Scons generates the /c/path/to/file on MSYS2, but csc (Microsoft's C# compiler) only allows Windows style paths.


Solution

  • I don't know of any environment variable which will reliably convey this information, but the output from uname -s should tell you.