fixing compilation and link option when configuring with --without-valid

* debugXML.c relaxng.c valid.c xinclude.c xmllint.c xmlreader.c:
  fixing compilation and link option when configuring with
  --without-valid should fix #135309
Daniel
diff --git a/valid.c b/valid.c
index 22e41e6..d2774e7 100644
--- a/valid.c
+++ b/valid.c
@@ -105,6 +105,42 @@
                         msg);
 }
 
+#if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
+/**
+ * xmlErrValidNode:
+ * @ctxt:  an XML validation parser context
+ * @node:  the node raising the error
+ * @error:  the error number
+ * @str1:  extra informations
+ * @str2:  extra informations
+ * @str3:  extra informations
+ *
+ * Handle a validation error, provide contextual informations
+ */
+static void
+xmlErrValidNode(xmlValidCtxtPtr ctxt,
+                xmlNodePtr node, xmlParserErrors error,
+                const char *msg, const xmlChar * str1,
+                const xmlChar * str2, const xmlChar * str3)
+{
+    xmlStructuredErrorFunc schannel = NULL;
+    xmlGenericErrorFunc channel = NULL;
+    xmlParserCtxtPtr pctxt = NULL;
+    void *data = NULL;
+
+    if (ctxt != NULL) {
+        channel = ctxt->error;
+        data = ctxt->userData;
+	pctxt = ctxt->userData;
+    }
+    __xmlRaiseError(schannel, channel, data, pctxt, node, XML_FROM_VALID, error,
+                    XML_ERR_ERROR, NULL, 0,
+                    (const char *) str1,
+                    (const char *) str1,
+                    (const char *) str3, 0, 0, msg, str1, str2, str3);
+}
+#endif /* LIBXML_VALID_ENABLED or LIBXML_SCHEMAS_ENABLED */
+
 #ifdef LIBXML_VALID_ENABLED
 /**
  * xmlErrValidNodeNr:
@@ -139,39 +175,7 @@
                     (const char *) str3,
                     NULL, int2, 0, msg, str1, int2, str3);
 }
-/**
- * xmlErrValidNode:
- * @ctxt:  an XML validation parser context
- * @node:  the node raising the error
- * @error:  the error number
- * @str1:  extra informations
- * @str2:  extra informations
- * @str3:  extra informations
- *
- * Handle a validation error, provide contextual informations
- */
-static void
-xmlErrValidNode(xmlValidCtxtPtr ctxt,
-                xmlNodePtr node, xmlParserErrors error,
-                const char *msg, const xmlChar * str1,
-                const xmlChar * str2, const xmlChar * str3)
-{
-    xmlStructuredErrorFunc schannel = NULL;
-    xmlGenericErrorFunc channel = NULL;
-    xmlParserCtxtPtr pctxt = NULL;
-    void *data = NULL;
 
-    if (ctxt != NULL) {
-        channel = ctxt->error;
-        data = ctxt->userData;
-	pctxt = ctxt->userData;
-    }
-    __xmlRaiseError(schannel, channel, data, pctxt, node, XML_FROM_VALID, error,
-                    XML_ERR_ERROR, NULL, 0,
-                    (const char *) str1,
-                    (const char *) str1,
-                    (const char *) str3, 0, 0, msg, str1, str2, str3);
-}
 /**
  * xmlErrValidWarning:
  * @ctxt:  an XML validation parser context
@@ -2722,7 +2726,8 @@
  * Do nothing, return 0. Used to create unordered lists.
  */
 static int
-xmlDummyCompare(const void *data0, const void *data1)
+xmlDummyCompare(const void *data0 ATTRIBUTE_UNUSED,
+                const void *data1 ATTRIBUTE_UNUSED)
 {
     return (0);
 }
@@ -3150,7 +3155,7 @@
     return(xmlHashLookup(table, name));
 }
 
-#ifdef LIBXML_VALID_ENABLED
+#if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
 /**
  * xmlValidateNotationUse:
  * @ctxt:  the validation context
@@ -3181,7 +3186,7 @@
     }
     return(1);
 }
-#endif /* LIBXML_VALID_ENABLED */
+#endif /* LIBXML_VALID_ENABLED or LIBXML_SCHEMAS_ENABLED */
 
 /**
  * xmlIsMixedElement: