diff -Naur diffutils-3.7-orig/build-aux/ar-lib diffutils-3.7/build-aux/ar-lib
--- diffutils-3.7-orig/build-aux/ar-lib	2017-02-24 08:10:09.000000000 +0300
+++ diffutils-3.7/build-aux/ar-lib	2019-01-15 10:45:13.257024200 +0300
@@ -56,6 +56,9 @@
 	  CYGWIN*)
 	    file_conv=cygwin
 	    ;;
+	  MSYS*)
+	    file_conv=cygwin
+	    ;;
 	  *)
 	    file_conv=wine
 	    ;;
@@ -68,6 +71,9 @@
 	cygwin)
 	  file=`cygpath -m "$file" || echo "$file"`
 	  ;;
+	msys)
+	  file=`cygpath -m "$file" || echo "$file"`
+	  ;;
 	wine)
 	  file=`winepath -w "$file" || echo "$file"`
 	  ;;
diff -Naur diffutils-3.7-orig/build-aux/config.guess diffutils-3.7/build-aux/config.guess
--- diffutils-3.7-orig/build-aux/config.guess	2018-12-24 04:21:56.000000000 +0300
+++ diffutils-3.7/build-aux/config.guess	2019-01-15 10:45:58.513703700 +0300
@@ -947,6 +947,9 @@
     amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
 	GUESS=x86_64-pc-cygwin
 	;;
+    amd64:MSYS*:*:* | x86_64:MSYS*:*:*)
+	echo x86_64-pc-msys
+	exit ;;
     prep*:SunOS:5.*:*)
 	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
 	GUESS=powerpcle-unknown-solaris2$SUN_REL
diff -Naur diffutils-3.7-orig/build-aux/config.rpath diffutils-3.7/build-aux/config.rpath
--- diffutils-3.7-orig/build-aux/config.rpath	2018-01-07 03:45:52.000000000 +0300
+++ diffutils-3.7/build-aux/config.rpath	2019-01-15 10:41:20.503615300 +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 diffutils-3.7-orig/m4/btowc.m4 diffutils-3.7/m4/btowc.m4
--- diffutils-3.7-orig/m4/btowc.m4	2018-01-07 03:45:52.000000000 +0300
+++ diffutils-3.7/m4/btowc.m4	2019-01-16 07:32:38.096944800 +0300
@@ -43,6 +43,8 @@
                       # Guess no on Cygwin.
              cygwin*) gl_cv_func_btowc_nul="guessing no" ;;
                       # Guess yes on native Windows.
+             msys*)   gl_cv_func_btowc_nul="guessing no" ;;
+                      # Guess yes on native Windows.
              mingw*)  gl_cv_func_btowc_nul="guessing yes" ;;
                       # Guess yes otherwise.
              *)       gl_cv_func_btowc_nul="guessing yes" ;;
diff -Naur diffutils-3.7-orig/m4/double-slash-root.m4 diffutils-3.7/m4/double-slash-root.m4
--- diffutils-3.7-orig/m4/double-slash-root.m4	2018-01-07 03:45:52.000000000 +0300
+++ diffutils-3.7/m4/double-slash-root.m4	2019-01-15 10:41:20.534815400 +0300
@@ -16,7 +16,7 @@
         # special semantics and is distinct from /, please report it to
         # <bug-gnulib@gnu.org>.
         case $host in
-          *-cygwin | i370-ibm-openedition)
+          *-cygwin | *-msys | i370-ibm-openedition)
             gl_cv_double_slash_root=yes ;;
           *)
             # Be optimistic and assume that / and // are the same when we
diff -Naur diffutils-3.7-orig/m4/dup2.m4 diffutils-3.7/m4/dup2.m4
--- diffutils-3.7-orig/m4/dup2.m4	2018-01-07 03:45:52.000000000 +0300
+++ diffutils-3.7/m4/dup2.m4	2019-01-15 10:41:20.550415400 +0300
@@ -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 diffutils-3.7-orig/m4/fcntl.m4 diffutils-3.7/m4/fcntl.m4
--- diffutils-3.7-orig/m4/fcntl.m4	2018-01-07 03:45:52.000000000 +0300
+++ diffutils-3.7/m4/fcntl.m4	2019-01-16 07:33:22.262070800 +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 diffutils-3.7-orig/m4/getcwd.m4 diffutils-3.7/m4/getcwd.m4
--- diffutils-3.7-orig/m4/getcwd.m4	2018-06-25 07:08:29.000000000 +0300
+++ diffutils-3.7/m4/getcwd.m4	2019-01-16 07:33:54.355413900 +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 diffutils-3.7-orig/m4/printf.m4 diffutils-3.7/m4/printf.m4
--- diffutils-3.7-orig/m4/printf.m4	2018-12-24 04:21:56.000000000 +0300
+++ diffutils-3.7/m4/printf.m4	2019-01-16 07:34:27.521072200 +0300
@@ -816,7 +816,7 @@
            openbsd*)        gl_cv_func_printf_directive_ls="guessing yes";;
            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";;
+           cygwin* | 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";;
@@ -900,7 +900,7 @@
         [
 changequote(,)dnl
          case "$host_os" in
-           cygwin*)         gl_cv_func_printf_flag_grouping="guessing no";;
+           cygwin* | 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";;
@@ -1613,7 +1613,7 @@
            darwin[1-6].*)        gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
            darwin*)              gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
                                  # Guess yes on Cygwin.
-           cygwin*)              gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+           cygwin* | 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 diffutils-3.7-orig/m4/setlocale_null.m4 diffutils-3.7/m4/setlocale_null.m4
--- diffutils-3.7-orig/m4/setlocale_null.m4	2018-12-24 04:21:56.000000000 +0300
+++ diffutils-3.7/m4/setlocale_null.m4	2019-01-15 10:41:20.597215500 +0300
@@ -14,7 +14,7 @@
     [gl_cv_func_setlocale_null_all_mtsafe],
     [case "$host_os" in
        # Guess no on musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin.
-       *-musl* | darwin* | freebsd* | midnightbsd* | netbsd* | openbsd* | aix* | haiku* | cygwin*)
+       *-musl* | darwin* | freebsd* | midnightbsd* | netbsd* | openbsd* | aix* | haiku* | cygwin* | msys*)
          gl_cv_func_setlocale_null_all_mtsafe=no ;;
        # Guess yes on glibc, HP-UX, IRIX, Solaris, native Windows.
        *-gnu* | gnu* | hpux* | irix* | solaris* | mingw*)
@@ -48,7 +48,7 @@
        openbsd* | aix*)
          gl_cv_func_setlocale_null_one_mtsafe=no ;;
        # Guess yes on glibc, musl libc, macOS, FreeBSD, NetBSD, HP-UX, IRIX, Solaris, Haiku, Cygwin, native Windows.
-       *-gnu* | gnu* | *-musl* | darwin* | freebsd* | midnightbsd* | netbsd* | hpux* | irix* | solaris* | haiku* | cygwin* | mingw*)
+       *-gnu* | gnu* | *-musl* | darwin* | freebsd* | midnightbsd* | netbsd* | hpux* | irix* | solaris* | haiku* | cygwin* | mingw* | msys*)
          gl_cv_func_setlocale_null_one_mtsafe=yes ;;
        # If we don't know, obey --enable-cross-guesses.
        *)
diff -Naur diffutils-3.7-orig/m4/wctob.m4 diffutils-3.7/m4/wctob.m4
--- diffutils-3.7-orig/m4/wctob.m4	2018-01-07 03:45:53.000000000 +0300
+++ diffutils-3.7/m4/wctob.m4	2019-01-16 07:35:46.613211100 +0300
@@ -29,7 +29,7 @@
 changequote(,)dnl
         case "$host_os" in
             # Guess no on Solaris <= 9 and Cygwin.
-          solaris2.[1-9] | solaris2.[1-9].* | cygwin*)
+          solaris2.[1-9] | solaris2.[1-9].* | cygwin* | msys*)
             gl_cv_func_wctob_works="guessing no" ;;
             # Guess no on native Windows.
           mingw*)
@@ -39,7 +39,7 @@
         esac
 changequote([,])dnl
         case "$host_os" in
-          cygwin*)
+          cygwin* | msys*)
             AC_RUN_IFELSE(
               [AC_LANG_SOURCE([[
 #include <locale.h>
