diff -Naur apr-1.4.8-orig/build/config.guess apr-1.4.8/build/config.guess
--- apr-1.4.8-orig/build/config.guess	2013-04-27 12:51:45.000000000 +0400
+++ apr-1.4.8/build/config.guess	2013-06-25 12:43:36.319336000 +0400
@@ -876,6 +876,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 apr-1.4.8-orig/configure.in apr-1.4.8/configure.in
--- apr-1.4.8-orig/configure.in	2013-06-25 12:43:55.459961000 +0400
+++ apr-1.4.8/configure.in	2013-06-25 12:43:36.788086000 +0400
@@ -298,7 +298,7 @@
     *-solaris2*)
         apr_platform_runtime_link_flag="-R"
         ;;
-    *-mingw* | *-cygwin*)
+    *-mingw* | *-cygwin* | *-msys*)
         LT_LDFLAGS="$LT_LDFLAGS -no-undefined"
         ;;
     *)
@@ -445,7 +445,7 @@
     dnl APR_DECLARE et al.
     dnl If building dynamic APR, the APR build needs APR_DECLARE_EXPORT
     dnl and the app build should have neither define.
-    *-mingw* | *-cygwin*)
+    *-mingw* | *-cygwin* | *-msys*)
         if test "$enable_shared" = "yes"; then
             APR_ADDTO(INTERNAL_CPPFLAGS, -DAPR_DECLARE_EXPORT)
         else
@@ -573,7 +573,7 @@
        proc_mutex_is_global=1
        OBJECTS_PLATFORM='$(OBJECTS_win32)'
        ;;
-   *cygwin*)
+   *cygwin* | *msys*)
        OSDIR="unix"
        enable_threads="no"
        eolstr="\\n"
diff -Naur apr-1.4.8-orig/test/testdso.c apr-1.4.8/test/testdso.c
--- apr-1.4.8-orig/test/testdso.c	2013-06-25 12:44:11.100586000 +0400
+++ apr-1.4.8/test/testdso.c	2013-06-25 12:43:36.803711000 +0400
@@ -38,6 +38,9 @@
 #elif defined(CYGWIN)
 # define MOD_NAME ".libs/mod_test.dll"
 # define LIB_NAME ".libs/cygmod_test.dll"
+#elif defined(MSYS)
+# define MOD_NAME ".libs/mod_test.dll"
+# define LIB_NAME ".libs/msys-mod_test.dll"
 #elif defined(DARWIN)
 # define MOD_NAME ".libs/mod_test.so" 
 # define LIB_NAME ".libs/libmod_test.dylib" 
