From: Henrik Nordstrom Date: Sun, 27 Nov 2011 01:01:07 +0000 (+0100) Subject: Correct libxml2 include path search when using a configure cache X-Git-Tag: BumpSslServerFirst.take05~12^2~161 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0dc1a86a65befb2f2b8171b28d564df4410f1468;p=thirdparty%2Fsquid.git Correct libxml2 include path search when using a configure cache --- diff --git a/configure.ac b/configure.ac index 9a6d990d79..b0c901cba3 100644 --- a/configure.ac +++ b/configure.ac @@ -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.])