+dnl ----- libXML2
+AC_SUBST(XML2_LIBS)
+AC_SUBST(XML2_CFLAGS)
+xml2dir=no
+AC_ARG_WITH(xml2, [ --with-xml2[=PREFIX] Use libxml2 in PREFIX/{lib,include}],[xml2dir=$withval])
+if test "$xml2dir" = "yes"; then
+ for d in /usr /usr/local; do
+ if test -x $d/bin/xml2-config; then
+ xml2dir=$d
+ fi
+ done
+fi
+if test "$xml2dir" != "no"; then
+ AC_MSG_CHECKING(for libXML2)
+ if test -x $xml2dir/bin/xml2-config; then
+ XML2_LIBS=`$xml2dir/bin/xml2-config --libs`
+ XML2_CFLAGS=`$xml2dir/bin/xml2-config --cflags`
+ XML2_VER=`$xml2dir/bin/xml2-config --version`
+ AC_MSG_RESULT($XML2_VER)
+ AC_DEFINE(HAVE_XML2)
+ else
+ AC_MSG_RESULT(Not found)
+ fi
+fi
+dnl