diff -Naur man-db-2.8.3-orig/gl/m4/btowc.m4 man-db-2.8.3/gl/m4/btowc.m4
--- man-db-2.8.3-orig/gl/m4/btowc.m4	2018-07-02 18:51:23.761091300 +0300
+++ man-db-2.8.3/gl/m4/btowc.m4	2018-07-02 19:22:47.106812500 +0300
@@ -51,6 +51,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 man-db-2.8.3-orig/gl/m4/double-slash-root.m4 man-db-2.8.3/gl/m4/double-slash-root.m4
--- man-db-2.8.3-orig/gl/m4/double-slash-root.m4	2018-07-02 18:51:25.581195400 +0300
+++ man-db-2.8.3/gl/m4/double-slash-root.m4	2018-07-02 19:23:30.519295500 +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 man-db-2.8.3-orig/gl/m4/dup2.m4 man-db-2.8.3/gl/m4/dup2.m4
--- man-db-2.8.3-orig/gl/m4/dup2.m4	2018-07-02 18:51:25.866211700 +0300
+++ man-db-2.8.3/gl/m4/dup2.m4	2018-07-02 19:24:15.516869300 +0300
@@ -78,7 +78,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 man-db-2.8.3-orig/gl/m4/fcntl.m4 man-db-2.8.3/gl/m4/fcntl.m4
--- man-db-2.8.3-orig/gl/m4/fcntl.m4	2018-07-02 18:51:27.428301000 +0300
+++ man-db-2.8.3/gl/m4/fcntl.m4	2018-07-02 19:24:48.494755500 +0300
@@ -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 -Naur man-db-2.8.3-orig/gl/m4/getcwd.m4 man-db-2.8.3/gl/m4/getcwd.m4
--- man-db-2.8.3-orig/gl/m4/getcwd.m4	2018-07-02 18:51:29.212403100 +0300
+++ man-db-2.8.3/gl/m4/getcwd.m4	2018-07-02 19:25:32.662281700 +0300
@@ -55,6 +55,9 @@
                            # Guess yes on Cygwin.
             cygwin*)       gl_cv_func_getcwd_null="guessing yes";;
                            # If we don't know, obey --enable-cross-guesses.
+                           # Guess yes on MSYS.
+            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 man-db-2.8.3-orig/gl/m4/getdtablesize.m4 man-db-2.8.3/gl/m4/getdtablesize.m4
--- man-db-2.8.3-orig/gl/m4/getdtablesize.m4	2018-07-02 18:51:29.519420600 +0300
+++ man-db-2.8.3/gl/m4/getdtablesize.m4	2018-07-02 19:27:35.863328400 +0300
@@ -39,7 +39,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 man-db-2.8.6.1-orig/gl/m4/intl.m4 man-db-2.8.6.1/gl/m4/intl.m4
--- man-db-2.8.6.1-orig/gl/m4/intl.m4	2018-07-02 18:51:29.519420600 +0300
+++ man-db-2.8.6.1/gl/m4/intl.m4	2018-07-02 19:27:35.863328400 +0300
@@ -112,7 +112,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
@@ -124,7 +124,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 -Naur man-db-2.8.3-orig/gl/m4/malloc.m4 man-db-2.8.3/gl/m4/malloc.m4
--- man-db-2.8.3-orig/gl/m4/malloc.m4	2018-07-02 18:51:35.074738400 +0300
+++ man-db-2.8.3/gl/m4/malloc.m4	2018-07-02 19:28:37.956880000 +0300
@@ -33,7 +33,7 @@
        [case "$host_os" in
           # Guess yes on platforms where we know the result.
           *-gnu* | gnu* | *-musl* | freebsd* | netbsd* | openbsd* \
-          | hpux* | solaris* | cygwin* | mingw*)
+          | hpux* | solaris* | cygwin* | msys* | mingw*)
             ac_cv_func_malloc_0_nonnull="guessing yes" ;;
           # If we don't know, assume the worst.
           *) ac_cv_func_malloc_0_nonnull="guessing no" ;;
diff -Naur man-db-2.8.3-orig/gl/m4/printf.m4 man-db-2.8.3/gl/m4/printf.m4
--- man-db-2.8.3-orig/gl/m4/printf.m4	2018-07-02 18:51:39.288979400 +0300
+++ man-db-2.8.3/gl/m4/printf.m4	2018-07-02 19:30:05.841906700 +0300
@@ -785,6 +785,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";;
@@ -869,6 +870,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";;
@@ -1562,6 +1564,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 man-db-2.8.3-orig/gl/m4/realloc.m4 man-db-2.8.3/gl/m4/realloc.m4
--- man-db-2.8.3-orig/gl/m4/realloc.m4	2018-07-02 18:51:40.133027700 +0300
+++ man-db-2.8.3/gl/m4/realloc.m4	2018-07-02 19:30:33.899511500 +0300
@@ -33,7 +33,7 @@
        [case "$host_os" in
           # Guess yes on platforms where we know the result.
           *-gnu* | gnu* | *-musl* | freebsd* | netbsd* | openbsd* \
-          | hpux* | solaris* | cygwin* | mingw*)
+          | hpux* | solaris* | cygwin* | msys* | mingw*)
             ac_cv_func_realloc_0_nonnull="guessing yes" ;;
           # If we don't know, assume the worst.
           *) ac_cv_func_realloc_0_nonnull="guessing no" ;;
