fix bug #63752 of compiling libxml with a non standard set of options

* encoding.c global.data globals.c testThreads.c: fix bug #63752
  of compiling libxml with a non standard set of options
Daniel
diff --git a/ChangeLog b/ChangeLog
index 504201d..f9eddd3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sun Nov  4 21:17:24 CET 2001 Daniel Veillard <daniel@veillard.com>
+
+	* encoding.c global.data globals.c testThreads.c: fix bug #63752
+	  of compiling libxml with a non standard set of options
+
 Sun Nov  4 13:11:41 MST 2001 John Fleck <jfleck@inkstain.net
 
 	* doc/xmllint.xml, xmllint.1 - updating xmllint man page to
diff --git a/encoding.c b/encoding.c
index a9495c4..beec775 100644
--- a/encoding.c
+++ b/encoding.c
@@ -43,8 +43,8 @@
 #ifdef LIBXML_HTML_ENABLED
 #include <libxml/HTMLparser.h>
 #endif
-#include <libxml/xmlerror.h>
 #include <libxml/globals.h>
+#include <libxml/xmlerror.h>
 
 static xmlCharEncodingHandlerPtr xmlUTF16LEHandler = NULL;
 static xmlCharEncodingHandlerPtr xmlUTF16BEHandler = NULL;
diff --git a/global.data b/global.data
index 2a6a445..f7d5d00 100644
--- a/global.data
+++ b/global.data
@@ -1,5 +1,3 @@
-xmlSAXHandler,docbDefaultSAXHandler
-xmlSAXHandler,htmlDefaultSAXHandler
 int,oldXMLWDcompatibility
 xmlBufferAllocationScheme,xmlBufferAllocScheme
 int,xmlDefaultBufferSize
diff --git a/globals.c b/globals.c
index e5b5bc8..565de0e 100644
--- a/globals.c
+++ b/globals.c
@@ -262,8 +262,12 @@
      * Perform initialisation as required by libxml
      */
     initxmlDefaultSAXHandler(&gs->xmlDefaultSAXHandler, 1);
+#ifdef LIBXML_DOCB_ENABLED
     initdocbDefaultSAXHandler(&gs->docbDefaultSAXHandler);
+#endif
+#ifdef LIBXML_HTML_ENABLED
     inithtmlDefaultSAXHandler(&gs->htmlDefaultSAXHandler);
+#endif
     initGenericErrorDefaultFunc(&gs->xmlGenericError);
 
     gs->oldXMLWDcompatibility = 0;
@@ -299,13 +303,7 @@
     gs->xmlSubstituteEntitiesDefaultValue = 0;
 }
 
-/*
- * Everything starting from the line below is
- * Automatically generated by build_glob.py.
- * Do not modify the previous line.
- */
-
-
+#ifdef LIBXML_DOCB_ENABLED
 extern xmlSAXHandler docbDefaultSAXHandler;
 #undef	docbDefaultSAXHandler
 xmlSAXHandler *
@@ -315,7 +313,9 @@
     else
 	return (&xmlGetGlobalState()->docbDefaultSAXHandler);
 }
+#endif
 
+#ifdef LIBXML_HTML_ENABLED
 extern xmlSAXHandler htmlDefaultSAXHandler;
 #undef	htmlDefaultSAXHandler
 xmlSAXHandler *
@@ -325,6 +325,14 @@
     else
 	return (&xmlGetGlobalState()->htmlDefaultSAXHandler);
 }
+#endif
+
+/*
+ * Everything starting from the line below is
+ * Automatically generated by build_glob.py.
+ * Do not modify the previous line.
+ */
+
 
 extern int oldXMLWDcompatibility;
 #undef	oldXMLWDcompatibility
diff --git a/testThreads.c b/testThreads.c
index 8424d31..1c494ab 100644
--- a/testThreads.c
+++ b/testThreads.c
@@ -2,7 +2,7 @@
 #include <stdio.h>
 #include <libxml/xmlversion.h>
 
-#ifdef LIBXML_THREAD_ENABLED
+#if defined(LIBXML_THREAD_ENABLED) && defined(LIBXML_CATALOG_ENABLED)
 #include <libxml/globals.h>
 #include <libxml/threads.h>
 #include <libxml/parser.h>
@@ -128,7 +128,7 @@
 int
 main()
 {
-    fprintf(stderr, "libxml was not compiled with thread support\n");
+    fprintf(stderr, "libxml was not compiled with thread or catalog support\n");
     return (0);
 }
 #endif