applied DSO support patch 2 from Joel Reed Daniel

* Makefile.am config.h.in configure.in error.c libxml-2.0.pc.in
  testModule.c testdso.c xml2-config.in xmllint.c xmlmodule.c
  include/libxml/Makefile.am include/libxml/xmlerror.h
  include/libxml/xmlmodule.h include/libxml/xmlversion.h.in
  include/libxml/xmlwin32version.h.in: applied DSO support
  patch 2 from Joel Reed
Daniel
diff --git a/win32/Makefile.bcb b/win32/Makefile.bcb
index 9b949cc..2f32d94 100644
--- a/win32/Makefile.bcb
+++ b/win32/Makefile.bcb
@@ -95,6 +95,9 @@
 !if "$(WITH_THREADS)" == "posix"
 LIBS = $(LIBS) pthreadVC.lib
 !endif
+!if "$(WITH_MODULES)" == "1"
+LIBS = $(LIBS) kernel32.lib
+!endif
 
 # The archiver and its options.
 AR = tlib.exe
@@ -143,6 +146,7 @@
 	$(XML_INTDIR)\xmlmemory.obj\
 	$(XML_INTDIR)\xmlreader.obj\
 	$(XML_INTDIR)\xmlregexp.obj\
+	$(XML_INTDIR)\xmlmodule.obj\
 	$(XML_INTDIR)\xmlsave.obj\
 	$(XML_INTDIR)\xmlschemas.obj\
 	$(XML_INTDIR)\xmlschemastypes.obj\
@@ -186,6 +190,7 @@
 	$(XML_INTDIR_A)\xmlmemory.obj\
 	$(XML_INTDIR_A)\xmlreader.obj\
 	$(XML_INTDIR_A)\xmlregexp.obj\
+	$(XML_INTDIR_A)\xmlmodule.obj\
 	$(XML_INTDIR_A)\xmlsave.obj\
 	$(XML_INTDIR_A)\xmlschemas.obj\
 	$(XML_INTDIR_A)\xmlschemastypes.obj\
@@ -205,6 +210,7 @@
 	$(BINDIR)\testReader.exe\
 	$(BINDIR)\testRelax.exe\
 	$(BINDIR)\testRegexp.exe\
+	$(BINDIR)\testModule.exe\
 	$(BINDIR)\testSAX.exe\
 	$(BINDIR)\testSchemas.exe\
 	$(BINDIR)\testURI.exe\
diff --git a/win32/Makefile.mingw b/win32/Makefile.mingw
index 415620c..a96c228 100644
--- a/win32/Makefile.mingw
+++ b/win32/Makefile.mingw
@@ -84,6 +84,9 @@
 ifeq ($(WITH_THREADS),posix)
 LIBS += -lpthreadGC
 endif
+ifeq ($(WITH_MODULES),1)
+LIBS += -lkernel32
+endif
 
 # The archiver and its options.
 AR = ar.exe
@@ -133,6 +136,7 @@
 	$(XML_INTDIR)/xmlmemory.o\
 	$(XML_INTDIR)/xmlreader.o\
 	$(XML_INTDIR)/xmlregexp.o\
+	$(XML_INTDIR)\xmlmodule.o\
 	$(XML_INTDIR)/xmlsave.o\
 	$(XML_INTDIR)/xmlschemas.o\
 	$(XML_INTDIR)/xmlschemastypes.o\
@@ -178,6 +182,7 @@
 	$(XML_INTDIR_A)/xmlmemory.o\
 	$(XML_INTDIR_A)/xmlreader.o\
 	$(XML_INTDIR_A)/xmlregexp.o\
+	$(XML_INTDIR_A)\xmlmodule.o\
 	$(XML_INTDIR_A)/xmlsave.o\
 	$(XML_INTDIR_A)/xmlschemas.o\
 	$(XML_INTDIR_A)/xmlschemastypes.o\
@@ -198,6 +203,7 @@
 	$(BINDIR)/testHTML.exe\
 	$(BINDIR)/testReader.exe\
 	$(BINDIR)/testRegexp.exe\
+	$(BINDIR)/testModule.exe\
 	$(BINDIR)/testRelax.exe\
 	$(BINDIR)/testSAX.exe\
 	$(BINDIR)/testSchemas.exe\
diff --git a/win32/Makefile.msvc b/win32/Makefile.msvc
index 3ad0dad..be10cf9 100644
--- a/win32/Makefile.msvc
+++ b/win32/Makefile.msvc
@@ -74,6 +74,9 @@
 !if "$(WITH_THREADS)" == "posix"
 LIBS = $(LIBS) pthreadVC.lib
 !endif
+!if "$(WITH_MODULES)" == "1"
+LIBS = $(LIBS) kernel32.lib
+!endif
 
 # The archiver and its options.
 AR = lib.exe
@@ -122,6 +125,7 @@
 	$(XML_INTDIR)\xmlmemory.obj\
 	$(XML_INTDIR)\xmlreader.obj\
 	$(XML_INTDIR)\xmlregexp.obj\
+	$(XML_INTDIR)\xmlmodule.obj\
 	$(XML_INTDIR)\xmlsave.obj\
 	$(XML_INTDIR)\xmlschemas.obj\
 	$(XML_INTDIR)\xmlschemastypes.obj\
@@ -165,6 +169,7 @@
 	$(XML_INTDIR_A)\xmlmemory.obj\
 	$(XML_INTDIR_A)\xmlreader.obj\
 	$(XML_INTDIR_A)\xmlregexp.obj\
+	$(XML_INTDIR_A)\xmlmodule.obj\
 	$(XML_INTDIR_A)\xmlsave.obj\
 	$(XML_INTDIR_A)\xmlschemas.obj\
 	$(XML_INTDIR_A)\xmlschemastypes.obj\
@@ -184,6 +189,7 @@
 	$(BINDIR)\testReader.exe\
 	$(BINDIR)\testRelax.exe\
 	$(BINDIR)\testRegexp.exe\
+	$(BINDIR)\testModule.exe\
 	$(BINDIR)\testSAX.exe\
 	$(BINDIR)\testSchemas.exe\
 	$(BINDIR)\testURI.exe\
diff --git a/win32/configure.js b/win32/configure.js
index f77308d..12e5f42 100644
--- a/win32/configure.js
+++ b/win32/configure.js
@@ -46,6 +46,7 @@
 var withMemDebug = false;
 var withSchemas = true;
 var withRegExps = true;
+var withModules = true;
 var withTree = true;
 var withReader = true;
 var withWriter = true;
@@ -125,6 +126,7 @@
 	txt += "  xml_debug:  Enable XML debbugging module (" + (withDebug? "yes" : "no")  + ")\n";
 	txt += "  mem_debug:  Enable memory debugger (" + (withMemDebug? "yes" : "no")  + ")\n";
 	txt += "  regexps:    Enable regular expressions (" + (withRegExps? "yes" : "no") + ")\n";
+	txt += "  modules:    Enable module support (" + (withModules? "yes" : "no") + ")\n";
 	txt += "  tree:       Enable tree api (" + (withTree? "yes" : "no") + ")\n";
 	txt += "  reader:     Enable xmlReader api (" + (withReader? "yes" : "no") + ")\n";
 	txt += "  writer:     Enable xmlWriter api (" + (withWriter? "yes" : "no") + ")\n";
@@ -230,6 +232,7 @@
 	vf.WriteLine("WITH_MEM_DEBUG=" + (withMemDebug? "1" : "0"));
 	vf.WriteLine("WITH_SCHEMAS=" + (withSchemas? "1" : "0"));
 	vf.WriteLine("WITH_REGEXPS=" + (withRegExps? "1" : "0"));
+	vf.WriteLine("WITH_MODULES=" + (withModules? "1" : "0"));
 	vf.WriteLine("WITH_TREE=" + (withTree? "1" : "0"));
 	vf.WriteLine("WITH_READER=" + (withReader? "1" : "0"));
 	vf.WriteLine("WITH_WRITER=" + (withWriter? "1" : "0"));
@@ -318,6 +321,10 @@
 			of.WriteLine(s.replace(/\@WITH_SCHEMAS\@/, withSchemas? "1" : "0"));
 		} else if (s.search(/\@WITH_REGEXPS\@/) != -1) {
 			of.WriteLine(s.replace(/\@WITH_REGEXPS\@/, withRegExps? "1" : "0"));
+		} else if (s.search(/\@WITH_MODULES\@/) != -1) {
+			of.WriteLine(s.replace(/\@WITH_MODULES\@/, withModules? "1" : "0"));
+		} else if (s.search(/\@MODULE_EXTENSION\@/) != -1) {
+			of.WriteLine(s.replace(/\@MODULE_EXTENSION\@/, ".dll"));
 		} else if (s.search(/\@WITH_TREE\@/) != -1) {
 			of.WriteLine(s.replace(/\@WITH_TREE\@/, withTree? "1" : "0"));
 		} else if (s.search(/\@WITH_READER\@/) != -1) {
@@ -610,6 +617,7 @@
 txtOut += "  Debugging module: " + boolToStr(withDebug) + "\n";
 txtOut += "  Memory debugging: " + boolToStr(withMemDebug) + "\n";
 txtOut += "    Regexp support: " + boolToStr(withRegExps) + "\n";
+txtOut += "    Module support: " + boolToStr(withModules) + "\n";
 txtOut += "      Tree support: " + boolToStr(withTree) + "\n";
 txtOut += "    Reader support: " + boolToStr(withReader) + "\n";
 txtOut += "    Writer support: " + boolToStr(withWriter) + "\n";