From 73cee124f12edaa2679fa6fbbca94a918494fc50 Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Tue, 27 Jan 2009 13:40:24 +1300 Subject: [PATCH] Fix ESI breaks with --disable-optimizations 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 | 51 +++++++++++++++++++++++++++----------- lib/libTrie/include/Trie.h | 3 +-- lib/libTrie/src/Trie.cc | 8 +++--- src/Makefile.am | 3 +-- 4 files changed, 42 insertions(+), 23 deletions(-) diff --git a/lib/libTrie/configure.in b/lib/libTrie/configure.in index 7861a54a14..b879e622e5 100644 --- a/lib/libTrie/configure.in +++ b/lib/libTrie/configure.in @@ -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 diff --git a/lib/libTrie/include/Trie.h b/lib/libTrie/include/Trie.h index a69d5e7bbf..4135f3efcc 100644 --- a/lib/libTrie/include/Trie.h +++ b/lib/libTrie/include/Trie.h @@ -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; diff --git a/lib/libTrie/src/Trie.cc b/lib/libTrie/src/Trie.cc index 150fb1716e..bcec3a2cae 100644 --- a/lib/libTrie/src/Trie.cc +++ b/lib/libTrie/src/Trie.cc @@ -24,6 +24,10 @@ #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 diff --git a/src/Makefile.am b/src/Makefile.am index 01b2086466..9a33acbad5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -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@ -- 2.47.2