From 99742866025bab3bf6857012303785e9476a1630 Mon Sep 17 00:00:00 2001 From: Francesco Chemolli Date: Tue, 11 Jun 2013 15:13:23 +0200 Subject: [PATCH] LibTrie refactro: remove sub-configure invocation --- bootstrap.sh | 3 +- configure.ac | 4 +- lib/libTrie/Makefile.am | 20 ++- lib/libTrie/{src => }/Trie.cc | 2 +- lib/libTrie/{include => }/Trie.cci | 0 lib/libTrie/{include => }/Trie.h | 0 lib/libTrie/{include => }/TrieCharTransform.h | 0 lib/libTrie/{src => }/TrieNode.cc | 2 +- lib/libTrie/{include => }/TrieNode.cci | 0 lib/libTrie/{include => }/TrieNode.h | 0 lib/libTrie/acinclude.m4 | 1 - lib/libTrie/configure.ac | 114 ------------------ lib/libTrie/include/Makefile.am | 1 - lib/libTrie/src/Makefile.am | 13 -- lib/libTrie/test/Makefile.am | 13 +- lib/libTrie/test/trie.cc | 6 +- scripts/source-maintenance.sh | 2 +- src/Makefile.am | 2 +- src/esi/CustomParser.cc | 4 +- src/esi/VarState.h | 2 +- 20 files changed, 36 insertions(+), 153 deletions(-) rename lib/libTrie/{src => }/Trie.cc (98%) rename lib/libTrie/{include => }/Trie.cci (100%) rename lib/libTrie/{include => }/Trie.h (100%) rename lib/libTrie/{include => }/TrieCharTransform.h (100%) rename lib/libTrie/{src => }/TrieNode.cc (98%) rename lib/libTrie/{include => }/TrieNode.cci (100%) rename lib/libTrie/{include => }/TrieNode.h (100%) delete mode 100644 lib/libTrie/acinclude.m4 delete mode 100644 lib/libTrie/configure.ac delete mode 100644 lib/libTrie/include/Makefile.am delete mode 100644 lib/libTrie/src/Makefile.am diff --git a/bootstrap.sh b/bootstrap.sh index 8864dc6066..3f14fdeb80 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -123,8 +123,7 @@ echo "libtool ($ltversion) : ${LIBTOOL_BIN}${ltver}" echo "libtool path : $ltpath" for dir in \ - "" \ - lib/libTrie + "" do if [ -z "$dir" ] || [ -d $dir ]; then if ( diff --git a/configure.ac b/configure.ac index 4f92468ee1..614f6189fa 100644 --- a/configure.ac +++ b/configure.ac @@ -3373,6 +3373,8 @@ AC_CONFIG_FILES([\ compat/Makefile \ lib/Makefile \ lib/ntlmauth/Makefile \ + lib/libTrie/Makefile \ + lib/libTrie/test/Makefile \ lib/profiler/Makefile \ lib/rfcnb/Makefile \ lib/smblib/Makefile \ @@ -3461,7 +3463,7 @@ AC_CONFIG_FILES([\ tools/purge/Makefile ]) -AC_CONFIG_SUBDIRS(lib/libTrie) +dnl AC_CONFIG_SUBDIRS(lib/libTrie) # must configure libltdl subdir unconditionally for "make distcheck" to work #AC_CONFIG_SUBDIRS(libltdl) diff --git a/lib/libTrie/Makefile.am b/lib/libTrie/Makefile.am index 0c35fc0141..14bcd6a44e 100644 --- a/lib/libTrie/Makefile.am +++ b/lib/libTrie/Makefile.am @@ -1,5 +1,17 @@ -## Process this file with automake to produce Makefile.in +include $(top_srcdir)/src/Common.am +include $(top_srcdir)/src/TestHeaders.am -AUTOMAKE_OPTIONS = dist-bzip2 subdir-objects 1.5 -DIST_SUBDIRS = include src test -SUBDIRS = src test +DIST_SUBDIRS = test +SUBDIRS = test + +noinst_LIBRARIES = libTrie.a + +noinst_HEADERS = Trie.h TrieNode.h TrieCharTransform.h + +libTrie_a_SOURCES = Trie.cc \ + Trie.cci \ + Trie.h \ + TrieNode.cc \ + TrieNode.cci \ + TrieNode.h \ + TrieCharTransform.h diff --git a/lib/libTrie/src/Trie.cc b/lib/libTrie/Trie.cc similarity index 98% rename from lib/libTrie/src/Trie.cc rename to lib/libTrie/Trie.cc index 557fcf0a79..f5e3f399d5 100644 --- a/lib/libTrie/src/Trie.cc +++ b/lib/libTrie/Trie.cc @@ -17,7 +17,7 @@ * */ -#include "config.h" +#include "squid.h" #include "Trie.h" #if HAVE_UNISTD_H #include diff --git a/lib/libTrie/include/Trie.cci b/lib/libTrie/Trie.cci similarity index 100% rename from lib/libTrie/include/Trie.cci rename to lib/libTrie/Trie.cci diff --git a/lib/libTrie/include/Trie.h b/lib/libTrie/Trie.h similarity index 100% rename from lib/libTrie/include/Trie.h rename to lib/libTrie/Trie.h diff --git a/lib/libTrie/include/TrieCharTransform.h b/lib/libTrie/TrieCharTransform.h similarity index 100% rename from lib/libTrie/include/TrieCharTransform.h rename to lib/libTrie/TrieCharTransform.h diff --git a/lib/libTrie/src/TrieNode.cc b/lib/libTrie/TrieNode.cc similarity index 98% rename from lib/libTrie/src/TrieNode.cc rename to lib/libTrie/TrieNode.cc index e81f62bb98..60fbf54cf7 100644 --- a/lib/libTrie/src/TrieNode.cc +++ b/lib/libTrie/TrieNode.cc @@ -17,7 +17,7 @@ * */ -#include "config.h" +#include "squid.h" #include "TrieNode.h" #include "TrieCharTransform.h" #if HAVE_UNISTD_H diff --git a/lib/libTrie/include/TrieNode.cci b/lib/libTrie/TrieNode.cci similarity index 100% rename from lib/libTrie/include/TrieNode.cci rename to lib/libTrie/TrieNode.cci diff --git a/lib/libTrie/include/TrieNode.h b/lib/libTrie/TrieNode.h similarity index 100% rename from lib/libTrie/include/TrieNode.h rename to lib/libTrie/TrieNode.h diff --git a/lib/libTrie/acinclude.m4 b/lib/libTrie/acinclude.m4 deleted file mode 100644 index ae7da3eae0..0000000000 --- a/lib/libTrie/acinclude.m4 +++ /dev/null @@ -1 +0,0 @@ -dnl diff --git a/lib/libTrie/configure.ac b/lib/libTrie/configure.ac deleted file mode 100644 index d69b402a42..0000000000 --- a/lib/libTrie/configure.ac +++ /dev/null @@ -1,114 +0,0 @@ -# Process this file with autoconf to produce a configure script. -AC_INIT(libTrie, 0.1, rbtcollins@squid-cache.org) -AC_CONFIG_SRCDIR([src/Trie.cc]) -AC_CONFIG_HEADERS([config.h]) -AC_CONFIG_AUX_DIR(cfgaux) - -enable_inline=${enable_inline:=yes} -AC_ARG_ENABLE(optimizations, - AC_HELP_STRING([--disable-optimizations], - [Do not 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 "x$enableval" = "xno" ; 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]]*//'`" - enable_inline="no" - fi -]) - -AC_ARG_ENABLE(inline, - AC_HELP_STRING([--disable-inline], - [Do not 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 "x${enableval}" = "xno" ; then - enable_inline=no - fi -]) -if test "x$enable_inline" = "xyes" ; then - AC_DEFINE(_SQUID_INLINE_, inline, - [Keyword used by squid for inlining methods]) - AC_DEFINE(_USE_INLINE_, 1, [Include inline methods into header file]) -else - AC_MSG_NOTICE([Inlining optimization disabled]) - AC_DEFINE(_SQUID_INLINE_, [] , [Keyword used by squid for inlining methods]) - AC_DEFINE(_USE_INLINE_, 0, [Include inline methods into header file]) -fi - -# Checks for programs. -AC_PROG_CXX -AC_PROG_CC -AC_LANG_CPLUSPLUS -AC_PROG_MAKE_SET -# for old automakes - like squid-cache.orgs! -AM_INIT_AUTOMAKE(libTrie, 0.1) -AM_MAINTAINER_MODE -AC_PROG_RANLIB - -AC_LIBTOOL_DLOPEN -AC_LIBLTDL_CONVENIENCE -AC_PROG_LIBTOOL -AC_LTDL_DLLIB -AC_SUBST(INCLTDL) -AC_SUBST(LIBLTDL) - -dnl set useful flags -TRIE_CFLAGS= -TRIE_CXXFLAGS= -if test "$GCC" = "yes"; then - TRIE_CFLAGS="-Wall -Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wcomments" - TRIE_CXXFLAGS="-Wall -Wpointer-arith -Wwrite-strings -Wcomments" - - AC_ARG_ENABLE(strict-error-checking, - AS_HELP_STRING([--disable-strict-error-checking],[By default compile - with all possible static compiler error-checks enabled. - This flag disables the behavior]), [ - case $enableval in - yes|1|true) - enable_strict_error_checking=yes - ;; - *) - enable_strict_error_checking=no - ;; - esac - ]) - AC_MSG_NOTICE([strict error checking enabled: ${enable_strict_error_checking:=yes}]) - if test "x${enable_strict_error_checking:=yes}" = "xyes"; then - TRIE_CFLAGS="-Werror $TRIE_CFLAGS" - TRIE_CXXFLAGS="-Werror $TRIE_CXXFLAGS" - fi - -fi - -AC_SUBST(TRIE_CFLAGS) -AC_SUBST(TRIE_CXXFLAGS) - -# Checks for libraries. - -# Checks for header files. -AC_CHECK_HEADERS( \ - iostream \ -) - -# Checks for typedefs, structures, and compiler characteristics. -AC_C_CONST -AC_TYPE_SIZE_T - -# Checks for library functions. - -AC_CONFIG_FILES([Makefile - include/Makefile - src/Makefile - test/Makefile]) -AC_OUTPUT diff --git a/lib/libTrie/include/Makefile.am b/lib/libTrie/include/Makefile.am deleted file mode 100644 index 395e2db3be..0000000000 --- a/lib/libTrie/include/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -noinst_HEADERS = Trie.h TrieNode.h TrieCharTransform.h diff --git a/lib/libTrie/src/Makefile.am b/lib/libTrie/src/Makefile.am deleted file mode 100644 index 34a02a8699..0000000000 --- a/lib/libTrie/src/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ - -INCLUDES = -I$(top_srcdir)/include - -AM_CFLAGS = $(TRIE_CFLAGS) -AM_CXXFLAGS = $(TRIE_CXXFLAGS) - -noinst_LIBRARIES = libTrie.a - -libTrie_a_SOURCES = Trie.cc \ - TrieNode.cc - -noinst_HEADERS = ../include/Trie.cci \ - ../include/TrieNode.cci diff --git a/lib/libTrie/test/Makefile.am b/lib/libTrie/test/Makefile.am index ee9350e574..df33eba011 100644 --- a/lib/libTrie/test/Makefile.am +++ b/lib/libTrie/test/Makefile.am @@ -1,16 +1,15 @@ -INCLUDES = -I$(top_srcdir)/include +include $(top_srcdir)/src/Common.am -AM_CFLAGS = $(TRIE_CFLAGS) -AM_CXXFLAGS = $(TRIE_CXXFLAGS) +INCLUDES += -I$(top_srcdir)/include # TESTS = trie trie-c -TESTS = trie +TESTS += trie # check_PROGRAMS = trie trie-c -check_PROGRAMS = trie +check_PROGRAMS += trie trie_SOURCES = trie.cc -trie_LDADD = $(top_builddir)/src/libTrie.a +trie_LDADD = $(top_builddir)/lib/libTrie/libTrie.a #trie_c_SOURCES = trie-c.c -#trie_c_LDADD = $(top_builddir)/src/libTrie.a -lm +#trie_c_LDADD = $(top_builddir)/lib/libTrie/libTrie.a -lm diff --git a/lib/libTrie/test/trie.cc b/lib/libTrie/test/trie.cc index 9f8a2b3ae1..8404ff409e 100644 --- a/lib/libTrie/test/trie.cc +++ b/lib/libTrie/test/trie.cc @@ -17,9 +17,9 @@ * */ -#include "config.h" -#include "Trie.h" -#include "TrieCharTransform.h" +#include "squid.h" +#include "libTrie/Trie.h" +#include "libTrie/TrieCharTransform.h" #if HAVE_IOSTREAM #include diff --git a/scripts/source-maintenance.sh b/scripts/source-maintenance.sh index 6a4a003de9..4004476265 100755 --- a/scripts/source-maintenance.sh +++ b/scripts/source-maintenance.sh @@ -120,7 +120,7 @@ for FILENAME in `ls -1`; do esac - if test "$FILENAME" = "libltdl" -o "$FILENAME" = "libTrie" ; then + if test "$FILENAME" = "libltdl" ; then : elif test -d $FILENAME ; then cd $FILENAME diff --git a/src/Makefile.am b/src/Makefile.am index 7e6b392df8..cfe2846d0b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -80,7 +80,7 @@ if USE_ESI SUBDIRS += esi ESI_LOCAL_LIBS = \ esi/libesi.la \ - $(top_builddir)/lib/libTrie/src/libTrie.a + $(top_builddir)/lib/libTrie/libTrie.a ESI_LIBS = $(ESI_LOCAL_LIBS) \ $(XMLLIB) \ $(EXPATLIB) diff --git a/src/esi/CustomParser.cc b/src/esi/CustomParser.cc index 4f1cc56fee..effb2a6465 100644 --- a/src/esi/CustomParser.cc +++ b/src/esi/CustomParser.cc @@ -35,8 +35,8 @@ #include "base/Vector.h" #include "esi/CustomParser.h" #include "Debug.h" -#include "Trie.h" -#include "TrieCharTransform.h" +#include "libTrie/Trie.h" +#include "libTrie/TrieCharTransform.h" Trie *ESICustomParser::SearchTrie=NULL; diff --git a/src/esi/VarState.h b/src/esi/VarState.h index 5c632bcdce..0a538fb494 100644 --- a/src/esi/VarState.h +++ b/src/esi/VarState.h @@ -33,7 +33,7 @@ #define SQUID_ESIVARSTATE_H #include "esi/Segment.h" -#include "Trie.h" +#include "libTrie/Trie.h" #include "base/Vector.h" #include "HttpHeader.h" -- 2.47.2