From 6a5e1ac9698193b58dbb37930be361e73cbcba0a Mon Sep 17 00:00:00 2001 From: Jack Moffitt Date: Fri, 29 Mar 2013 09:47:14 -0600 Subject: [PATCH] Added support for detecting system libxml2. --- configure.ac | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 97444e5..e4f9299 100644 --- a/configure.ac +++ b/configure.ac @@ -15,8 +15,15 @@ AC_ARG_WITH([libxml2], if test "x$with_libxml2" != xno; then PKG_CHECK_MODULES([libxml2], [libxml-2.0 >= 2.7], - [with_libxml2=yes], + [with_libxml2=yes], [dummy=1]) + if test "x$with_libxml2" != yes; then + old_CFLAGS=$CFLAGS + CFLAGS="-I /usr/include/libxml2" + AC_CHECK_HEADER([libxml/parser.h], + [with_libxml2=yes; libxml2_CFLAGS="-I /usr/include/libxml2"; libxml2_LIBS="-lxml2"], [AC_MSG_ERROR([couldn't find libxml2])]) + CFLAGS=$old_CFLAGS + fi else AC_CHECK_HEADER(expat.h, [], [AC_MSG_ERROR([couldn't find expat headers; expat required])]) fi