Commit 48d4e48c authored by Stefan Fritsch's avatar Stefan Fritsch
Browse files

Improve detection of libxml2


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1196955 13f79535-47bb-0310-9956-ffa450edef68
parent ad272db3
Loading
Loading
Loading
Loading
+37 −19
Original line number Diff line number Diff line
@@ -90,12 +90,13 @@ APACHE_MODULE(deflate, Deflate transfer encoding support, , , most, [
])

AC_DEFUN(FIND_LIBXML2, [
  AC_CACHE_CHECK([for libxml2], [ac_cv_libxml2], [
    AC_ARG_WITH(libxml2,
      [APACHE_HELP_STRING(--with-libxml2,location for libxml2)],
      [test_paths="${with_libxml2}"],
      [test_paths="/usr/include/libxml2 /usr/local/include/libxml2 /usr/include /usr/local/include"]
    )
  AC_MSG_CHECKING(Checking for libxml2)
    AC_MSG_CHECKING(for libxml2)
    xml2_path=""
    for x in ${test_paths}; do
        if test -e "${x}/libxml/parser.h"; then
@@ -103,15 +104,32 @@ AC_DEFUN(FIND_LIBXML2, [
          break
        fi
    done
  if test -n ${xml2_path}; then
    APR_ADDTO(CFLAGS, [-I${xml2_path}])
    if test -n "${xml2_path}" ; then
      ac_cv_libxml2=yes
      XML2_INCLUDES="${xml2_path}"
    else
    AC_MSG_ERROR([libxml2 headers not found!])
      ac_cv_libxml2=no
    fi
  ])
])

APACHE_MODULE(xml2enc, i18n support for markup filters, , , , FIND_LIBXML2)
APACHE_MODULE(proxy_html, Fix HTML Links in a Reverse Proxy, , , , FIND_LIBXML2)
APACHE_MODULE(xml2enc, i18n support for markup filters, , , , [
  FIND_LIBXML2
  if test "$ac_cv_libxml2" = "yes" ; then
    APR_ADDTO(CFLAGS, [-I${XML2_INCLUDES}])
  else
    enable_xml2enc=no
  fi
])
APACHE_MODULE(proxy_html, Fix HTML Links in a Reverse Proxy, , , , [
  FIND_LIBXML2
  if test "$ac_cv_libxml2" = "yes" ; then
    APR_ADDTO(CFLAGS, [-I${XML2_INCLUDES}])
  else
    enable_proxy_html=no
  fi
]
)

APR_ADDTO(INCLUDES, [-I\$(top_srcdir)/$modpath_current])