vishapoberon / compiler

vishap oberon compiler
http://oberon.vishap.am
GNU General Public License v3.0
186 stars 25 forks source link

Add MSYS2 support #54

Closed aixp closed 7 years ago

aixp commented 7 years ago
--- src/tools/make/configure.c.orig    2017-01-13 20:11:57.408911000 +0300
+++ src/tools/make/configure.c 2017-01-13 21:28:06.699259500 +0300
@@ -111,6 +111,9 @@
     if (uname(&sys)<0) fail("Couldn't get sys name - uname() failed.");

     if      (strncasecmp(sys.sysname, "cygwin",  6) == 0) {os = "cygwin";  binext = ".exe";}
+    else if (strncasecmp(sys.sysname, "msys",  4) == 0) {os = "msys";  binext = ".exe";}
+    else if (strncasecmp(sys.sysname, "mingw32",  7) == 0) {os = "mingw32";  binext = ".exe";}
+    else if (strncasecmp(sys.sysname, "mingw64",  7) == 0) {os = "mingw64";  binext = ".exe";}
     else if (strncasecmp(sys.sysname, "linux",   5) == 0) {determineLinuxVariant();}
     else if (strncasecmp(sys.sysname, "freebsd", 5) == 0) {os = "freebsd"; bsd = 1;}
     else if (strncasecmp(sys.sysname, "openbsd", 5) == 0) {os = "openbsd"; bsd = 1;}
@@ -140,8 +143,8 @@
     cc       = "clang -fPIC -g" optimize;
   #elif defined(__GNUC__)
     compiler = "gcc";
-    if (strncasecmp(os, "cygwin",  6) == 0) {
-      // Avoid cygwin specific warning that -fPIC is ignored.
+    if ((strncasecmp(os, "cygwin",  6) == 0) || (strncasecmp(os, "msys",  4) == 0) || (strncasecmp(os, "mingw32",  7) == 0) || (strncasecmp(os, "mingw64",  7) == 0)) {
+      // Avoid cygwin/msys/mingw specific warning that -fPIC is ignored.
       cc = "gcc -g" optimize;
     } else {
       cc = "gcc -fPIC -g" optimize;
--- src/test/confidence/testenv.sh.orig     2017-01-14 20:15:22.597444500 +0300
+++ src/test/confidence/testenv.sh  2017-01-14 20:19:37.137003300 +0300
@@ -16,6 +16,6 @@
 # Under gcc generate assembly source for source change test.
 # NOTE: The cygwin 64 bit build has relocation errors with
 # these assembly generation options.
-if [ "$COMPILER" = "gcc" -a "$FLAVOUR" != "cygwin.LP64.gcc" ]
+if [ "$COMPILER" = "gcc" -a "$FLAVOUR" != "cygwin.LP64.gcc" -a "$FLAVOUR" != "msys.LP64.gcc" -a "$FLAVOUR" != "mingw32.LP64.gcc" -a "$FLAVOUR" != "mingw64.LP64.gcc" ]
 then export CFLAGS="-gstabs -g1 -Wa,-acdhln=new.asm -Wl,-Map=output.map"
 fi
dcwbrown commented 7 years ago

You may need to force static linking?

aixp commented 7 years ago

Static linking works, you mean dependence of msys-2.0.dll?