]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Add build options to control ESI libraries.
authorAmos Jeffries <squid3@treenet.co.nz>
Sun, 27 Sep 2009 12:29:52 +0000 (01:29 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 27 Sep 2009 12:29:52 +0000 (01:29 +1300)
Also;
 - disconnect the libraries from linking to binaries they dont need to.
 - enable automatic build testing of ESI code since missing libraries are
   no longer fatal.

configure.in
src/Makefile.am
test-suite/buildtests/layer-02-maximus.opts

index 0457d7c6a5709e8de9eb1927f9d182f515e3e042..be421fb5f48a9caa5b204231f0ff724372315b5b 100644 (file)
@@ -836,40 +836,42 @@ AC_ARG_ENABLE(delay-pools,
 dnl disable generic/common adaptation support by default
 use_adaptation=no
 
-AM_CONDITIONAL(USE_ESI, false)
+use_esi=yes
 AC_ARG_ENABLE(esi,
-  AS_HELP_STRING([--enable-esi],[Enable ESI for accelerators. Requires libexpat.
-                  Enabling ESI will cause squid to follow the
-                  Edge Acceleration Specification (www.esi.org).
-                  This causes squid to IGNORE client Cache-Control headers.
-                  DO NOT use this in a squid configured as a web proxy, 
-                  ONLY use it in a squid configured for webserver acceleration.]),
+  AS_HELP_STRING([--enable-esi],[Enable ESI for accelerators. Requires 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)
+HAVE_LIBEXPAT=0
+EXPATLIB=
+HAVE_LIBXML2=0
+XMLLIB=
 if test "$use_esi" = "yes" ; then
-  AC_DEFINE(USE_SQUID_ESI,1,[Compile the ESI processor and Surrogate header support])
-  AM_CONDITIONAL(USE_ESI, true)
-  ESI_LIBS=
-  HAVE_LIBEXPAT=0
-  AC_CHECK_LIB([expat], [main], [ESI_LIBS="$ESI_LIBS -lexpat"; HAVE_LIBEXPAT=1])
-  AC_DEFINE(HAVE_LIBEXPAT, $HAVE_LIBEXPAT, "Define to 1 if you have the expat library")
-  if test "$HAVE_LIBEXPAT" = 1; then
-    AM_CONDITIONAL(HAVE_LIBEXPAT, true)
-  else
-    AM_CONDITIONAL(HAVE_LIBEXPAT, false)
+
+  AC_ARG_WITH(expat, AS_HELP_STRING([--without-libexpat],[Do not use libexpat for ESI.]))
+  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])
   fi
-  HAVE_LIBXML2=
-  AC_CHECK_LIB([xml2], [main], [ESI_LIBS="$ESI_IBS -lxml2"; HAVE_LIBXML2=1])
-  AC_DEFINE(HAVE_LIBXML2, $HAVE_LIBXML2, "Define to 1 if you have the libxml2 library")
-  if test "$HAVE_LIBXML2" = 1; then
-    AM_CONDITIONAL(HAVE_LIBXML2, true)
-  else
-    AM_CONDITIONAL(HAVE_LIBXML2, false)
+
+  AC_ARG_WITH(xml2, AS_HELP_STRING([--without-libxml2],[Do not use libxml2 for ESI.]))
+  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])
   fi
-  XTRA_LIBS="$XTRA_LIBS $ESI_LIBS"
 
-else
-  AC_DEFINE(USE_SQUID_ESI,0,[Compile the ESI processor and Surrogate header support])
+  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
 fi
+AM_CONDITIONAL(USE_ESI, test "$use_esi" = "yes")
+AM_CONDITIONAL(HAVE_LIBEXPAT, test $HAVE_LIBEXPAT = 1)
+AC_SUBST(EXPATLIB)
+AM_CONDITIONAL(HAVE_LIBXML2, test $HAVE_LIBXML2 = 1)
+AC_SUBST(XMLLIB)
 
 AM_CONDITIONAL(USE_ICAP_CLIENT, false)
 AC_ARG_ENABLE(icap-client,
index 6d044c42aa17480ccd1e780c4189421b63319b78..b235c0ed224fce2c66ffb5147f6e148b19883082 100644 (file)
@@ -44,9 +44,12 @@ ADAPTATION_LIBS = @ADAPTATION_LIBS@
 
 if USE_ESI
 SUBDIRS += esi
-ESI_LIBS = \
+ESI_LOCAL_LIBS = \
        esi/libesi.la \
        $(top_builddir)/lib/libTrie/src/libTrie.a
+ESI_LIBS = $(ESI_LOCAL_LIBS) \
+       @XMLLIB@ \
+       @EXPATLIB@
 else
 ESI_LIBS = 
 endif
@@ -540,7 +543,7 @@ squid_LDADD = \
        @REGEXLIB@ \
        @SNMPLIB@ \
        ${ADAPTATION_LIBS} \
-       ${ESI_LIBS} \
+       $(ESI_LIBS) \
        $(COMPAT_LIB) \
        @SSLLIB@ \
        @XTRA_LIBS@ \
@@ -553,7 +556,7 @@ squid_DEPENDENCIES = $(top_builddir)/lib/libmiscutil.a \
        @REPL_OBJS@ \
        @SNMPLIB@ \
        ${ADAPTATION_LIBS} \
-       ${ESI_LIBS} \
+       $(ESI_LOCAL_LIBS) \
        $(COMMON_LIBS)
 
 if USE_LOADABLE_MODULES
@@ -1201,7 +1204,7 @@ tests_testCacheManager_LDADD = \
        icmp/libicmp.la icmp/libicmp-core.la \
        @REPL_OBJS@ \
        ${ADAPTATION_LIBS} \
-       ${ESI_LIBS} \
+       $(ESI_LIBS) \
        @REGEXLIB@ \
        @SNMPLIB@ \
        -L../lib -lmiscutil \
@@ -1374,7 +1377,7 @@ tests_testEvent_LDADD = \
        icmp/libicmp.la icmp/libicmp-core.la \
        @REPL_OBJS@ \
        ${ADAPTATION_LIBS} \
-       ${ESI_LIBS} \
+       $(ESI_LIBS) \
        @REGEXLIB@ \
        @SNMPLIB@ \
        -L../lib -lmiscutil \
@@ -1523,7 +1526,7 @@ tests_testEventLoop_LDADD = \
        icmp/libicmp.la icmp/libicmp-core.la \
        @REPL_OBJS@ \
        ${ADAPTATION_LIBS} \
-       ${ESI_LIBS} \
+       $(ESI_LIBS) \
        @REGEXLIB@ \
        @SNMPLIB@ \
        -L../lib -lmiscutil \
@@ -1667,7 +1670,7 @@ tests_test_http_range_LDADD = \
        icmp/libicmp.la icmp/libicmp-core.la \
        @REPL_OBJS@ \
        ${ADAPTATION_LIBS} \
-       ${ESI_LIBS} \
+       $(ESI_LIBS) \
        @REGEXLIB@ \
        @SNMPLIB@ \
        -L../lib -lmiscutil \
@@ -1816,7 +1819,7 @@ tests_testHttpRequest_LDADD = \
        icmp/libicmp.la icmp/libicmp-core.la \
        @REPL_OBJS@ \
        ${ADAPTATION_LIBS} \
-       ${ESI_LIBS} \
+       $(ESI_LIBS) \
        @REGEXLIB@ \
        @SNMPLIB@ \
        -L../lib -lmiscutil \
@@ -2167,7 +2170,7 @@ tests_testURL_LDADD = \
        @REGEXLIB@ \
        @REPL_OBJS@ \
        ${ADAPTATION_LIBS} \
-       ${ESI_LIBS} \
+       $(ESI_LIBS) \
        @SNMPLIB@ \
        -L../lib -lmiscutil \
        @SQUID_CPPUNIT_LIBS@ \
index 3653230c95d204eadfc02b7a16c1dbb4cd46e50c..31cf3bfa46c59ade350f32e8b20824faabae1d7c 100644 (file)
@@ -36,7 +36,6 @@ MAKETEST="distcheck"
 #   --enable-ecap \
 #   --enable-epoll \
 #   --enable-kqueue \
-#   --enable-esi \
 #   --enable-win32-service \
 #
 #
@@ -97,6 +96,7 @@ OPTS=" \
        --enable-auto-locale \
        --enable-translation \
        --enable-zph-qos \
+       --enable-esi \
  \
        --with-aio \
        --with-build-environment=default \