diff --git a/configure.in b/configure.in index 019f0229..1d14357b 100644 --- a/configure.in +++ b/configure.in @@ -118,6 +118,7 @@ AC_PATH_PROG(MV, mv, /bin/mv) AC_PATH_PROG(TAR, tar, /bin/tar) AC_PATH_PROG(XMLLINT, xmllint, /usr/bin/xmllint) AC_PATH_PROG(XSLTPROC, xsltproc, /usr/bin/xsltproc) +PKG_PROG_PKG_CONFIG AC_HEADER_STDC @@ -500,6 +501,26 @@ AC_ARG_WITH(libxml-src, ) AC_SUBST(LIBXML_SRC) +dnl +dnl Try pkg-config first if nothing is set +dnl + +if test "x$LIBXML_CONFIG_PREFIX" == "x" -a "x$LIBXML_SRC" == "x" +then + PKG_CHECK_MODULES([LIBXML], [libxml-2.0 >= $LIBXML_REQUIRED_VERSION], [ + LIBXML_MANUAL_SEARCH=no + WITH_MODULES="`$PKG_CONFIG --variable=modules libxml-2.0`" + ], + [ + LIBXML_MANUAL_SEARCH=yes + ]) +else + LIBXML_MANUAL_SEARCH=yes +fi + +if test "x$LIBXML_MANUAL_SEARCH" != "xno" +then + dnl dnl where is xml2-config dnl @@ -578,6 +599,10 @@ else AC_MSG_ERROR([Could not find libxml2 anywhere, check ftp://xmlsoft.org/.]) fi +WITH_MODULES="`$XML_CONFIG --modules`" + +fi # LIBXML_MANUAL_SEARCH + AC_SUBST(CFLAGS) AC_SUBST(CPPFLAGS) @@ -602,7 +627,6 @@ fi if test "$with_plugins" = "yes" ; then AC_MSG_CHECKING([libxml2 module support]) - WITH_MODULES="`$XML_CONFIG --modules`" if test "${WITH_MODULES}" = "1"; then AC_MSG_RESULT(yes) else