kevinlawler / kona

Open-source implementation of the K programming language
ISC License
1.36k stars 138 forks source link

Makefile needs to check uname -o to detect Cygwin #446

Open johnwcowan opened 8 years ago

johnwcowan commented 8 years ago

The current check for Cygwin only works if you are on a specific version of Windows. For example, if you are on Windows 10, the uname -s output is CYGWIN_NT-10.0 instead of CYGWIN_NT-6.3. By capturing $(uname -o) in a separate variable, you can just match it against "Cygwin", because that is invariant. Otherwise, on Windows 10 you have to type "make OS=cygwin_nt-6.3", which is annoying.

bakul commented 8 years ago

uname -o is not posix compliant (and not available on OS X). uname -s prints out the operating system name. Perhaps the thing to do is add | sed 's/-.*//' to the OS=... pipeline. Except that there is different behavior for mingw32_nt-6.2 vs -6.0 (which seems vaguely related to machine word size). It would be better to use an embdedded `#ifdef ...withinifeq (mingw32_nt,$(OS))`` for machine word size dependencies.