]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Correct libxml2 include path search when using a configure cache
authorHenrik Nordstrom <henrik@henriknordstrom.net>
Sun, 27 Nov 2011 01:01:07 +0000 (02:01 +0100)
committerHenrik Nordstrom <henrik@henriknordstrom.net>
Sun, 27 Nov 2011 01:01:07 +0000 (02:01 +0100)
configure.ac

index 9a6d990d7987379761e515b31ac7377c21cc27c3..b0c901cba35c9131b9dcc56aa6b18244050a1469 100644 (file)
@@ -914,29 +914,30 @@ AC_ARG_WITH(libxml2, AS_HELP_STRING([--without-libxml2],[Do not use libxml2 for
 if test "x$squid_opt_use_esi" = "xyes" -a "x$with_libxml2" != "xno" ; then
   AC_CHECK_LIB([xml2], [main], [XMLLIB="-lxml2"; HAVE_LIBXML2=1])
   dnl Find the main header and include path...
-  ac_cv_libxml2_include='no'
-  AC_CHECK_HEADERS([libxml/parser.h], [], [
+  AC_CACHE_CHECK([location of libxml2 include files], [ac_cv_libxml2_include], [
+    AC_CHECK_HEADERS([libxml/parser.h], [], [
       AC_MSG_NOTICE([Testing in /usr/include/libxml2])
       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="/usr/include/libxml2"], [])
-      CPPFLAGS="$SAVED_CPPFLAGS"
-      if test "x$ac_cv_libxml2_include" = "xno"; then
-          AC_MSG_NOTICE([Testing in /usr/local/include/libxml2])
-          SAVED_CPPFLAGS="$CPPFLAGS"
-          CPPFLAGS="-I/usr/local/include/libxml2 $CPPFLAGS"
-          unset ac_cv_header_libxml_parser_h
-          AC_CHECK_HEADERS([libxml/parser.h], [ac_cv_libxml2_include="/usr/local/include/libxml2"], [])
-          CPPFLAGS="$SAVED_CPPFLAGS"
-      fi
+      AC_CHECK_HEADERS([libxml/parser.h], [ac_cv_libxml2_include="-I/usr/include/libxml2"], [
+        AC_MSG_NOTICE([Testing in /usr/local/include/libxml2])
+        CPPFLAGS="-I/usr/local/include/libxml2 $SAVED_CPPFLAGS"
+        unset ac_cv_header_libxml_parser_h
+        AC_CHECK_HEADERS([libxml/parser.h], [ac_cv_libxml2_include="-I/usr/local/include/libxml2"], [
+          AC_MSG_ERROR([Failed to find libxml2 header file libxml/parser.h])
+       
+        ])
       ])
-  if test "x$ac_cv_libxml2_include" != "xno"; then
-      SQUID_CXXFLAGS="-I$ac_cv_libxml2_include $SQUID_CXXFLAGS"
-      CPPFLAGS="-I$ac_cv_libxml2_include $CPPFLAGS"
+      CPPFLAGS="$SAVED_CPPFLAGS"
+    ])
+  ])
+  if test "x$ac_cv_libxml2_include" != "x"; then
+      SQUID_CXXFLAGS="$ac_cv_libxml2_include $SQUID_CXXFLAGS"
+      CPPFLAGS="$ac_cv_libxml2_include $CPPFLAGS"
   fi
-  dnl Now that we know where to look find the other headers...
-  AC_CHECK_HEADERS(libxml/HTMLparser.h libxml/HTMLtree.h)
+  dnl Now that we know where to look find the headers...
+  AC_CHECK_HEADERS(libxml/parser.h libxml/HTMLparser.h libxml/HTMLtree.h)
   AC_DEFINE_UNQUOTED(HAVE_LIBXML2, $HAVE_LIBXML2, [Define to 1 if you have the libxml2 library])
   if test "x$with_libxml2" = "xyes" -a "$HAVE_LIBXML2" != "1" ; then
     AC_MSG_ERROR([Required library libxml2 is not able to be found.])