diff -Naur libxml2-2.9.2-orig/configure.ac libxml2-2.9.2/configure.ac
--- libxml2-2.9.2-orig/configure.ac	2013-04-19 07:25:20.000000000 +0000
+++ libxml2-2.9.2/configure.ac	2013-04-29 05:55:24.313132800 +0000
@@ -724,7 +724,7 @@
     hppa*-hp-mpeix)
         NEED_TRIO=1
 	;;
-    *-*-mingw* | *-*-cygwin* | *-*-msvc* )
+    *-*-mingw* | *-*-cygwin* | *-*-msys* | *-*-msvc* )
         # If the host is Windows, and shared libraries are disabled, we
         # need to add -DLIBXML_STATIC to CFLAGS in order for linking to
         # work properly (without it, xmlexports.h would force the use of
@@ -850,6 +850,14 @@
     AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso])
   ])
   ;;
+  *-*-msys*)
+  MODULE_EXTENSION=".dll"
+  AC_CHECK_LIB(msys-2.0, dlopen, [
+    WITH_MODULES=1
+    MODULE_PLATFORM_LIBS=
+    AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso])
+  ])
+  ;;
   *-*-mingw*)
   MODULE_EXTENSION=".dll"
   WITH_MODULES=1
@@ -986,7 +994,7 @@
     fi
 
     case $host_os in
-       *cygwin*) THREAD_LIBS=""
+       *cygwin* | *-*-msys*) THREAD_LIBS=""
        ;;
        *beos*) WITH_THREADS="1"
 	   THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_BEOS_THREADS"
@@ -1503,7 +1511,7 @@
    WIN32_EXTRA_PYTHON_LIBADD="-L${pythondir}/../../libs -lpython$(echo ${PYTHON_VERSION} | tr -d .)"
  fi
  ;;
- *-*-cygwin*)
+ *-*-cygwin* | *-*-msys*)
  CYGWIN_EXTRA_LDFLAGS="-no-undefined"
  if test "${PYTHON}" != ""
  then
