]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
ESI detection pt 3: proper --with option support.
authorAmos Jeffries <squid3@treenet.co.nz>
Tue, 29 Sep 2009 01:07:16 +0000 (13:07 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Tue, 29 Sep 2009 01:07:16 +0000 (13:07 +1200)
 - makes the --with-expat and --with-xml2 REQUIRE the presence of the
   library a fatal error is output if they are required and missing.

 - makes ESI always build with internal processor when --enable is used
   only failures of the above --with-* will kill ESI builds in configure.

configure.in

index be421fb5f48a9caa5b204231f0ff724372315b5b..b9bd54c7db93f58f0a2fd299f945bcacf1b9d946 100644 (file)
@@ -838,7 +838,7 @@ use_adaptation=no
 
 use_esi=yes
 AC_ARG_ENABLE(esi,
-  AS_HELP_STRING([--enable-esi],[Enable ESI for accelerators. Requires libexpat or libxml2.
+  AS_HELP_STRING([--enable-esi],[Enable ESI for accelerators. Benefits from libexpat or libxml2.
                   Enabling ESI will cause squid reverse proxies to be capable of the
                   Edge Acceleration Specification (www.esi.org).]),
              use_esi=$enableval, use_esi=no)
@@ -847,25 +847,29 @@ EXPATLIB=
 HAVE_LIBXML2=0
 XMLLIB=
 if test "$use_esi" = "yes" ; then
+  AC_MSG_NOTICE([Enabling ESI processor and Surrogate header support.])
+  AC_DEFINE(USE_SQUID_ESI,1,[Compile the ESI processor and Surrogate header support])
 
-  AC_ARG_WITH(expat, AS_HELP_STRING([--without-libexpat],[Do not use libexpat for ESI.]))
+  AC_ARG_WITH(expat, AS_HELP_STRING([--without-libexpat],[Do not use libexpat for ESI. Default: auto-detect]))
   if test "$with_expat" != "no" ; then
     AC_CHECK_LIB([expat], [main], [EXPATLIB="-lexpat"; HAVE_LIBEXPAT=1])
     AC_DEFINE_UNQUOTED(HAVE_LIBEXPAT, $HAVE_LIBEXPAT, [Define to 1 if you have the expat library])
+    if test "$with_expat" = "yes" && test "$HAVE_LIBEXPAT" != "1" ; then
+      AC_MSG_ERROR([Required library libexpat is not able to be found.])
+    fi
   fi
 
-  AC_ARG_WITH(xml2, AS_HELP_STRING([--without-libxml2],[Do not use libxml2 for ESI.]))
+  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_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.])
+    fi
   fi
 
-  if test "$HAVE_LIBEXPAT" = "0" && test "$HAVE_LIBXML2" = "0" ; then
-    AC_WARN([Disabling ESI support. It requires libexpat or libxml2 to operate. Neither are available.])
-    use_esi=no
-  else
-    AC_DEFINE(USE_SQUID_ESI,1,[Compile the ESI processor and Surrogate header support])
-  fi
+else
+  AC_MSG_NOTICE([Disabling ESI processor and Surrogate header support.])
 fi
 AM_CONDITIONAL(USE_ESI, test "$use_esi" = "yes")
 AM_CONDITIONAL(HAVE_LIBEXPAT, test $HAVE_LIBEXPAT = 1)