diff -durN inetutils-1.9.4.orig/build-aux/config.guess inetutils-1.9.4/build-aux/config.guess
--- inetutils-1.9.4.orig/build-aux/config.guess	2017-05-15 16:31:02.484375000 +0800
+++ inetutils-1.9.4/build-aux/config.guess	2017-05-15 16:34:37.750000000 +0800
@@ -892,6 +892,9 @@
     amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
 	echo x86_64-unknown-cygwin
 	exit ;;
+    amd64:MSYS*:*:* | x86_64:MSYS*:*:*)
+	echo x86_64-unknown-msys
+	exit ;;
     p*:CYGWIN*:*)
 	echo powerpcle-unknown-cygwin
 	exit ;;
diff -durN inetutils-1.9.4.orig/build-aux/config.rpath inetutils-1.9.4/build-aux/config.rpath
--- inetutils-1.9.4.orig/build-aux/config.rpath	2017-05-15 11:18:22.000000000 +0800
+++ inetutils-1.9.4/build-aux/config.rpath	2017-05-15 16:35:45.796875000 +0800
@@ -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 -durN inetutils-1.9.4.orig/configure inetutils-1.9.4/configure
--- inetutils-1.9.4.orig/configure	2017-05-15 11:25:23.000000000 +0800
+++ inetutils-1.9.4/configure	2017-05-15 16:39:53.750000000 +0800
@@ -8698,7 +8698,7 @@
      else
        case "$host_os" in
                                                                osf*) gl_use_threads=no ;;
-         cygwin*)
+         cygwin* | msys*)
                case `uname -r` in
                  1.[0-5].*) gl_use_threads=no ;;
                  *)         gl_use_threads=yes ;;
@@ -11154,7 +11154,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
@@ -14135,6 +14135,8 @@
             *-gnu*)  gl_cv_func_getcwd_null="guessing yes";;
                      # Guess yes on Cygwin.
             cygwin*) gl_cv_func_getcwd_null="guessing yes";;
+                     # Guess yes on msys.
+            msys*)   gl_cv_func_getcwd_null="guessing yes";;
                      # If we don't know, assume the worst.
             *)       gl_cv_func_getcwd_null="guessing no";;
           esac
@@ -17171,7 +17173,7 @@
   case "$host_os" in
           # Guess yes on platforms where we know the result.
           *-gnu* | freebsd* | netbsd* | openbsd* \
-          | hpux* | solaris* | cygwin* | mingw*)
+          | hpux* | solaris* | cygwin* | msys* | mingw*)
             ac_cv_func_malloc_0_nonnull=yes ;;
           # If we don't know, assume the worst.
           *) ac_cv_func_malloc_0_nonnull=no ;;
@@ -21850,6 +21852,8 @@
            case "$host_os" in
                       # Guess no on Cygwin.
              cygwin*) gl_cv_func_btowc_nul="guessing no" ;;
+                      # Guess no on msys.
+             msys*)   gl_cv_func_btowc_nul="guessing no" ;;
                       # Guess yes otherwise.
              *)       gl_cv_func_btowc_nul="guessing yes" ;;
            esac
@@ -22719,7 +22723,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
@@ -22862,6 +22866,8 @@
              gl_cv_func_dup2_works="guessing no" ;;
            cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0
              gl_cv_func_dup2_works="guessing no" ;;
+           msys*) # on MSYS, 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,
                    # not EBADF.
@@ -23218,7 +23224,7 @@
 else
   if test "$cross_compiling" = yes; then :
   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
@@ -26288,7 +26294,7 @@
 else
   if test "$cross_compiling" = yes; then :
   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
@@ -29190,7 +29196,7 @@
   case "$host_os" in
           # Guess yes on platforms where we know the result.
           *-gnu* | freebsd* | netbsd* | openbsd* \
-          | hpux* | solaris* | cygwin* | mingw*)
+          | hpux* | solaris* | cygwin* | msys* | mingw*)
             ac_cv_func_malloc_0_nonnull=yes ;;
           # If we don't know, assume the worst.
           *) ac_cv_func_malloc_0_nonnull=no ;;
@@ -32599,7 +32605,7 @@
   case "$host_os" in
           # Guess yes on platforms where we know the result.
           *-gnu* | freebsd* | netbsd* | openbsd* \
-          | hpux* | solaris* | cygwin* | mingw*)
+          | hpux* | solaris* | cygwin* | msys* | mingw*)
             ac_cv_func_realloc_0_nonnull=yes ;;
           # If we don't know, assume the worst.
           *) ac_cv_func_realloc_0_nonnull=no ;;
diff -durN inetutils-1.9.4.orig/lib/Makefile.am inetutils-1.9.4/lib/Makefile.am
--- inetutils-1.9.4.orig/lib/Makefile.am	2017-05-15 11:22:12.000000000 +0800
+++ inetutils-1.9.4/lib/Makefile.am	2017-05-15 16:42:28.359375000 +0800
@@ -1018,7 +1018,7 @@
 	  case '$(host_os)' in \
 	    darwin[56]*) \
 	      need_charset_alias=true ;; \
-	    darwin* | cygwin* | mingw* | pw32* | cegcc*) \
+	    darwin* | cygwin* | msys* | mingw* | pw32* | cegcc*) \
 	      need_charset_alias=false ;; \
 	    *) \
 	      need_charset_alias=true ;; \
diff -durN inetutils-1.9.4.orig/lib/Makefile.in inetutils-1.9.4/lib/Makefile.in
--- inetutils-1.9.4.orig/lib/Makefile.in	2017-05-15 11:25:42.000000000 +0800
+++ inetutils-1.9.4/lib/Makefile.in	2017-05-15 16:42:52.390625000 +0800
@@ -2476,7 +2476,7 @@
 	  case '$(host_os)' in \
 	    darwin[56]*) \
 	      need_charset_alias=true ;; \
-	    darwin* | cygwin* | mingw* | pw32* | cegcc*) \
+	    darwin* | cygwin* | msys* | mingw* | pw32* | cegcc*) \
 	      need_charset_alias=false ;; \
 	    *) \
 	      need_charset_alias=true ;; \
diff -durN inetutils-1.9.4.orig/m4/btowc.m4 inetutils-1.9.4/m4/btowc.m4
--- inetutils-1.9.4.orig/m4/btowc.m4	2017-05-15 11:19:19.000000000 +0800
+++ inetutils-1.9.4/m4/btowc.m4	2017-05-15 16:43:34.828125000 +0800
@@ -50,6 +50,8 @@
            case "$host_os" in
                       # Guess no on Cygwin.
              cygwin*) gl_cv_func_btowc_nul="guessing no" ;;
+                      # Guess no on msys.
+             msys*)   gl_cv_func_btowc_nul="guessing no" ;;
                       # Guess yes otherwise.
              *)       gl_cv_func_btowc_nul="guessing yes" ;;
            esac
diff -durN inetutils-1.9.4.orig/m4/double-slash-root.m4 inetutils-1.9.4/m4/double-slash-root.m4
--- inetutils-1.9.4.orig/m4/double-slash-root.m4	2017-05-15 11:19:20.000000000 +0800
+++ inetutils-1.9.4/m4/double-slash-root.m4	2017-05-15 16:44:08.484375000 +0800
@@ -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 -durN inetutils-1.9.4.orig/m4/dup2.m4 inetutils-1.9.4/m4/dup2.m4
--- inetutils-1.9.4.orig/m4/dup2.m4	2017-05-15 11:19:21.000000000 +0800
+++ inetutils-1.9.4/m4/dup2.m4	2017-05-15 16:44:44.093750000 +0800
@@ -80,6 +80,8 @@
              gl_cv_func_dup2_works="guessing no" ;;
            cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0
              gl_cv_func_dup2_works="guessing no" ;;
+           msys*) # on MSYS, 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,
                    # not EBADF.
diff -durN inetutils-1.9.4.orig/m4/fcntl.m4 inetutils-1.9.4/m4/fcntl.m4
--- inetutils-1.9.4.orig/m4/fcntl.m4	2017-05-15 11:19:22.000000000 +0800
+++ inetutils-1.9.4/m4/fcntl.m4	2017-05-15 16:45:14.937500000 +0800
@@ -69,7 +69,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 -durN inetutils-1.9.4.orig/m4/getcwd.m4 inetutils-1.9.4/m4/getcwd.m4
--- inetutils-1.9.4.orig/m4/getcwd.m4	2017-05-15 11:19:25.000000000 +0800
+++ inetutils-1.9.4/m4/getcwd.m4	2017-05-15 16:46:34.015625000 +0800
@@ -52,6 +52,8 @@
             *-gnu*)  gl_cv_func_getcwd_null="guessing yes";;
                      # Guess yes on Cygwin.
             cygwin*) gl_cv_func_getcwd_null="guessing yes";;
+                     # Guess yes on msys.
+            msys*)   gl_cv_func_getcwd_null="guessing yes";;
                      # If we don't know, assume the worst.
             *)       gl_cv_func_getcwd_null="guessing no";;
           esac
diff -durN inetutils-1.9.4.orig/m4/getdtablesize.m4 inetutils-1.9.4/m4/getdtablesize.m4
--- inetutils-1.9.4.orig/m4/getdtablesize.m4	2017-05-15 11:19:25.000000000 +0800
+++ inetutils-1.9.4/m4/getdtablesize.m4	2017-05-15 16:47:11.453125000 +0800
@@ -28,7 +28,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 -durN inetutils-1.9.4.orig/m4/intl.m4 inetutils-1.9.4/m4/intl.m4
--- inetutils-1.9.4.orig/m4/intl.m4	2017-05-15 11:19:29.000000000 +0800
+++ inetutils-1.9.4/m4/intl.m4	2017-05-15 16:48:00.015625000 +0800
@@ -113,7 +113,7 @@
   dnl    exported variables _also_ in the static library.
   if test "$enable_shared" = yes; then
     case "$host_os" in
-      mingw* | cygwin*) is_woe32dll=yes ;;
+      mingw* | cygwin* | msys*) is_woe32dll=yes ;;
       *) is_woe32dll=no ;;
     esac
   else
@@ -125,7 +125,7 @@
   dnl On mingw and Cygwin, we can activate special Makefile rules which add
   dnl version information to the shared libraries and executables.
   case "$host_os" in
-    mingw* | cygwin*) is_woe32=yes ;;
+    mingw* | cygwin* | msys*) is_woe32=yes ;;
     *) is_woe32=no ;;
   esac
   WOE32=$is_woe32
diff -durN inetutils-1.9.4.orig/m4/malloc.m4 inetutils-1.9.4/m4/malloc.m4
--- inetutils-1.9.4.orig/m4/malloc.m4	2017-05-15 11:19:34.000000000 +0800
+++ inetutils-1.9.4/m4/malloc.m4	2017-05-15 16:48:33.468750000 +0800
@@ -33,7 +33,7 @@
        [case "$host_os" in
           # Guess yes on platforms where we know the result.
           *-gnu* | freebsd* | netbsd* | openbsd* \
-          | hpux* | solaris* | cygwin* | mingw*)
+          | hpux* | solaris* | cygwin* | msys* | mingw*)
             ac_cv_func_malloc_0_nonnull=yes ;;
           # If we don't know, assume the worst.
           *) ac_cv_func_malloc_0_nonnull=no ;;
diff -durN inetutils-1.9.4.orig/m4/printf.m4 inetutils-1.9.4/m4/printf.m4
--- inetutils-1.9.4.orig/m4/printf.m4	2017-05-15 11:19:40.000000000 +0800
+++ inetutils-1.9.4/m4/printf.m4	2017-05-15 16:49:41.140625000 +0800
@@ -730,6 +730,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";;
            *)               gl_cv_func_printf_directive_ls="guessing yes";;
          esac
@@ -807,6 +808,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";;
            mingw* | pw*) gl_cv_func_printf_flag_grouping="guessing no";;
            *)            gl_cv_func_printf_flag_grouping="guessing yes";;
@@ -1459,6 +1461,8 @@
            darwin*)              gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
                                  # Guess yes on Cygwin.
            cygwin*)              gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+                                 # Guess yes on msys.
+           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 -durN inetutils-1.9.4.orig/m4/realloc.m4 inetutils-1.9.4/m4/realloc.m4
--- inetutils-1.9.4.orig/m4/realloc.m4	2017-05-15 11:19:41.000000000 +0800
+++ inetutils-1.9.4/m4/realloc.m4	2017-05-15 16:50:47.265625000 +0800
@@ -33,7 +33,7 @@
        [case "$host_os" in
           # Guess yes on platforms where we know the result.
           *-gnu* | freebsd* | netbsd* | openbsd* \
-          | hpux* | solaris* | cygwin* | mingw*)
+          | hpux* | solaris* | cygwin* | msys* | mingw*)
             ac_cv_func_realloc_0_nonnull=yes ;;
           # If we don't know, assume the worst.
           *) ac_cv_func_realloc_0_nonnull=no ;;
diff -durN inetutils-1.9.4.orig/m4/threadlib.m4 inetutils-1.9.4/m4/threadlib.m4
--- inetutils-1.9.4.orig/m4/threadlib.m4	2017-05-15 11:19:48.000000000 +0800
+++ inetutils-1.9.4/m4/threadlib.m4	2017-05-15 16:51:53.125000000 +0800
@@ -68,7 +68,7 @@
          dnl bugs that lead to endless loops or crashes. See
          dnl <http://cygwin.com/ml/cygwin/2009-08/msg00283.html>.
          osf*) gl_use_threads=no ;;
-         cygwin*)
+         cygwin* | msys*)
                case `uname -r` in
                  1.[0-5].*) gl_use_threads=no ;;
                  *)         gl_use_threads=yes ;;
