diff -Naur libatomic_ops-7.6.6-orig/compile libatomic_ops-7.6.6/compile
--- libatomic_ops-7.6.6-orig/compile	2018-08-07 10:34:42.000000000 +0300
+++ libatomic_ops-7.6.6/compile	2018-12-10 15:16:19.877409800 +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 libatomic_ops-7.6.6-orig/config.guess libatomic_ops-7.6.6/config.guess
--- libatomic_ops-7.6.6-orig/config.guess	2018-08-07 10:34:42.000000000 +0300
+++ libatomic_ops-7.6.6/config.guess	2018-12-10 15:16:01.921778300 +0300
@@ -867,6 +867,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 -Naur libatomic_ops-7.6.6-orig/configure.ac libatomic_ops-7.6.6/configure.ac
--- libatomic_ops-7.6.6-orig/configure.ac	2018-08-07 10:33:44.000000000 +0300
+++ libatomic_ops-7.6.6/configure.ac	2018-12-10 15:16:44.166652500 +0300
@@ -42,7 +42,7 @@
   fi
 
   case "$host" in
-    *-*-cygwin* | *-*-mingw*)
+    *-*-cygwin* | *-*-msys* | *-*-mingw*)
       # Cygwin and Mingw[-w32/64] do not need -fPIC.
       AC_MSG_RESULT([not needed])
       ;;
@@ -214,7 +214,7 @@
     *-*-openbsd* | *-*-kfreebsd*-gnu | *-*-dgux*)
       THREADDLLIBS=-pthread
       ;;
-    *-*-cygwin* | *-*-darwin*)
+    *-*-cygwin* | *-*-msys* | *-*-darwin*)
       # Cygwin does not have a real libpthread, so Libtool cannot link
       # against it.
       THREADDLLIBS=
