[Sheepdog] [PATCH RFC 01/10] sheepfs: modify configure file to work with sheepfs
Liu Yuan
namei.unix at gmail.com
Sat May 5 13:29:13 CEST 2012
From: Liu Yuan <tailai.ly at taobao.com>
Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
configure.ac | 25 ++++++++++++++++++++++++-
sheep/Makefile.am | 7 ++++++-
2 files changed, 30 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index 7a5eedf..b2166d7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -208,6 +208,11 @@ AC_ARG_ENABLE([trace],
[ enable_trace="no" ],)
AM_CONDITIONAL(BUILD_TRACE, test x$enable_trace = xyes)
+AC_ARG_ENABLE([sheepfs],
+ [ --enable-sheepfs : enable sheepfs],,
+ [ enable_sheepfs="yes" ],)
+AM_CONDITIONAL(BUILD_SHEEPFS, test x$enable_sheepfs = xyes)
+
CP=cp
OS_LDL="-ldl"
case "$host_os" in
@@ -285,6 +290,15 @@ if test "x${enable_trace}" = xyes; then
PACKAGE_FEATURES="$PACKAGE_FEATURES trace"
fi
+if test "x${enable_sheepfs}" = xyes; then
+ AC_CHECK_LIB([fuse], [fuse_main_real],,
+ AC_MSG_ERROR(libfuse not found))
+# AC_CHECK_HEADERS([fuse.h],,
+# AC_MSG_ERROR(fuse header missing))
+ AC_DEFINE_UNQUOTED([HAVE_SHEEPFS], 1, [have sheepfs])
+ PACKAGE_FEATURES="$PACKAGE_FEATURES sheepfs"
+fi
+
# extra warnings
EXTRA_WARNINGS=""
@@ -349,8 +363,16 @@ else
TRACE_CFLAGS=""
fi
+if test "x${enable_sheepfs}" = xyes ; then
+ AC_MSG_NOTICE([Enabling sheepfs (-lfuse)])
+ SHEEPFS_CFLAGS="-lfuse -DENABLE_SHEEPFS -DFUSE_USE_VERSION=26 -D_FILE_OFFSET_BITS=64"
+ PACKAGE_FEATURES="$PACKAGE_FEATURES sheepfs"
+else
+ SHEEPFS_CFLAGS=""
+fi
+
# final build of *FLAGS
-CFLAGS="$ENV_CFLAGS $OPT_CFLAGS $GDB_FLAGS $OS_CFLAGS \
+CFLAGS="$ENV_CFLAGS $OPT_CFLAGS $GDB_FLAGS $OS_CFLAGS $SHEEPFS_CFLAGS \
$TRACE_CFLAGS $COVERAGE_CFLAGS $EXTRA_WARNINGS $WERROR_CFLAGS $NSS_CFLAGS \
-D_GNU_SOURCE"
CPPFLAGS="$ENV_CPPFLAGS $ANSI_CPPFLAGS $OS_CPPFLAGS"
@@ -409,6 +431,7 @@ AC_MSG_RESULT([ Coverage CFLAGS = ${COVERAGE_CFLAGS}])
AC_MSG_RESULT([ Coverage LDFLAGS = ${COVERAGE_LDFLAGS}])
AC_MSG_RESULT([ Fatal War. CFLAGS = ${WERROR_CFLAGS}])
AC_MSG_RESULT([ Trace CFLAGS = ${TRACE_CFLAGS}])
+AC_MSG_RESULT([ Sheepfs CFLAGS = ${SHEEPFS_CFLAGS}])
AC_MSG_RESULT([ Final CFLAGS = ${CFLAGS}])
AC_MSG_RESULT([ Final CPPFLAGS = ${CPPFLAGS}])
AC_MSG_RESULT([ Final LDFLAGS = ${LDFLAGS}])
diff --git a/sheep/Makefile.am b/sheep/Makefile.am
index 7448ae1..9ad9492 100644
--- a/sheep/Makefile.am
+++ b/sheep/Makefile.am
@@ -46,12 +46,17 @@ if BUILD_TRACE
sheep_SOURCES += trace/trace.c trace/mcount.S trace/stabs.c trace/graph.c
endif
+if BUILD_SHEEPFS
+sheep_SOURCES += sheepfs/core.c sheepfs/cluster.c sheepfs/VDI.c
+endif
+
sheep_LDADD = ../lib/libsheepdog.a -lpthread \
$(libcpg_LIBS) $(libcfg_LIBS) $(libacrd_LIBS) $(LIBS)
sheep_DEPENDENCIES = ../lib/libsheepdog.a
-noinst_HEADERS = work.h sheep_priv.h cluster.h strbuf.h farm/farm.h trace/trace.h
+noinst_HEADERS = work.h sheep_priv.h cluster.h strbuf.h farm/farm.h trace/trace.h \
+ sheepfs/sheepfs.h
EXTRA_DIST =
--
1.7.8.2
More information about the sheepdog
mailing list