From: Alex Rousskov Date: Thu, 22 Sep 2022 03:41:10 +0000 (+0000) Subject: Fix ./configure detection of libxml2 headers (#1153) X-Git-Tag: SQUID_6_0_1~98 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=37be0e7503cc3b012db8ee6fe4977183d71c4618;p=thirdparty%2Fsquid.git Fix ./configure detection of libxml2 headers (#1153) checking for LIBXML2... yes checking libxml/parser.h usability... yes checking libxml/parser.h presence... no configure: WARNING: libxml/parser.h: accepted by the compiler, rejected by the preprocessor! configure: WARNING: libxml/parser.h: proceeding with the compiler's result PKG_CHECK_MODULES() documentation warns that it uses a "misleading" name for the foo_CFLAGS variable it sets: "the variable provides the flags to pass to the preprocessor, rather than the compiler". Lots of Squid code has been mislead by that macro, but this fix is specific to a recent regression introduced in commit 866a092. TODO: Fix all others. --- diff --git a/configure.ac b/configure.ac index 32d374a7be..83cff9d559 100644 --- a/configure.ac +++ b/configure.ac @@ -847,13 +847,13 @@ AS_IF([test "x$squid_opt_use_esi" != "xno" -a "x$with_xml2" != "xno"],[ PKG_CHECK_MODULES([LIBXML2],[libxml-2.0],[],[ AC_CHECK_LIB([xml2],[main],[LIBXML2_LIBS="$LIBXML2_PATH -lxml2"]) ]) - CXXFLAGS="$LIBXML2_CFLAGS $CXXFLAGS" + CPPFLAGS="$LIBXML2_CFLAGS $CPPFLAGS" AC_CHECK_HEADERS(libxml/parser.h libxml/HTMLparser.h libxml/HTMLtree.h) SQUID_STATE_ROLLBACK([squid_libxml2_save]) AS_IF([test "x$LIBXML2_LIBS" != "x"],[ squid_opt_use_esi=yes - CXXFLAGS="$LIBXML2_CFLAGS $CXXFLAGS" + CPPFLAGS="$LIBXML2_CFLAGS $CPPFLAGS" LIBXML2_LIBS="$LIBXML2_PATH $LIBXML2_LIBS" AC_DEFINE(HAVE_LIBXML2,1,[Define to 1 if you have the xml2 library]) ],[test "x$with_xml2" = "xyes"],[