diff -Naur gnutls-3.6.3-orig/build-aux/ar-lib gnutls-3.6.3/build-aux/ar-lib
--- gnutls-3.6.3-orig/build-aux/ar-lib	2018-07-13 08:14:46.000000000 +0300
+++ gnutls-3.6.3/build-aux/ar-lib	2018-07-26 13:56:44.494565900 +0300
@@ -56,6 +56,9 @@
 	  CYGWIN* | MSYS*)
 	    file_conv=cygwin
 	    ;;
+	  MSYS*)
+	    file_conv=cygwin
+	    ;;
 	  *)
 	    file_conv=wine
 	    ;;
@@ -68,6 +71,9 @@
 	cygwin | msys)
 	  file=`cygpath -m "$file" || echo "$file"`
 	  ;;
+	msys)
+	  file=`cygpath -m "$file" || echo "$file"`
+	  ;;
 	wine)
 	  file=`winepath -w "$file" || echo "$file"`
 	  ;;
diff -Naur gnutls-3.6.3-orig/build-aux/config.guess gnutls-3.6.3/build-aux/config.guess
--- gnutls-3.6.3-orig/build-aux/config.guess	2018-06-16 16:27:19.000000000 +0300
+++ gnutls-3.6.3/build-aux/config.guess	2018-07-26 13:57:41.060265300 +0300
@@ -917,6 +917,9 @@
     amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
 	echo x86_64-pc-cygwin
 	exit ;;
+    amd64:MSYS*:*:* | x86_64:MSYS*:*:*)
+	echo x86_64-unknown-msys
+	exit ;;
     prep*:SunOS:5.*:*)
 	echo powerpcle-unknown-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')"
 	exit ;;
diff -Naur gnutls-3.6.3-orig/build-aux/config.rpath gnutls-3.6.3/build-aux/config.rpath
--- gnutls-3.6.3-orig/build-aux/config.rpath	2018-07-13 08:13:41.000000000 +0300
+++ gnutls-3.6.3/build-aux/config.rpath	2018-07-26 13:58:24.927542300 +0300
@@ -57,7 +57,7 @@
     aix*)
       wl='-Wl,'
       ;;
-    mingw* | cygwin* | pw32* | os2* | cegcc*)
+    mingw* | cygwin* | msys* | pw32* | os2* | cegcc*)
       ;;
     hpux9* | hpux10* | hpux11*)
       wl='-Wl,'
@@ -149,7 +149,7 @@
 hardcode_minus_L=no
 
 case "$host_os" in
-  cygwin* | mingw* | pw32* | cegcc*)
+  cygwin* | msys* | mingw* | pw32* | cegcc*)
     # FIXME: the MSVC++ port hasn't been tested in a loooong time
     # When not using gcc, we currently assume that we are using
     # Microsoft Visual C++.
@@ -198,7 +198,7 @@
         ld_shlibs=no
       fi
       ;;
-    cygwin* | mingw* | pw32* | cegcc*)
+    cygwin* | msys* | mingw* | pw32* | cegcc*)
       # hardcode_libdir_flag_spec is actually meaningless, as there is
       # no search path for DLLs.
       hardcode_libdir_flag_spec='-L$libdir'
@@ -348,7 +348,7 @@
       ;;
     bsdi[45]*)
       ;;
-    cygwin* | mingw* | pw32* | cegcc*)
+    cygwin* | msys* | mingw* | pw32* | cegcc*)
       # When not using gcc, we currently assume that we are using
       # Microsoft Visual C++.
       # hardcode_libdir_flag_spec is actually meaningless, as there is
@@ -533,7 +533,7 @@
   bsdi[45]*)
     library_names_spec='$libname$shrext'
     ;;
-  cygwin* | mingw* | pw32* | cegcc*)
+  cygwin* | msys* | mingw* | pw32* | cegcc*)
     shrext=.dll
     library_names_spec='$libname.dll.a $libname.lib'
     ;;
diff -Naur gnutls-3.6.3-orig/m4/dup2.m4 gnutls-3.6.3/m4/dup2.m4
--- gnutls-3.7.0/m4/dup2.m4.orig	2020-12-09 23:35:38.804994300 +0100
+++ gnutls-3.7.0/m4/dup2.m4	2020-12-09 23:36:31.302546400 +0100
@@ -69,7 +69,7 @@
       [case "$host_os" in
          mingw*) # on this platform, dup2 always returns 0 for success
            gl_cv_func_dup2_works="guessing no" ;;
-         cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0
+         cygwin* | msys*) # on cygwin 1.5.x, dup2(1,1) returns 0
            gl_cv_func_dup2_works="guessing no" ;;
          aix* | freebsd*)
                  # on AIX 7.1 and FreeBSD 6.1, dup2 (1,toobig) gives EMFILE,
diff -Naur gnutls-3.6.3-orig/m4/fcntl.m4 gnutls-3.6.3/m4/fcntl.m4
--- gnutls-3.6.3-orig/m4/fcntl.m4	2018-07-13 08:13:42.000000000 +0300
+++ gnutls-3.6.3/m4/fcntl.m4	2018-07-26 13:59:23.474445200 +0300
@@ -70,7 +70,7 @@
          [gl_cv_func_fcntl_f_dupfd_works=yes],
          [gl_cv_func_fcntl_f_dupfd_works=no],
          [case $host_os in
-            aix* | cygwin* | haiku*)
+            aix* | cygwin* | msys* | haiku*)
                gl_cv_func_fcntl_f_dupfd_works="guessing no" ;;
             *) gl_cv_func_fcntl_f_dupfd_works="guessing yes" ;;
           esac])])
diff -Naur gnutls-3.6.3-orig/m4/getcwd.m4 gnutls-3.6.3/m4/getcwd.m4
--- gnutls-3.6.3-orig/src/gl/m4/getcwd.m4	2018-07-13 08:13:42.000000000 +0300
+++ gnutls-3.6.3/src/gl/m4/getcwd.m4	2018-07-26 13:59:50.899293300 +0300
@@ -54,7 +54,7 @@
                            # Guess yes on musl systems.
             *-musl*)       gl_cv_func_getcwd_null="guessing yes";;
                            # Guess yes on Cygwin.
-            cygwin*)       gl_cv_func_getcwd_null="guessing yes";;
+            cygwin*|msys*) gl_cv_func_getcwd_null="guessing yes";;
                            # If we don't know, obey --enable-cross-guesses.
             *)             gl_cv_func_getcwd_null="$gl_cross_guess_normal";;
           esac
diff -Naur gnutls-3.6.3-orig/m4/getdtablesize.m4 gnutls-3.6.3/m4/getdtablesize.m4
--- gnutls-3.6.3-orig/m4/getdtablesize.m4	2018-07-13 08:13:42.000000000 +0300
+++ gnutls-3.6.3/m4/getdtablesize.m4	2018-07-26 14:00:10.149727100 +0300
@@ -42,7 +42,7 @@
              [gl_cv_func_getdtablesize_works=yes],
              [gl_cv_func_getdtablesize_works=no],
              [case "$host_os" in
-                cygwin*) # on cygwin 1.5.25, getdtablesize() automatically grows
+                cygwin* | msys*) # on cygwin 1.5.25, getdtablesize() automatically grows
                   gl_cv_func_getdtablesize_works="guessing no" ;;
                 *) gl_cv_func_getdtablesize_works="guessing yes" ;;
               esac
diff -Naur gnutls-3.6.3-orig/m4/printf.m4 gnutls-3.6.3/m4/printf.m4
--- gnutls-3.6.3-orig/m4/printf.m4	2018-07-13 08:13:42.000000000 +0300
+++ gnutls-3.6.3/m4/printf.m4	2018-07-26 14:01:04.375422400 +0300
@@ -817,6 +817,7 @@
            irix*)           gl_cv_func_printf_directive_ls="guessing no";;
            solaris*)        gl_cv_func_printf_directive_ls="guessing no";;
            cygwin*)         gl_cv_func_printf_directive_ls="guessing no";;
+           msys*)           gl_cv_func_printf_directive_ls="guessing no";;
            beos* | haiku*)  gl_cv_func_printf_directive_ls="guessing no";;
                             # Guess no on Android.
            linux*-android*) gl_cv_func_printf_directive_ls="guessing no";;
@@ -901,6 +902,7 @@
 changequote(,)dnl
          case "$host_os" in
            cygwin*)         gl_cv_func_printf_flag_grouping="guessing no";;
+           msys*)           gl_cv_func_printf_flag_grouping="guessing no";;
            netbsd*)         gl_cv_func_printf_flag_grouping="guessing no";;
                             # Guess no on Android.
            linux*-android*) gl_cv_func_printf_flag_grouping="guessing no";;
@@ -1614,6 +1616,7 @@
            darwin*)              gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
                                  # Guess yes on Cygwin.
            cygwin*)              gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+           msys*)                gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
                                  # Guess yes on Solaris >= 2.6.
            solaris2.[0-5] | solaris2.[0-5].*)
                                  gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
diff -Naur gnutls-3.6.3-orig/m4/threadlib.m4 gnutls-3.6.3/m4/threadlib.m4
--- gnutls-3.6.3-orig/m4/threadlib.m4	2018-07-13 08:13:42.000000000 +0300
+++ gnutls-3.6.3/m4/threadlib.m4	2018-07-26 14:01:49.554101800 +0300
@@ -413,7 +413,7 @@
          dnl Disable multithreading by default on Cygwin 1.5.x, because it has
          dnl bugs that lead to endless loops or crashes. See
          dnl <https://cygwin.com/ml/cygwin/2009-08/msg00283.html>.
-         cygwin*)
+         cygwin* | msys*)
                case `uname -r` in
                  1.[0-5].*) gl_use_threads=no ;;
                  *)         gl_use_threads=yes ;;
