From: Mark Andrews Date: Fri, 22 Aug 2014 06:10:43 +0000 (+1000) Subject: 3923. [bug] Sanity check the xml2-config output. [RT #22246] X-Git-Tag: v9.8.8rc1~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f7ae335591639d8c958b33b8f81e2d6bedcf2b0;p=thirdparty%2Fbind9.git 3923. [bug] Sanity check the xml2-config output. [RT #22246] (cherry picked from commit 53f91cbd80dc353ecb7e8914dae84a6cd85c67c6) --- diff --git a/CHANGES b/CHANGES index 7c7d8bf3648..e9b1d932343 100644 --- 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. diff --git a/configure b/configure index 9255f12dfbf..11bccb707b1 100755 --- a/configure +++ b/configure @@ -15105,10 +15105,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 +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 diff --git a/configure.in b/configure.in index 5189fc31c5e..be72623a6bf 100644 --- a/configure.in +++ b/configure.in @@ -1344,9 +1344,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 ], + [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)