]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Author: Alex Rousskov <rousskov@measurement-factory.com>
authorAmos Jeffries <squid3@treenet.co.nz>
Sun, 8 Mar 2009 11:46:19 +0000 (00:46 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 8 Mar 2009 11:46:19 +0000 (00:46 +1300)
SourceLayout: src/base, take 0 with tweaks

Added src/base directory for fundamental, commonly-used code pieces that are
not large enough to warrant their own directories. Currently base/ contains
the beginning of AsyncCalls hierarchy, which may eventually get its own
directory.

Removed src/ip from the top-level SUBDIRS list. Made cf_gen compile without
libip.

Started building makefile includes, to be used in subdir makefiles:
src/Common.am and src/TestHeaders.am.

16 files changed:
Makefile.am
configure.in
src/AsyncJobCalls.h
src/BodyPipe.h
src/Common.am [new file with mode: 0644]
src/Makefile.am
src/Server.h
src/TestHeaders.am [new file with mode: 0644]
src/adaptation/AccessCheck.h
src/adaptation/Initiate.h
src/adaptation/Initiator.h
src/base/AsyncJob.cc [moved from src/ICAP/AsyncJob.cc with 100% similarity]
src/base/AsyncJob.h [moved from src/ICAP/AsyncJob.h with 98% similarity]
src/base/Makefile.am [new file with mode: 0644]
src/client_side.h
src/client_side_request.h

index 327b61c52e2de0da68a2e58ba7e681127c4f1da1..b4e31975b5c51eb1534e0ae83ca4105e003110da 100644 (file)
@@ -3,7 +3,7 @@
 
 AUTOMAKE_OPTIONS = dist-bzip2 subdir-objects 1.5 foreign
 DIST_SUBDIRS   = compat lib snmplib scripts src icons errors contrib doc helpers test-suite tools
-SUBDIRS                = compat lib @makesnmplib@ scripts src/ip src icons errors doc helpers test-suite tools
+SUBDIRS                = compat lib @makesnmplib@ scripts src icons errors doc helpers test-suite tools
 
 DISTCLEANFILES = include/stamp-h include/stamp-h[0-9]*
 DEFAULT_PINGER         = $(libexecdir)/`echo pinger | sed '$(transform);s/$$/$(EXEEXT)/'`
index 9ae59e02f00fe9043dc3f96a2880c6fc6ffe3db3..facfc673454317463495a78adac08704413d2be3 100644 (file)
@@ -3793,6 +3793,7 @@ AC_CONFIG_FILES([\
        scripts/RunCache \
        scripts/RunAccel \
        src/Makefile \
+       src/base/Makefile \
        src/fs/Makefile \
        src/repl/Makefile \
        src/auth/Makefile \
index 306e538c337c83e207b36184d7f999c7eaae8eb0..0657d3672015361f13cbc67e8a31a20635d41482 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef SQUID_ASYNCJOBCALLS_H
 #define SQUID_ASYNCJOBCALLS_H
 
-#include "ICAP/AsyncJob.h"
+#include "base/AsyncJob.h"
 
 /*
  * *MemFunT are member function (i.e., class method) wrappers. They store
index 7ce016ef3a8c7284839e29f190a8ec366a0bce88..bf00268b865a06e53f398b74496990ac03ff7c25 100644 (file)
@@ -4,7 +4,7 @@
 
 #include "MemBuf.h"
 #include "AsyncCall.h"
-#include "ICAP/AsyncJob.h"
+#include "base/AsyncJob.h"
 
 class BodyPipe;
 
diff --git a/src/Common.am b/src/Common.am
new file mode 100644 (file)
index 0000000..084f108
--- /dev/null
@@ -0,0 +1,25 @@
+## Settings common to many Squid Makefiles
+
+## This file should be included first in all src/subdir/Makefile.am
+## so it must not contain stuff specific to or bad for some subdirectories.
+
+## TODO: make this set by configure?
+AM_CFLAGS = @SQUID_CFLAGS@
+AM_CXXFLAGS = @SQUID_CXXFLAGS@
+DEFS = @DEFS@
+
+## so that others can always use += for these variables
+CLEANFILES =
+check_PROGRAMS = 
+TESTS =
+
+INCLUDES = \
+       -I$(top_srcdir) \
+       -I$(top_srcdir)/include \
+       -I$(top_srcdir)/src \
+       -I$(top_builddir)/include \
+       @SQUID_CPPUNIT_INC@
+
+## make all compiled sources depend on generated files
+## XXX: Do we really need this? Does auto-dependency tracking work?
+$(OBJS): $(top_srcdir)/include/version.h $(top_builddir)/include/autoconf.h
index e0e550929f5fb87c62a1a1264ca22c8b283e6adb..5765cde3f1b12871eed2d9eda72e3ecf663805fe 100644 (file)
@@ -32,7 +32,7 @@ LOADABLE_MODULES_SOURCES = \
 TESTS=$(check_PROGRAMS)
 check_PROGRAMS=
 
-SUBDIRS                = fs repl auth icmp ip
+SUBDIRS        = base fs repl auth ip icmp
 
 if USE_ADAPTATION
 SUBDIRS += adaptation
@@ -210,6 +210,13 @@ EXTRA_LIBRARIES = libAIO.a libBlocking.a libDiskDaemon.a libDiskThreads.a
 noinst_LIBRARIES = @DISK_LIBS@
 noinst_LTLIBRARIES = libsquid.la libauth.la
 
+# libraries used by many targets
+COMMON_LIBS = \
+       libsquid.la \
+       libauth.la \
+       base/libbase.la \
+       ip/libip.la
+
 INCLUDES = \
        -I$(top_srcdir) \
        -I$(top_srcdir)/src \
@@ -247,18 +254,10 @@ libexec_PROGRAMS = \
        @DISK_PROGRAMS@ \
        $(UNLINKD)
 
-cf_gen_SOURCES = \
-       cf_gen.cc \
-       defines.h \
-       debug.cc \
-       time.cc
-
-nodist_cf_gen_SOURCES = globals.cc
+cf_gen_SOURCES = cf_gen.cc
 nodist_cf_gen_HEADER = cf_gen_defines.h
 cf_gen_LDADD= \
-       libsquid.la \
-       libauth.la \
-       ip/libip.la \
+       ../compat/libcompat.la \
        -L../lib -lmiscutil \
        @XTRA_LIBS@ \
        @EPOLL_LIBS@ \
@@ -432,8 +431,6 @@ libsquid_la_SOURCES = \
        CommCalls.h \
        DescriptorSet.cc \
        DescriptorSet.h \
-        ICAP/AsyncJob.cc \
-        ICAP/AsyncJob.h \
        SquidConfig.cc \
         TextException.cc \
         TextException.h
@@ -695,10 +692,8 @@ nodist_squid_SOURCES = \
        string_arrays.c
 
 squid_LDADD = \
-       libsquid.la \
-       libauth.la \
+       $(COMMON_LIBS) \
        icmp/libicmp.la icmp/libicmp-core.la \
-       ip/libip.la \
        -L../lib \
        @XTRA_OBJS@ \
        @DISK_LINKOBJS@ \
@@ -921,10 +916,8 @@ ufsdump_SOURCES = \
        wordlist.cc \
        $(WIN32_SOURCE)
 ufsdump_LDADD = \
-       libsquid.la \
-       libauth.la \
+       $(COMMON_LIBS) \
        icmp/libicmp.la icmp/libicmp-core.la \
-       ip/libip.la \
        @XTRA_OBJS@ \
        @REPL_OBJS@ \
        @STORE_OBJS@ \
@@ -968,7 +961,7 @@ sysconf_DATA = \
 data_DATA = \
        mib.txt
 
-LDADD = libsquid.la libauth.la ip/libip.la -L../lib -lmiscutil @XTRA_LIBS@ @EPOLL_LIBS@ @MINGW_LIBS@
+LDADD = $(COMMON_LIBS) -L../lib -lmiscutil @XTRA_LIBS@ @EPOLL_LIBS@ @MINGW_LIBS@
 
 EXTRA_DIST = \
        cf_gen_defines \
@@ -1243,9 +1236,7 @@ nodist_tests_testAuth_SOURCES = \
        $(TESTSOURCES)
 
 tests_testAuth_LDADD= \
-       libsquid.la \
-       libauth.la \
-       ip/libip.la \
+       $(COMMON_LIBS) \
        @AUTH_LINKOBJS@ @AUTH_OBJS@ \
        -L../lib -lmiscutil \
        @REGEXLIB@ \
@@ -1317,9 +1308,7 @@ tests_testACLMaxUserIP_SOURCES= \
 nodist_tests_testACLMaxUserIP_SOURCES= \
        $(TESTSOURCES)
 tests_testACLMaxUserIP_LDADD= \
-       libsquid.la \
-       libauth.la \
-       ip/libip.la \
+       $(COMMON_LIBS) \
        -L../lib -lmiscutil \
        @REGEXLIB@ \
        @SQUID_CPPUNIT_LIBS@ \
@@ -1482,10 +1471,8 @@ nodist_tests_testCacheManager_SOURCES = \
        repl_modules.cc \
        string_arrays.c
 tests_testCacheManager_LDADD = \
-       libsquid.la \
-       libauth.la \
+       $(COMMON_LIBS) \
        icmp/libicmp.la icmp/libicmp-core.la \
-       ip/libip.la \
        @REPL_OBJS@ \
        ${ADAPTATION_LIBS} \
        @REGEXLIB@ \
@@ -1509,8 +1496,7 @@ tests_testDiskIO_SOURCES = \
 nodist_tests_testDiskIO_SOURCES= \
        $(SWAP_TEST_GEN_SOURCES)
 tests_testDiskIO_LDADD = \
-       ip/libip.la \
-       libsquid.la \
+       $(COMMON_LIBS) \
        @DISK_LIBS@ \
        $(SWAP_TEST_LDADD) \
        SquidConfig.o
@@ -1660,10 +1646,8 @@ nodist_tests_testEvent_SOURCES = \
        repl_modules.cc \
        string_arrays.c
 tests_testEvent_LDADD = \
-       libsquid.la \
-       libauth.la \
+       $(COMMON_LIBS) \
        icmp/libicmp.la icmp/libicmp-core.la \
-       ip/libip.la \
        @REPL_OBJS@ \
        ${ADAPTATION_LIBS} \
        @REGEXLIB@ \
@@ -1817,10 +1801,8 @@ nodist_tests_testEventLoop_SOURCES = \
        repl_modules.cc \
        string_arrays.c
 tests_testEventLoop_LDADD = \
-       libsquid.la \
-       libauth.la \
+       $(COMMON_LIBS) \
        icmp/libicmp.la icmp/libicmp-core.la \
-       ip/libip.la \
        @REPL_OBJS@ \
        ${ADAPTATION_LIBS} \
        @REGEXLIB@ \
@@ -1969,10 +1951,8 @@ nodist_tests_test_http_range_SOURCES = \
        repl_modules.cc \
        string_arrays.c
 tests_test_http_range_LDADD = \
-       libsquid.la \
-       libauth.la \
+       $(COMMON_LIBS) \
        icmp/libicmp.la icmp/libicmp-core.la \
-       ip/libip.la \
        @REPL_OBJS@ \
        @STORE_OBJS@ \
        ${ADAPTATION_LIBS} \
@@ -2127,10 +2107,8 @@ nodist_tests_testHttpRequest_SOURCES = \
        repl_modules.cc \
        string_arrays.c
 tests_testHttpRequest_LDADD = \
-       libsquid.la \
-       libauth.la \
+       $(COMMON_LIBS) \
        icmp/libicmp.la icmp/libicmp-core.la \
-       ip/libip.la \
        @REPL_OBJS@ \
        ${ADAPTATION_LIBS} \
        @REGEXLIB@ \
@@ -2218,9 +2196,7 @@ nodist_tests_testStore_SOURCES= \
        $(STORE_TEST_GEN_SOURCES)
 
 tests_testStore_LDADD= \
-       libsquid.la \
-       libauth.la \
-       ip/libip.la \
+       $(COMMON_LIBS) \
        -L../lib -lmiscutil \
        @REGEXLIB@ \
        @SQUID_CPPUNIT_LIBS@ \
@@ -2242,8 +2218,7 @@ tests_testString_SOURCES = \
 nodist_tests_testString_SOURCES = \
        $(TESTSOURCES)
 tests_testString_LDADD = \
-       libsquid.la \
-       ip/libip.la \
+       $(COMMON_LIBS) \
        -L../lib -lmiscutil \
        @REGEXLIB@ \
        @SQUID_CPPUNIT_LIBS@ \
@@ -2288,7 +2263,6 @@ SWAP_TEST_GEN_SOURCES = \
        $(DISKIO_GEN_SOURCE)
 
 SWAP_TEST_LDADD = \
-       libauth.la \
        @REGEXLIB@ \
        @STORE_LINKOBJS@ \
        @STORE_OBJS@ \
@@ -2314,8 +2288,7 @@ tests_testUfs_SOURCES = \
 nodist_tests_testUfs_SOURCES = \
        $(SWAP_TEST_GEN_SOURCES)
 tests_testUfs_LDADD = \
-       libsquid.la \
-       ip/libip.la \
+       $(COMMON_LIBS) \
        $(SWAP_TEST_LDADD) \
        @SSLLIB@
 tests_testUfs_LDFLAGS = $(LIBADD_DL)
@@ -2492,10 +2465,8 @@ nodist_tests_testURL_SOURCES = \
        repl_modules.cc \
        string_arrays.c
 tests_testURL_LDADD = \
-       libsquid.la \
-       libauth.la \
+       $(COMMON_LIBS) \
        icmp/libicmp.la icmp/libicmp-core.la \
-       ip/libip.la \
        @REGEXLIB@ \
        @REPL_OBJS@ \
        ${ADAPTATION_LIBS} \
index e7316965f60a84e97df0136aaee85ea964a133f5..ff8ef9e8def76df251f6ffd36fb85c351fdbf092 100644 (file)
@@ -37,7 +37,7 @@
 #include "StoreIOBuffer.h"
 #include "forward.h"
 #include "BodyPipe.h"
-#include "ICAP/AsyncJob.h"
+#include "base/AsyncJob.h"
 #include "CommCalls.h"
 
 #if USE_ADAPTATION
diff --git a/src/TestHeaders.am b/src/TestHeaders.am
new file mode 100644 (file)
index 0000000..c3da20a
--- /dev/null
@@ -0,0 +1,12 @@
+## Test ./*.h files in a directory using test-suite/testheaders.sh
+
+## TODO: include in src/Common.am when all testHeaders users are the same.
+
+TESTS += testHeaders
+
+## .h dependency test script
+## aborts build process on errors; XXX: even with "make -k"
+testHeaders: $(srcdir)/*.h
+       $(SHELL) $(top_srcdir)/test-suite/testheaders.sh "$(CXXCOMPILE)" "$(srcdir)" || exit 1
+
+.PHONY: testHeaders
index 89e54045e24e5757bcf5c3d52021d829f98b81ac..0d384be58296e13acec91a249fe9568b9580b0ec 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef SQUID_ADAPTATION__ACCESS_CHECK_H
 #define SQUID_ADAPTATION__ACCESS_CHECK_H
 
-#include "ICAP/AsyncJob.h"
+#include "base/AsyncJob.h"
 #include "adaptation/Elements.h"
 #include "adaptation/forward.h"
 
index a94c5889e60e5904c07aa61d0f365012de6deea3..eba205f7b8b93431b5b198274d97dd67546c8196 100644 (file)
@@ -2,7 +2,7 @@
 #define SQUID_ADAPTATION__INITIATE_H
 
 #include "AsyncCall.h"
-#include "ICAP/AsyncJob.h"
+#include "base/AsyncJob.h"
 #include "adaptation/forward.h"
 
 class HttpMsg;
index 0d66074850fd9891ad49bd9671cdc7d4c8fc0994..ba2a1254f10957db81ea04346fc915398a8c56d2 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef SQUID_ADAPTATION__INITIATOR_H
 #define SQUID_ADAPTATION__INITIATOR_H
 
-#include "ICAP/AsyncJob.h"
+#include "base/AsyncJob.h"
 #include "adaptation/forward.h"
 
 /*
similarity index 100%
rename from src/ICAP/AsyncJob.cc
rename to src/base/AsyncJob.cc
similarity index 98%
rename from src/ICAP/AsyncJob.h
rename to src/base/AsyncJob.h
index ee6ae4589647d255964e9e1d99ab533a87123506..287f64e05d4dcd03be69e448407712076aef49cf 100644 (file)
@@ -5,9 +5,6 @@
 #ifndef SQUID_ASYNC_JOB_H
 #define SQUID_ASYNC_JOB_H
 
-/// \todo move src/ICAP/AsyncJob.* to src/
-
-
 #include "AsyncCall.h"
 #include "TextException.h"
 
diff --git a/src/base/Makefile.am b/src/base/Makefile.am
new file mode 100644 (file)
index 0000000..93b11be
--- /dev/null
@@ -0,0 +1,9 @@
+
+include $(top_srcdir)/src/Common.am
+include $(top_srcdir)/src/TestHeaders.am
+
+noinst_LTLIBRARIES = libbase.la
+
+libbase_la_SOURCES = \
+       AsyncJob.h \
+       AsyncJob.cc
index 5bb37172a1d9822d9522be98bd8d430f141f5342..37ad29978eb04c9e260c9ee7e1ca2107c6f97fb1 100644 (file)
@@ -37,7 +37,7 @@
 #include "StoreIOBuffer.h"
 #include "BodyPipe.h"
 #include "RefCount.h"
-#include "ICAP/AsyncJob.h"
+#include "base/AsyncJob.h"
 #include "CommCalls.h"
 
 class ConnStateData;
index 7e7b9b94f82ebe2f46c285bc2ed5533f286abe4a..0d1cd041c0b11fbc01f9ab495155d6c99da9bb2d 100644 (file)
@@ -41,7 +41,7 @@
 #include "client_side.h"
 #include "AccessLogEntry.h"
 #include "dlink.h"
-#include "ICAP/AsyncJob.h"
+#include "base/AsyncJob.h"
 
 #if USE_ADAPTATION
 #include "adaptation/forward.h"