From: Alex Rousskov Date: Wed, 25 Feb 2009 20:35:16 +0000 (-0700) Subject: SourceLayout: src/fs, take 0 X-Git-Tag: SQUID_3_2_0_1~1154^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b66455ffaa0c2cb0b836b1055ff7590d2646c31e;p=thirdparty%2Fsquid.git SourceLayout: src/fs, take 0 Simplified and documented STORE_* autotools variables. All fs code is built as fs/lib*.a libraries now, no exception for diskd and aufs "fake" legacy modules. fs/* sources are no longer added to executables directly. TODO: Add Makefiles to specific fs modules. TODO: Add Fs namespace and rename fs classes accordingly. testHeaders in fs/Makefile.am requires absolute source directories for out-of-tree checks to work. Removed src/ip/stubQosConfig.cc from STORE_TEST_SOURCES. It does not seem to be needed in my tests. If it is needed, the stub file should be moved into src/tests to avoid dependency on a source in a directory with a Makefile. If the stub is not needed at all, it should be removed from the tree. Note that src/ip/stubQosConfig.cc is non-empty only when --enable-zph-qos. These changes were triggered by an attempt to make "make distclean" work. --- diff --git a/configure.in b/configure.in index 29c162313d..319d6bb1e8 100644 --- a/configure.in +++ b/configure.in @@ -453,14 +453,12 @@ if test -n "$STORE_MODULES"; then dnl ensure that all modules a) exist and b) only include once. STORE_MODULES_FULL=$STORE_MODULES STORE_MODULES= - STORE_LINKOBJS= for module in $STORE_MODULES_FULL; do have_mod=`echo "$STORE_MODULES" | grep "$module"` if test "$have_mod" != ""; then AC_MSG_NOTICE([Removing duplicate $module from storeio]) elif test -d $srcdir/src/fs/$module; then STORE_MODULES="$STORE_MODULES $module" - STORE_LINKOBJS="$STORE_LINKOBJS fs/${module}/StoreFS${module}.o" else AC_MSG_ERROR(storeio $module does not exist) fi @@ -501,36 +499,30 @@ for fs in $STORE_MODULES none; do STORE_TESTS="$STORE_TESTS tests/testUfs$EXEEXT" esac done -STORE_OBJS= -STORE_LIBS= -dnl We have 'fake' modules - aufs and diskd - legacy. -for fs in $STORE_MODULES; do - case "$fs" in - diskd);; - aufs);; - *) - STORE_OBJS="$STORE_OBJS fs/lib${fs}.a" - STORE_LIBS="$STORE_LIBS lib${fs}.a" - ;; - esac -done if test -z "$UFS_FOUND" && test -n "$NEED_UFS"; then AC_MSG_NOTICE([Adding UFS, as it contains core logic for diskd and aufs]) - STORE_OBJS="$STORE_OBJS fs/libufs.a" - STORE_LIBS="$STORE_LIBS libufs.a" STORE_MODULES="$STORE_MODULES ufs" - STORE_LINKOBJS="$STORE_LINKOBJS fs/ufs/StoreFSufs.o" dnl dnl Automake om MinGW needs explicit exe extension dnl for STORE_TESTS substition dnl STORE_TESTS="$STORE_TESTS tests/testUfs$EXEEXT" fi - -AC_SUBST(STORE_OBJS) -AC_SUBST(STORE_LIBS) -AC_SUBST(STORE_LINKOBJS) + +dnl got final STORE_MODULES, build library lists +dnl This list will not be needed when each fs library has its own Makefile +STORE_LIBS_TO_BUILD= +dnl File system libraries to link executables with. +dnl These are the same as STORE_LIBS_TO_BUILD, but with a path +STORE_LIBS_TO_ADD= +for fs in $STORE_MODULES; do + STORE_LIBS_TO_BUILD="$STORE_LIBS_TO_BUILD lib${fs}.a" + STORE_LIBS_TO_ADD="$STORE_LIBS_TO_ADD fs/lib${fs}.a" +done + +AC_SUBST(STORE_LIBS_TO_BUILD) +AC_SUBST(STORE_LIBS_TO_ADD) AC_SUBST(STORE_TESTS) AC_ARG_ENABLE(disk-io, diff --git a/src/Makefile.am b/src/Makefile.am index 793d2c8514..051d374bff 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -264,12 +264,6 @@ cf_gen_LDADD= \ @MINGW_LIBS@ cf_gen.$(OBJEXT): cf_gen_defines.h -all_FSMODULES = \ - fs/aufs/StoreFSaufs.cc \ - fs/coss/StoreFScoss.cc \ - fs/diskd/StoreFSdiskd.cc \ - fs/ufs/StoreFSufs.cc - DISKIO_SOURCE = \ DiskIO/DiskIOModule.cc \ DiskIO/ReadRequest.cc \ @@ -290,7 +284,6 @@ DiskIO/DiskIOModules_gen.cc: Makefile EXTRA_squid_SOURCES = \ - $(all_FSMODULES) \ $(AIO_WIN32_ALL_SOURCES) \ $(all_AUTHMODULES) \ $(ARP_ACL_ALL_SOURCE) \ @@ -676,8 +669,7 @@ squid_LDADD = \ @XTRA_OBJS@ \ @DISK_LINKOBJS@ \ @REPL_OBJS@ \ - @STORE_LINKOBJS@ \ - @STORE_OBJS@ \ + @STORE_LIBS_TO_ADD@ \ @DISK_LIBS@ \ @AUTH_LIBS_TO_ADD@ \ @CRYPTLIB@ \ @@ -690,8 +682,7 @@ squid_LDADD = \ @EPOLL_LIBS@ \ @MINGW_LIBS@ squid_DEPENDENCIES = $(top_builddir)/lib/libmiscutil.a \ - @STORE_OBJS@ \ - @STORE_LINKOBJS@ \ + @STORE_LIBS_TO_ADD@ \ @DISK_LIBS@ \ @DISK_LINKOBJS@ \ @REPL_OBJS@ \ @@ -896,7 +887,7 @@ ufsdump_LDADD = \ icmp/libicmp.la icmp/libicmp-core.la \ @XTRA_OBJS@ \ @REPL_OBJS@ \ - @STORE_OBJS@ \ + @STORE_LIBS_TO_ADD@ \ @AUTH_LIBS_TO_ADD@ \ @CRYPTLIB@ \ @REGEXLIB@ \ @@ -908,8 +899,7 @@ ufsdump_LDADD = \ @EPOLL_LIBS@ \ @MINGW_LIBS@ ufsdump_DEPENDENCIES = $(top_builddir)/lib/libmiscutil.a \ - @STORE_OBJS@ \ - @STORE_LINKOBJS@ \ + @STORE_LIBS_TO_ADD@ \ @DISK_LIBS@ \ @DISK_LINKOBJS@ \ @REPL_OBJS@ \ @@ -1936,7 +1926,7 @@ tests_test_http_range_LDADD = \ $(COMMON_LIBS) \ icmp/libicmp.la icmp/libicmp-core.la \ @REPL_OBJS@ \ - @STORE_OBJS@ \ + @STORE_LIBS_TO_ADD@ \ ${ADAPTATION_LIBS} \ @REGEXLIB@ \ @SNMPLIB@ \ @@ -2138,7 +2128,6 @@ STORE_TEST_SOURCES=\ HttpHdrScTarget.cc url.cc ACLProxyAuth.cc ACLRegexData.cc ACLUserData.cc \ StatHist.cc HttpHdrRange.cc ETag.cc tests/stub_errorpage.cc \ tests/stub_HttpRequest.cc tests/stub_access_log.cc \ - ip/stubQosConfig.cc \ refresh.cc \ tests/stub_store_client.cc \ tests/stub_tools.cc \ @@ -2246,8 +2235,7 @@ SWAP_TEST_GEN_SOURCES = \ SWAP_TEST_LDADD = \ @REGEXLIB@ \ - @STORE_LINKOBJS@ \ - @STORE_OBJS@ \ + @STORE_LIBS_TO_ADD@ \ @REPL_OBJS@ \ @DISK_LIBS@ \ -L../lib -lmiscutil \ @@ -2256,8 +2244,7 @@ SWAP_TEST_DS =\ $(top_builddir)/lib/libmiscutil.a \ repl_modules.o \ @DISK_LIBS@ \ - @STORE_LINKOBJS@ \ - @STORE_OBJS@ \ + @STORE_LIBS_TO_ADD@ \ @REPL_OBJS@ \ @SQUID_CPPUNIT_LA@ diff --git a/src/fs/Makefile.am b/src/fs/Makefile.am index a5b20eefd0..858fd60140 100644 --- a/src/fs/Makefile.am +++ b/src/fs/Makefile.am @@ -1,47 +1,51 @@ -# Makefile for storage modules in the Squid Object Cache server -# -# $Id$ -# +include $(top_srcdir)/src/Common.am -AUTOMAKE_OPTIONS = subdir-objects -AM_CFLAGS = @SQUID_CFLAGS@ -AM_CXXFLAGS = @SQUID_CXXFLAGS@ -CLEANFILES = +EXTRA_LIBRARIES = libaufs.a libdiskd.a libcoss.a libufs.a +noinst_LIBRARIES = @STORE_LIBS_TO_BUILD@ -EXTRA_LIBRARIES = libcoss.a libufs.a -noinst_LIBRARIES = @STORE_LIBS@ +## TODO: add libfs -- file system framework; this library is always built +## TODO: use libtool and add @STORE_LIBS_TO_BUILD@ to libfs.la + +# aufs is a "fake" legacy store +libaufs_a_SOURCES = \ + aufs/StoreFSaufs.cc + +# diskd is a "fake" legacy store +libdiskd_a_SOURCES = \ + diskd/StoreFSdiskd.cc libcoss_a_SOURCES = \ + coss/StoreFScoss.h \ + coss/StoreFScoss.cc \ coss/store_coss.h \ coss/store_io_coss.cc \ coss/store_dir_coss.cc \ coss/CossSwapDir.h -libufs_a_SOURCES = ufs/store_dir_ufs.cc ufs/store_io_ufs.cc \ +libufs_a_SOURCES = \ + ufs/StoreFSufs.h \ + ufs/StoreFSufs.cc \ + ufs/store_dir_ufs.cc \ + ufs/store_io_ufs.cc \ ufs/ufscommon.cci \ ufs/ufscommon.cc \ ufs/ufscommon.h EXTRA_DIST = \ - coss/coss-notes.txt \ - coss/StoreFScoss.h \ - ufs/StoreFSufs.h + coss/coss-notes.txt + +# TODO: fix #include statements so that this is not needed +INCLUDES += -I. -INCLUDES = \ - -I$(top_srcdir) \ - -I. \ - -I$(top_builddir)/include \ - -I$(top_srcdir)/include \ - -I$(top_srcdir)/src -check_PROGRAMS=testHeaders +check_PROGRAMS += testHeaders ## Special Universal .h dependency test script ## aborts if error encountered testHeaders: $(top_srcdir)/src/fs/ufs/*.h $(top_srcdir)/src/fs/coss/*.h - $(SHELL) $(top_srcdir)/test-suite/testheaders.sh "$(CXXCOMPILE)" "ufs" || exit 1 - $(SHELL) $(top_srcdir)/test-suite/testheaders.sh "$(CXXCOMPILE)" "coss" || exit 1 + $(SHELL) $(top_srcdir)/test-suite/testheaders.sh "$(CXXCOMPILE)" "$(top_srcdir)/src/fs/ufs" || exit 1 + $(SHELL) $(top_srcdir)/test-suite/testheaders.sh "$(CXXCOMPILE)" "$(top_srcdir)/src/fs/coss" || exit 1 ## diskd/ has no .h files ## aufs/ has no .h files ## ./ has no .h files