diff -Naur groff-1.22.4-orig/build-aux/compile groff-1.22.4/build-aux/compile
--- groff-1.22.4-orig/build-aux/compile	2018-12-23 17:34:27.000000000 +0300
+++ groff-1.22.4/build-aux/compile	2019-04-25 12:16:09.459801800 +0300
@@ -53,7 +53,7 @@
 	  MINGW*)
 	    file_conv=mingw
 	    ;;
-	  CYGWIN*)
+	  CYGWIN* | MSYS*)
 	    file_conv=cygwin
 	    ;;
 	  *)
@@ -67,7 +67,7 @@
 	mingw/*)
 	  file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
 	  ;;
-	cygwin/*)
+	cygwin/* | msys/*)
 	  file=`cygpath -m "$file" || echo "$file"`
 	  ;;
 	wine/*)
diff -Naur groff-1.22.4-orig/build-aux/config.guess groff-1.22.4/build-aux/config.guess
--- groff-1.22.4-orig/build-aux/config.guess	2018-10-10 23:39:38.000000000 +0300
+++ groff-1.22.4/build-aux/config.guess	2019-04-25 12:16:33.190835000 +0300
@@ -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 ;;
     prep*:SunOS:5.*:*)
 	echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
 	exit ;;
diff -Naur groff-1.22.4-orig/build-aux/config.rpath groff-1.22.4/build-aux/config.rpath
--- groff-1.22.4-orig/build-aux/config.rpath	2018-12-23 17:34:15.000000000 +0300
+++ groff-1.22.4/build-aux/config.rpath	2019-04-25 12:17:36.902924300 +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 groff-1.22.4-orig/gnulib_m4/printf.m4 groff-1.22.4/gnulib_m4/printf.m4
--- groff-1.22.4-orig/gnulib_m4/printf.m4	2018-12-23 17:34:15.000000000 +0300
+++ groff-1.22.4/gnulib_m4/printf.m4	2019-04-25 12:40:20.796217200 +0300
@@ -770,6 +770,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 yes on native Windows.
            mingw*)         gl_cv_func_printf_directive_ls="guessing yes";;
@@ -1525,6 +1526,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";;
