]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
ESI: correct libxml2 path detection before header tests
authorAmos Jeffries <squid3@treenet.co.nz>
Thu, 1 Oct 2009 12:25:49 +0000 (01:25 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 1 Oct 2009 12:25:49 +0000 (01:25 +1300)
- Shuffles the path detection up to before its needed.
  This consolidates libxml2 tests and slightly speeds up some configure runs

configure.in

index d951dc9f2b35031510c3d77e00fdf89f6e6d349f..a0b3b64f441f10399cc6b5db2a209d998d7f7c04 100644 (file)
@@ -863,7 +863,20 @@ if test "$use_esi" = "yes" ; then
   AC_ARG_WITH(xml2, AS_HELP_STRING([--without-libxml2],[Do not use libxml2 for ESI. Default: auto-detect]))
   if test "$with_xml2" != "no" ; then
     AC_CHECK_LIB([xml2], [main], [XMLLIB="-lxml2"; HAVE_LIBXML2=1])
-    AC_CHECK_HEADERS([libxml/parser.h libxml/HTMLparser.h libxml/HTMLtree.h])
+    dnl Find the main header and include path...
+    AC_CHECK_HEADERS([libxml/parser.h], [], [
+        SAVED_CPPFLAGS="$CPPFLAGS"
+        CPPFLAGS="-I/usr/include/libxml2 $CPPFLAGS"
+        unset ac_cv_header_libxml_parser_h
+        AC_CHECK_HEADERS([libxml/parser.h], [ac_cv_libxml2_include=yes], [])
+        CPPFLAGS="$SAVED_CPPFLAGS"
+        ])
+    if test "x$ac_cv_libxml2_include" = "xyes"; then
+        SQUID_CXXFLAGS="-I/usr/include/libxml2 $SQUID_CXXFLAGS"
+        CPPFLAGS="-I/usr/include/libxml2 $CPPFLAGS"
+    fi
+    dnl Now that we know where to look find the other headers...
+    AC_CHECK_HEADERS(libxml/HTMLparser.h libxml/HTMLtree.h)
     AC_DEFINE_UNQUOTED(HAVE_LIBXML2, $HAVE_LIBXML2, [Define to 1 if you have the libxml2 library])
     if test "$with_xml2" = "yes" && test "$HAVE_LIBXML2" != "1" ; then
       AC_MSG_ERROR([Required library libxml2 is not able to be found.])
@@ -2505,17 +2518,6 @@ AC_CHECK_HEADERS( \
 ,,,
 SQUID_BSDNET_INCLUDES)
 
-AC_CHECK_HEADERS([libxml/parser.h], [], [
-       SAVED_CPPFLAGS="$CPPFLAGS"
-       CPPFLAGS="-I/usr/include/libxml2 $CPPFLAGS"
-       unset ac_cv_header_libxml_parser_h
-       AC_CHECK_HEADERS([libxml/parser.h], [ac_cv_libxml2_include=yes], [])
-       CPPFLAGS="$SAVED_CPPFLAGS"
-       ])
-if test "x$ac_cv_libxml2_include" = "xyes"; then
-       SQUID_CXXFLAGS="-I/usr/include/libxml2 $SQUID_CXXFLAGS"
-fi
-
 AC_C_CONST
 AC_C_BIGENDIAN