]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
3923. [bug] Sanity check the xml2-config output. [RT #22246]
authorMark Andrews <marka@isc.org>
Fri, 22 Aug 2014 06:10:43 +0000 (16:10 +1000)
committerMark Andrews <marka@isc.org>
Fri, 22 Aug 2014 06:11:55 +0000 (16:11 +1000)
(cherry picked from commit 53f91cbd80dc353ecb7e8914dae84a6cd85c67c6)

CHANGES
configure
configure.in

diff --git a/CHANGES b/CHANGES
index 13dc4da8c6f21d2641281f7bd754335143627cf1..a61ac262be7d7943a4d9d94017bc72260105b06e 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,5 @@
+3923.  [bug]           Sanity check the xml2-config output. [RT #22246]
+
 3922.  [bug]           When resigning, dnssec-signzone was removing
                        all signatures from delegation nodes. It now
                        retains DS and (if applicable) NSEC signatures.
index b898f3bd33c039833da7f8b7725f9b3546f66be0..43c30b180a48fc562f6f82869b94fe257544213b 100755 (executable)
--- a/configure
+++ b/configure
@@ -15431,10 +15431,30 @@ esac
 
 if test "X$libxml2_libs" != "X"
 then
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
        CFLAGS="$CFLAGS $libxml2_cflags"
        LIBS="$LIBS $libxml2_libs"
+       #
+       # Sanity check xml2-config output.
+       #
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <libxml/xmlwriter.h>
+int
+main ()
+{
+return(xmlTextWriterStartElement(NULL, NULL));
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  as_fn_error $? "xml2-config returns badness" "$LINENO" 5
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 
 $as_echo "#define HAVE_LIBXML2 1" >>confdefs.h
 
index 78167e2ba5e030668e448ad1ac8611c5b4a17377..3a1a7cf79b826b1133d31cc2fac0822329052cc8 100644 (file)
@@ -1469,9 +1469,15 @@ esac
 
 if test "X$libxml2_libs" != "X"
 then
-       AC_MSG_RESULT(yes)
        CFLAGS="$CFLAGS $libxml2_cflags"
        LIBS="$LIBS $libxml2_libs"
+       #
+       # Sanity check xml2-config output.
+       #
+       AC_TRY_LINK([#include <libxml/xmlwriter.h>],
+                   [return(xmlTextWriterStartElement(NULL, NULL));],
+                   AC_MSG_RESULT(yes),
+                   AC_MSG_ERROR(xml2-config returns badness))
        AC_DEFINE(HAVE_LIBXML2, 1, [Define if libxml2 was found])
 else
        AC_MSG_RESULT(no)