]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix ESI breaks with --disable-optimizations
authorAmos Jeffries <squid3@treenet.co.nz>
Tue, 27 Jan 2009 00:40:24 +0000 (13:40 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Tue, 27 Jan 2009 00:40:24 +0000 (13:40 +1300)
Turns out the libTrie configure script shares some macro handling
which needed a re-sync with the main squid script.

TODO: These should really be made into shared macros.

lib/libTrie/configure.in
lib/libTrie/include/Trie.h
lib/libTrie/src/Trie.cc
src/Makefile.am

index 7861a54a14f1cb20be62b307dafe832efc7e7004..b879e622e58e762c876a32ab9630d67572e5f316 100644 (file)
@@ -5,27 +5,48 @@ AM_CONFIG_HEADER([config.h])
 AC_CONFIG_AUX_DIR(cfgaux)
 
 SquidInline="yes"
+
+AC_ARG_ENABLE(optimizations,
+  AC_HELP_STRING([--disable-optimizations],
+                 [Don't compile Squid with compiler optimizations enabled.
+                  Optimization is good for production builds, but not
+                  good for debugging. During development, use
+                  --disable-optimizations to reduce compilation times
+                  and allow easier debugging. This option implicitly
+                  also enabled --disable-inline]),
+[ if test "$enableval" = "no" ; then
+        AC_MSG_NOTICE([Disabling compiler optimizations (-O flag)])
+        CFLAGS="`echo $CFLAGS | sed -e 's/-O[[0-9]]*//'`"
+        CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-O[[0-9]]*//'`"
+        SquidInline="no"
+  fi
+])
+
 AC_ARG_ENABLE(inline,
-                          [  --disable-inline        Don't compile trivial methods as inline. Squid
-                             is coded with much of the code able to be inlined.<                             Inlining is good for production builds, but not
-                             good for development. During development, use
-                             --disable-inline to reduce compilation times and
-                             allow incremental builds to be quick. For
-                             production builds, or load tests, use
-                             --enable-inline to have squid make all trivial
-                             methods inlinable by the compiler.],
-   [ if test "$enableval" = "no" ; then
-       SquidInline="no"
-     fi
-  ])
+  AC_HELP_STRING([--disable-inline],
+                 [Don't compile trivial methods as inline. Squid
+                  is coded with much of the code able to be inlined.
+                  Inlining is good for production builds, but not
+                  good for development. During development, use
+                  --disable-inline to reduce compilation times and
+                  allow incremental builds to be quick. For
+                  production builds, or load tests, use
+                  --enable-inline to have squid make all trivial
+                  methods inlinable by the compiler.]),
+[ if test "$enableval" = "no" ; then
+     SquidInline="no"
+   fi
+])
 
 if test "$SquidInline" = "yes" ; then
-  AC_DEFINE(_SQUID_INLINE_, inline, [Keyword used by squid for inlining methods])
-  AC_DEFINE(_USE_INLINE_,, [Include inline methods into header file])
+    AC_DEFINE(_SQUID_INLINE_, inline, [Keyword used by squid for inlining methods])
+    AC_DEFINE(_USE_INLINE_,, [Include inline methods into header file])
 else
-  AC_DEFINE(_SQUID_INLINE_,, [Keyword used by squid for inlining methods])
+    AC_MSG_NOTICE([Inlining optimization disabled])
+    AC_DEFINE(_SQUID_INLINE_,, [Keyword used by squid for inlining methods])
 fi
 
+
 # Checks for programs.
 AC_PROG_CXX
 AC_PROG_CC
index a69d5e7bbf852a440c0e27f557eb0ccc2b67c435..4135f3efcc8460892bada7d1d1ab7b91743736c6 100644 (file)
@@ -82,8 +82,7 @@ public:
     * present or cannot be added.
     */
 
-    bool add
-        (char const *, size_t, void *);
+    bool add(char const *, size_t, void *);
 
 private:
     TrieNode *head;
index 150fb1716eb7cecfa42e8c7316c83301b2877632..bcec3a2cae98f9c1219fab74e8703d0e42aacb45 100644 (file)
 #include "TrieNode.h"
 #include "TrieCharTransform.h"
 
+#ifndef _USE_INLINE_
+#include "Trie.cci"
+#endif
+
 Trie::Trie (TrieCharTransform *aTransform) : head (0) , transform (aTransform)
 {}
 
@@ -76,7 +80,3 @@ extern "C" int TrieAdd (void *aTrie, char const *aString, size_t theLength, void
     return ((Trie *)aTrie)->add
            (aString, theLength, privatedata);
 }
-
-#ifndef _USE_INLINE_
-#include "Trie.cci"
-#endif
index 01b20864666e2098466ef2cf206d8c2a5d3398b7..9a33acbad5c745895ff33606f44fa3fc349111a2 100644 (file)
@@ -887,7 +887,7 @@ ufsdump_SOURCES = \
 ufsdump_LDADD = \
        libsquid.la \
        libauth.la \
-       -L../lib \
+       -L../lib -lmiscutil \
        @XTRA_OBJS@ \
        @REPL_OBJS@ \
        @STORE_OBJS@ \
@@ -897,7 +897,6 @@ ufsdump_LDADD = \
        @SNMPLIB@ \
        @ICAP_LIBS@ \
        @SSLLIB@ \
-       -lmiscutil \
        @XTRA_LIBS@ \
        @EPOLL_LIBS@ \
        @MINGW_LIBS@