Hi all,
Currently the fs related subsystem is broken in trunk, because of the known linking problems.

I am proposing the attached patch which:
- modifies the configure.in script to define in autoconf.h file the HAVE_FS_UFS, HAVE_FS_AUFS, HAVE_FS_DISKD and HAVE_FS_COSS if the modules ufs, aufs, diskd and coss will be build. - Makes the DiskdInstance UfsInstance and AufsInstance objects which defined in src/fs/diskd/StoreFSdiskd.cc src/fs/ufs/StoreFSufs.cc and src/fs/aufs/StoreFSaufs.cc files, non static - Adds the FsReg.cc file which just makes a reference to DiskdInstance UfsInstance and AufsInstance objects to force the compiler to include the related objs and libraries into squid binary.

Regards,
     Christos



=== modified file 'configure.in'
--- configure.in	2009-03-13 21:54:28 +0000
+++ configure.in	2009-03-28 11:31:39 +0000
@@ -510,6 +510,12 @@
     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=
@@ -519,6 +525,8 @@
 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"
+    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)

=== added file 'src/FsReg.cc'
--- src/FsReg.cc	1970-01-01 00:00:00 +0000
+++ src/FsReg.cc	2009-03-28 11:53:03 +0000
@@ -0,0 +1,28 @@
+#include "squid.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
+extern StoreFSufs<UFSSwapDir> UfsInstance;
+static const char *ufstype = UfsInstance.type();
+#endif
+
+#ifdef HAVE_FS_AUFS
+extern StoreFSufs<UFSSwapDir> AufsInstance;
+static const char *aufstype = AufsInstance.type();
+#endif
+
+#ifdef HAVE_FS_DISKD
+extern StoreFSufs<UFSSwapDir> DiskdInstance;
+static const char *diskdtype = DiskdInstance.type();
+#endif
+
+#ifdef HAVE_FS_COSS
+static const char *cosstype = StoreFScoss::GetInstance().type();
+#endif

=== modified file 'src/fs/aufs/StoreFSaufs.cc'
--- src/fs/aufs/StoreFSaufs.cc	2009-01-21 03:47:47 +0000
+++ src/fs/aufs/StoreFSaufs.cc	2009-03-28 09:48:04 +0000
@@ -51,4 +51,4 @@
  */
 
 /// \ingroup AUFS
-static StoreFSufs<UFSSwapDir> AufsInstance("DiskThreads", "aufs");
+StoreFSufs<UFSSwapDir> AufsInstance("DiskThreads", "aufs");

=== modified file 'src/fs/diskd/StoreFSdiskd.cc'
--- src/fs/diskd/StoreFSdiskd.cc	2009-01-21 03:47:47 +0000
+++ src/fs/diskd/StoreFSdiskd.cc	2009-03-28 09:48:29 +0000
@@ -49,4 +49,4 @@
  */
 
 /// \ingroup diskd
-static StoreFSufs<UFSSwapDir> DiskdInstance("DiskDaemon", "diskd");
+StoreFSufs<UFSSwapDir> DiskdInstance("DiskDaemon", "diskd");

=== modified file 'src/fs/ufs/StoreFSufs.cc'
--- src/fs/ufs/StoreFSufs.cc	2009-01-21 03:47:47 +0000
+++ src/fs/ufs/StoreFSufs.cc	2009-03-28 09:48:18 +0000
@@ -46,5 +46,5 @@
 /** \todo FIXME: break UFSSwapDir out so we don't build all the extras */
 #include "fs/ufs/ufscommon.h"
 
-static StoreFSufs<UFSSwapDir> UfsInstance("Blocking", "ufs");
+StoreFSufs<UFSSwapDir> UfsInstance("Blocking", "ufs");
 

Reply via email to