diff -Naur gzip-1.9-orig/build-aux/config.guess gzip-1.9/build-aux/config.guess
--- gzip-1.9-orig/build-aux/config.guess	2013-06-10 00:37:56.000000000 +0400
+++ gzip-1.9/build-aux/config.guess	2013-07-18 07:41:13.692382800 +0400
@@ -947,6 +947,9 @@ EOF
     amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
 	GUESS=x86_64-pc-cygwin
 	;;
+    amd64:MSYS*:*:* | x86_64:MSYS*:*:*)
+	echo x86_64-unknown-msys
+	exit ;;
     prep*:SunOS:5.*:*)
 	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
 	GUESS=powerpcle-unknown-solaris2$SUN_REL
diff -Naur gzip-1.6-orig/m4/double-slash-root.m4 gzip-1.6/m4/double-slash-root.m4
--- gzip-1.6-orig/m4/double-slash-root.m4	2013-06-10 00:37:56.000000000 +0400
+++ gzip-1.6/m4/double-slash-root.m4	2013-07-18 07:42:34.503906300 +0400
@@ -16,7 +16,7 @@ AC_DEFUN([gl_DOUBLE_SLASH_ROOT],
         # 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 gzip-1.6-orig/m4/dup2.m4 gzip-1.6/m4/dup2.m4
--- gzip-1.6-orig/m4/dup2.m4	2013-06-10 00:37:56.000000000 +0400
+++ gzip-1.6/m4/dup2.m4	2013-07-18 07:42:55.613281300 +0400
@@ -69,7 +69,7 @@ AC_DEFUN([gl_FUNC_DUP2],
       [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 gzip-1.9-orig/m4/getcwd.m4 gzip-1.9/m4/getcwd.m4
--- gzip-1.9-orig/m4/getcwd.m4	2013-06-10 00:37:56.000000000 +0400
+++ gzip-1.9/m4/getcwd.m4	2013-07-18 07:43:29.800781300 +0400
@@ -54,7 +54,7 @@ AC_DEFUN([gl_FUNC_GETCWD_NULL],
                            # 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 gzip-1.9-orig/m4/malloc.m4 gzip-1.9/m4/malloc.m4
--- gzip-1.9-orig/m4/malloc.m4	2013-06-10 00:37:56.000000000 +0400
+++ gzip-1.9/m4/malloc.m4	2013-07-18 07:44:54.582031300 +0400
@@ -26,7 +26,7 @@ AC_DEFUN([_AC_FUNC_MALLOC_IF],
           # Guess yes on platforms where we know the result.
           *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \
           | gnu* | *-musl* | midnightbsd* \
-          | hpux* | solaris* | cygwin* | mingw* | msys* )
+          | hpux* | solaris* | cygwin* | msys* | mingw* | msys* )
             ac_cv_func_malloc_0_nonnull="guessing yes" ;;
           # If we don't know, obey --enable-cross-guesses.
           *) ac_cv_func_malloc_0_nonnull="$gl_cross_guess_normal" ;;
diff -Naur gzip-1.6-orig/m4/printf.m4 gzip-1.6/m4/printf.m4
--- gzip-1.6-orig/m4/printf.m4	2013-06-10 00:37:56.000000000 +0400
+++ gzip-1.6/m4/printf.m4	2013-07-18 07:45:28.863281300 +0400
@@ -816,7 +816,7 @@ changequote(,)dnl
            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 @@ int main ()
         [
 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 @@ changequote(,)dnl
            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 gzip-1.6-orig/m4/realloc.m4 gzip-1.6/m4/realloc.m4
--- gzip-1.6-orig/m4/realloc.m4	2013-06-10 00:37:56.000000000 +0400
+++ gzip-1.6/m4/realloc.m4	2013-07-18 07:45:49.738281300 +0400
@@ -26,7 +26,7 @@ AC_DEFUN([_AC_FUNC_REALLOC_IF],
           # Guess yes on platforms where we know the result.
           *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \
           | gnu* | *-musl* | midnightbsd* \
-          | hpux* | solaris* | cygwin* | mingw* | msys* )
+          | hpux* | solaris* | cygwin* | msys* | mingw* | msys* )
             ac_cv_func_realloc_0_nonnull="guessing yes" ;;
           # If we don't know, obey --enable-cross-guesses.
           *) ac_cv_func_realloc_0_nonnull="$gl_cross_guess_normal" ;;
diff -Naur gzip-1.6-orig/m4/threadlib.m4 gzip-1.6/m4/threadlib.m4
--- gzip-1.6-orig/m4/threadlib.m4	2013-06-10 00:37:56.000000000 +0400
+++ gzip-1.6/m4/threadlib.m4	2013-07-18 07:46:18.003906300 +0400
@@ -440,7 +440,7 @@ changequote(,)dnl
          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 ;;
