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/relaxng.c b/relaxng.c
index 4370ef3..d884bee 100644
--- a/relaxng.c
+++ b/relaxng.c
@@ -10464,6 +10464,7 @@
         xmlRelaxNGDumpValidError(ctxt);
     }
 #endif
+#ifdef LIBXML_VALID_ENABLED
     if (ctxt->idref == 1) {
         xmlValidCtxt vctxt;
 
@@ -10476,6 +10477,7 @@
         if (xmlValidateDocumentFinal(&vctxt, doc) != 1)
             ret = -1;
     }
+#endif /* LIBXML_VALID_ENABLED */
     if ((ret == 0) && (ctxt->errNo != XML_RELAXNG_OK))
         ret = -1;