STORE_TESTS="$STORE_TESTS tests/testUfs$EXEEXT"
fi
+AH_TEMPLATE(HAVE_FS_UFS, "Define to 1 if ufs filesystem module is build")
+AH_TEMPLATE(HAVE_FS_AUFS, "Define to 1 if aufs filesystem module is build")
+AH_TEMPLATE(HAVE_FS_DISKD, "Define to 1 if diskd filesystem module is build")
+AH_TEMPLATE(HAVE_FS_COSS, "Define to 1 if coss filesystem module is build")
+
+
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 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"
+ STORE_LIBS_TO_BUILD="$STORE_LIBS_TO_BUILD lib${fs}.la"
+ STORE_LIBS_TO_ADD="$STORE_LIBS_TO_ADD fs/lib${fs}.la"
+ HAVE_FS_TYPE=HAVE_FS_`echo $fs | sed 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ AC_DEFINE_UNQUOTED($HAVE_FS_TYPE, 1)
done
AC_SUBST(STORE_LIBS_TO_BUILD)
auth/libauth.la \
acl/libapi.la \
base/libbase.la \
- ip/libip.la
+ ip/libip.la \
+ fs/libfs.la
INCLUDES = \
-I$(top_srcdir) \
@XTRA_OBJS@ \
@DISK_LINKOBJS@ \
@REPL_OBJS@ \
- @STORE_LIBS_TO_ADD@ \
@DISK_LIBS@ \
@CRYPTLIB@ \
@REGEXLIB@ \
@EPOLL_LIBS@ \
@MINGW_LIBS@
squid_DEPENDENCIES = $(top_builddir)/lib/libmiscutil.a \
- @STORE_LIBS_TO_ADD@ \
@DISK_LIBS@ \
@DISK_LINKOBJS@ \
@REPL_OBJS@ \
$(COMMON_LIBS) \
@XTRA_OBJS@ \
@REPL_OBJS@ \
- @STORE_LIBS_TO_ADD@ \
@CRYPTLIB@ \
@REGEXLIB@ \
@SNMPLIB@ \
@EPOLL_LIBS@ \
@MINGW_LIBS@
ufsdump_DEPENDENCIES = $(top_builddir)/lib/libmiscutil.a \
- @STORE_LIBS_TO_ADD@ \
+ $(COMMON_LIBS) \
@DISK_LIBS@ \
@DISK_LINKOBJS@ \
@REPL_OBJS@
$(COMMON_LIBS) \
icmp/libicmp.la icmp/libicmp-core.la \
@REPL_OBJS@ \
- @STORE_LIBS_TO_ADD@ \
${ADAPTATION_LIBS} \
${ESI_LIBS} \
@REGEXLIB@ \
SWAP_TEST_LDADD = \
@REGEXLIB@ \
- @STORE_LIBS_TO_ADD@ \
+ $(COMMON_LIBS) \
@REPL_OBJS@ \
@DISK_LIBS@ \
-L../lib -lmiscutil \
$(top_builddir)/lib/libmiscutil.a \
repl_modules.o \
@DISK_LIBS@ \
- @STORE_LIBS_TO_ADD@ \
+ $(COMMON_LIBS) \
@REPL_OBJS@ \
@SQUID_CPPUNIT_LA@
include $(top_srcdir)/src/Common.am
-EXTRA_LIBRARIES = libaufs.a libdiskd.a libcoss.a libufs.a
-noinst_LIBRARIES = @STORE_LIBS_TO_BUILD@
-
-## TODO: add libfs -- file system framework; this library is always built
-## TODO: use libtool and add @STORE_LIBS_TO_BUILD@ to libfs.la
+EXTRA_LTLIBRARIES = libaufs.la libdiskd.la libcoss.la libufs.la
+noinst_LTLIBRARIES = @STORE_LIBS_TO_BUILD@ libfs.la
# aufs is a "fake" legacy store
-libaufs_a_SOURCES = \
+libaufs_la_SOURCES = \
aufs/StoreFSaufs.cc
# diskd is a "fake" legacy store
-libdiskd_a_SOURCES = \
+libdiskd_la_SOURCES = \
diskd/StoreFSdiskd.cc
-libcoss_a_SOURCES = \
+libcoss_la_SOURCES = \
coss/StoreFScoss.h \
coss/StoreFScoss.cc \
coss/store_coss.h \
coss/store_dir_coss.cc \
coss/CossSwapDir.h
-libufs_a_SOURCES = \
+libufs_la_SOURCES = \
ufs/StoreFSufs.h \
ufs/StoreFSufs.cc \
ufs/store_dir_ufs.cc \
ufs/ufscommon.cc \
ufs/ufscommon.h
+libfs_la_SOURCES = Module.cc Module.h
+libfs_la_LIBADD = @STORE_LIBS_TO_BUILD@
+libfs_la_DEPENDENCIES = @STORE_LIBS_TO_BUILD@
EXTRA_DIST = \
coss/coss-notes.txt
CLEANFILES += testHeaders.c
## targets below to emulate distributed makefiles
-coss/all: libcoss.a
+coss/all: libcoss.la
coss/clean: clean
-ufs/all: libufs.a
+ufs/all: libufs.la
ufs/clean: clean
--- /dev/null
+#include "squid.h"
+#include "Module.h"
+#if defined(HAVE_FS_UFS) || defined(HAVE_FS_AUFS) || defined(HAVE_FS_DISKD)
+#include "fs/ufs/StoreFSufs.h"
+#include "fs/ufs/ufscommon.h"
+#endif
+
+#ifdef HAVE_FS_COSS
+#include "fs/coss/StoreFScoss.h"
+#endif
+
+#ifdef HAVE_FS_UFS
+static StoreFSufs<UFSSwapDir> *UfsInstance;
+#endif
+
+#ifdef HAVE_FS_AUFS
+static StoreFSufs<UFSSwapDir> *AufsInstance;
+#endif
+
+
+#ifdef HAVE_FS_DISKD
+static StoreFSufs<UFSSwapDir> *DiskdInstance;
+#endif
+
+/* TODO: Modify coss code to:
+ * (a) remove the StoreFScoss::GetInstance method,
+ * (b) declare the StoreFScoss::stats as static and
+ * (c) merge the StoreFScoss::stat() method with the static
+ * StoreFScoss::Stats() */
+#ifdef HAVE_FS_COSS
+ StoreFScoss &CossInstance = StoreFScoss::GetInstance();
+#endif
+
+
+void Fs::Init() {
+
+#ifdef HAVE_FS_UFS
+ UfsInstance = new StoreFSufs<UFSSwapDir>("Blocking", "ufs");
+#endif
+
+#ifdef HAVE_FS_AUFS
+ AufsInstance = new StoreFSufs<UFSSwapDir>("DiskThreads", "aufs");;
+#endif
+
+
+#ifdef HAVE_FS_DISKD
+ DiskdInstance = new StoreFSufs<UFSSwapDir>("DiskDaemon", "diskd");;
+#endif
+
+}
+
+
+void Fs::Clean() {
+#ifdef HAVE_FS_UFS
+ delete UfsInstance;
+#endif
+
+#ifdef HAVE_FS_AUFS
+ delete AufsInstance;
+#endif
+
+
+#ifdef HAVE_FS_DISKD
+ delete DiskdInstance;
+#endif
+
+}
--- /dev/null
+#ifndef SQUID_FS_MODULE_H
+#define SQUID_FS_MODULE_H
+
+namespace Fs {
+
+ extern void Init();
+ extern void Clean();
+
+}; // namespace Fs
+
+#endif /* SQUID_FS_MODULE_H */
*
* Copyright (c) 2003, Robert Collins <robertc@squid-cache.org>
*/
+
+/* TODO: remove this file as unused */
+
#include "config.h"
#if 0
\ingroup UFS, FileSystems
*/
-/// \ingroup AUFS
-static StoreFSufs<UFSSwapDir> AufsInstance("DiskThreads", "aufs");
+/* Unused variable: */
+StoreFSufs<UFSSwapDir> *AufsInstance_foo = NULL;
* Copyright (c) 2003, Robert Collins <robertc@squid-cache.org>
*/
+/* TODO: remove this file as unused */
+
#if 0
#include "StoreFileSystem.h"
#include "DiskIO/DiskIOModule.h"
\ingroup FileSystems, UFS
*/
-/// \ingroup diskd
-static StoreFSufs<UFSSwapDir> DiskdInstance("DiskDaemon", "diskd");
+/* Unused variable: */
+StoreFSufs<UFSSwapDir> *DiskdInstance_foo = NULL;
* Copyright (c) 2003, Robert Collins <robertc@squid-cache.org>
*/
+/*TODO: remove this file as unused*/
+
#if 0
#include "StoreFileSystem.h"
#endif
/** \todo FIXME: break UFSSwapDir out so we don't build all the extras */
#include "fs/ufs/ufscommon.h"
-static StoreFSufs<UFSSwapDir> UfsInstance("Blocking", "ufs");
-
+/* Unused variable: */
+StoreFSufs<UFSSwapDir> *UfsInstance_foo = NULL;
#include "esi/Module.h"
#endif
+#include "fs/Module.h"
+
#if USE_WIN32_SERVICE
#include "squid_windows.h"
storeFsInit(); /* required for config parsing */
+ /* TODO: call the FS::Clean() in shutdown to do Fs cleanups */
+ Fs::Init();
+
/* May not be needed for parsing, have not audited for such */
DiskIOModule::SetupAllModules();