--- ./doc/devhelp/Makefile.am.ORIG	2005-09-12 15:29:57.000000000 +0300
+++ ./doc/devhelp/Makefile.am	2007-06-26 16:17:31.000000000 +0300
@@ -60,14 +60,14 @@
 
 all: libxml2.devhelp $(HTML_FILES)
 
-libxml2.devhelp $(HTML_FILES): devhelp.xsl html.xsl $(top_srcdir)/doc/libxml2-api.xml
+libxml2.devhelp $(HTML_FILES): $(srcdir)/devhelp.xsl $(srcdir)/html.xsl $(srcdir)/../libxml2-api.xml
 	-@(echo Rebuilding devhelp files)
 	-@(if [ -x $(XSLTPROC) ] ; then \
-	  $(XSLTPROC) --nonet -o $(srcdir)/libxml2.devhelp devhelp.xsl $(top_srcdir)/doc/libxml2-api.xml ; fi );
+	  cd $(srcdir); $(XSLTPROC) --nonet -o libxml2.devhelp devhelp.xsl ../libxml2-api.xml ; fi );
 
 install-data-local: 
 	$(mkinstalldirs) $(DESTDIR)$(DEVHELP_DIR)
-	-@INSTALL@ -m 0644 libxml2.devhelp $(DESTDIR)$(DEVHELP_DIR)
-	-@INSTALL@ -m 0644 $(EXTRA_FORMAT) $(DESTDIR)$(DEVHELP_DIR)
-	-@INSTALL@ -m 0644 $(HTML_FILES) $(DESTDIR)$(DEVHELP_DIR)
+	-cd $(srcdir); @INSTALL@ -m 0644 libxml2.devhelp $(DESTDIR)$(DEVHELP_DIR)
+	-cd $(srcdir); @INSTALL@ -m 0644 $(EXTRA_FORMAT) $(DESTDIR)$(DEVHELP_DIR)
+	-cd $(srcdir); @INSTALL@ -m 0644 $(HTML_FILES) $(DESTDIR)$(DEVHELP_DIR)
 
--- ./configure.in.ORIG	2006-10-25 17:46:05.000000000 +0300
+++ ./configure.in	2007-07-03 18:43:34.000000000 +0300
@@ -736,6 +736,10 @@
     AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso])
   ])
   ;;
+  *-*-mingw*)
+  MODULE_EXTENSION=".dll"
+  WITH_MODULES=1
+  ;;
   *)
   AC_CHECK_FUNC(shl_load, libxml_have_shl_load=yes, [
     AC_CHECK_LIB(dld, shl_load, [
@@ -1320,7 +1324,7 @@
  *-*-mingw*)
  CPPFLAGS="$CPPFLAGS -DWIN32"
  WIN32_EXTRA_LIBADD="-lws2_32"
- WIN32_EXTRA_LDFLAGS="-no-undefined"
+ WIN32_EXTRA_LDFLAGS="-no-undefined -avoid-version"
  AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation])
  AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
  AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])
--- ./error.c.ORIG	2005-10-28 11:19:11.000000000 +0300
+++ ./error.c	2007-07-06 01:44:49.000000000 +0300
@@ -620,11 +620,16 @@
 	(channel == xmlParserValidityError) ||
 	(channel == xmlParserValidityWarning))
 	xmlReportError(to, ctxt, str, NULL, NULL);
+#if defined(__MINGW32__) || defined(__BORLANDC__)
+    else
+	xmlReportError(to, ctxt, str, channel, data);
+#else
     else if ((channel == (xmlGenericErrorFunc) fprintf) ||
              (channel == xmlGenericErrorDefaultFunc))
 	xmlReportError(to, ctxt, str, channel, data);
     else
 	channel(data, "%s", str);
+#endif
 }
 
 /**
--- ./Makefile.am.ORIG	2005-12-07 00:20:12.000000000 +0200
+++ ./Makefile.am	2007-07-05 21:14:30.000000000 +0300
@@ -132,7 +132,7 @@
 
 noinst_LTLIBRARIES = testdso.la
 testdso_la_SOURCES = testdso.c
-testdso_la_LDFLAGS = -module -rpath $(libdir)
+testdso_la_LDFLAGS = -module @CYGWIN_EXTRA_LDFLAGS@ @WIN32_EXTRA_LDFLAGS@ -rpath $(libdir)
 
 # that one forces the rebuild when "make rebuild" is run on doc/
 rebuild_testapi:
@@ -956,12 +956,12 @@
 	  name=`basename $$i | sed 's+\.rng++'`; \
 	  if [ ! -f $(srcdir)/result/relaxng/"$$name"_valid ] ; then \
 	      echo New schemas $$name ; \
-	      $(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $(srcdir)/test/relaxng/tutorA.rng $$i \
+	      $(CHECKER) $(top_builddir)/xmllint --noout --relaxng $(srcdir)/test/relaxng/tutorA.rng $$i \
 		      > $(srcdir)/result/relaxng/"$$name"_valid \
 		      2> $(srcdir)/result/relaxng/"$$name"_err; \
 	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
 	  else \
-	      log=`$(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $(srcdir)/test/relaxng/tutorA.rng $$i \
+	      log=`$(CHECKER) $(top_builddir)/xmllint --noout --relaxng $(srcdir)/test/relaxng/tutorA.rng $$i \
 	      > res.$$name 2> err.$$name;\
 	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
 	      diff $(srcdir)/result/relaxng/"$$name"_valid \
@@ -978,12 +978,12 @@
 	      if [ ! -f $(srcdir)/result/relaxng/"$$name"_"$$xno" ]; \
 	      then \
 		  echo New test file "$$name"_"$$xno" ; \
-		  $(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $$i $$j \
+		  $(CHECKER) $(top_builddir)/xmllint --noout --relaxng $$i $$j \
 		    > $(srcdir)/result/relaxng/"$$name"_"$$xno" \
 		    2> $(srcdir)/result/relaxng/"$$name"_"$$xno".err; \
 	          grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
 	      else \
-	          log=`$(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $$i $$j \
+	          log=`$(CHECKER) $(top_builddir)/xmllint --noout --relaxng $$i $$j \
 		    > res.$$name 2> err.$$name;\
 	          grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
 	          diff $(srcdir)/result/relaxng/"$$name"_"$$xno" \
@@ -1004,12 +1004,12 @@
 	      if [ ! -f $(srcdir)/result/relaxng/"$$name"_"$$xno" ]; \
 	      then \
 		  echo New test file "$$name"_"$$xno" ; \
-		  $(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $$i $$j \
+		  $(CHECKER) $(top_builddir)/xmllint --noout --relaxng $$i $$j \
 		    > $(srcdir)/result/relaxng/"$$name"_"$$xno" \
 		    2> $(srcdir)/result/relaxng/"$$name"_"$$xno".err; \
 	          grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
 	      else \
-	          log=`$(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --stream --relaxng $$i $$j \
+	          log=`$(CHECKER) $(top_builddir)/xmllint --noout --stream --relaxng $$i $$j \
 		    > res.$$name 2> err.$$name;\
 	          grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
 	          diff $(srcdir)/result/relaxng/"$$name"_"$$xno" res.$$name;\
@@ -1033,12 +1033,12 @@
 	      if [ ! -f $(srcdir)/result/schematron/"$$name"_"$$xno" ]; \
 	      then \
 		  echo New test file "$$name"_"$$xno" ; \
-		  $(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --schematron $$i $$j \
+		  $(CHECKER) $(top_builddir)/xmllint --schematron $$i $$j \
 		    > $(srcdir)/result/schematron/"$$name"_"$$xno" \
 		    2> $(srcdir)/result/schematron/"$$name"_"$$xno".err; \
 	          grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
 	      else \
-	          log=`$(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --schematron $$i $$j \
+	          log=`$(CHECKER) $(top_builddir)/xmllint --schematron $$i $$j \
 		    > res.$$name 2> err.$$name;\
 	          grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
 	          diff $(srcdir)/result/schematron/"$$name"_"$$xno" \
@@ -1101,7 +1101,7 @@
 
 ModuleTests: testModule$(EXEEXT) testdso.la
 	@echo "## Module tests"
-	@(./testModule$(EXEEXT))
+	@(./testModule)
 
 cleanup:
 	-@(find . -name .\#\* -exec rm {} \;)
