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.
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
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,
@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 \
EXTRA_squid_SOURCES = \
- $(all_FSMODULES) \
$(AIO_WIN32_ALL_SOURCES) \
$(all_AUTHMODULES) \
$(ARP_ACL_ALL_SOURCE) \
@XTRA_OBJS@ \
@DISK_LINKOBJS@ \
@REPL_OBJS@ \
- @STORE_LINKOBJS@ \
- @STORE_OBJS@ \
+ @STORE_LIBS_TO_ADD@ \
@DISK_LIBS@ \
@AUTH_LIBS_TO_ADD@ \
@CRYPTLIB@ \
@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@ \
icmp/libicmp.la icmp/libicmp-core.la \
@XTRA_OBJS@ \
@REPL_OBJS@ \
- @STORE_OBJS@ \
+ @STORE_LIBS_TO_ADD@ \
@AUTH_LIBS_TO_ADD@ \
@CRYPTLIB@ \
@REGEXLIB@ \
@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@ \
$(COMMON_LIBS) \
icmp/libicmp.la icmp/libicmp-core.la \
@REPL_OBJS@ \
- @STORE_OBJS@ \
+ @STORE_LIBS_TO_ADD@ \
${ADAPTATION_LIBS} \
@REGEXLIB@ \
@SNMPLIB@ \
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 \
SWAP_TEST_LDADD = \
@REGEXLIB@ \
- @STORE_LINKOBJS@ \
- @STORE_OBJS@ \
+ @STORE_LIBS_TO_ADD@ \
@REPL_OBJS@ \
@DISK_LIBS@ \
-L../lib -lmiscutil \
$(top_builddir)/lib/libmiscutil.a \
repl_modules.o \
@DISK_LIBS@ \
- @STORE_LINKOBJS@ \
- @STORE_OBJS@ \
+ @STORE_LIBS_TO_ADD@ \
@REPL_OBJS@ \
@SQUID_CPPUNIT_LA@
-# 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