[Sheepdog] [PATCH v5 04/17] sheep: modify the configures to run farm.

Liu Yuan namei.unix at gmail.com
Fri Dec 30 14:06:59 CET 2011


From: Liu Yuan <tailai.ly at taobao.com>

Drive farm to work!

add two new lib dependency:
 - libssl
 - zlib

Dongsu Park suggests that we should check crypto lib for SHA1_Init
with newer libssl.

Currently libssl-1.0 and libssl-0.9.8 works with current configuration.

For debian based systems, you can install them by the name
zlib1g-dev and libssl-dev.

Cc: Dongsu Park <dongsu.park at profitbricks.com>
Signed-off-by: Dongsu Park <dongsu.park at profitbricks.com>
Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
 configure.ac      |   18 ++++++++++++++++++
 sheep/Makefile.am |    8 ++++++--
 2 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index dac7b7d..0dd212a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -197,6 +197,11 @@ AC_ARG_WITH([initddir],
 	[ INITDDIR="$withval" ],
 	[ INITDDIR="$sysconfdir/init.d" ])
 
+AC_ARG_ENABLE([farm],
+	[  --enable-farm           : build farm store driver ],,
+	[ enable_farm="yes" ],)
+AM_CONDITIONAL(BUILD_FARM, test x$enable_farm = xyes)
+
 CP=cp
 OS_LDL="-ldl"
 case "$host_os" in
@@ -258,6 +263,19 @@ if test "x${enable_accord}" = xyes; then
 	PACKAGE_FEATURES="$PACKAGE_FEATURES accord"
 fi
 
+if test "x${enable_farm}" = xyes; then
+	AC_CHECK_LIB([crypto], [SHA1_Init],,
+		AC_MSG_ERROR(libcrypto not found))
+	AC_CHECK_HEADERS([openssl/sha.h],,
+		AC_MSG_ERROR(sha.h header missing))
+	AC_CHECK_LIB([z], [deflate],,
+		AC_MSG_ERROR(zlib not found))
+	AC_CHECK_HEADERS([zlib.h],,
+		AC_MSG_ERROR(zlib.h header missing))
+	AC_DEFINE_UNQUOTED([HAVE_FARM], 1, [have farm])
+	PACKAGE_FEATURES="$PACKAGE_FEATURES farm"
+fi
+
 # extra warnings
 EXTRA_WARNINGS=""
 
diff --git a/sheep/Makefile.am b/sheep/Makefile.am
index 146b421..6a44e4a 100644
--- a/sheep/Makefile.am
+++ b/sheep/Makefile.am
@@ -36,12 +36,16 @@ if BUILD_ACCORD
 sheep_SOURCES		+= cluster/accord.c
 endif
 
+if BUILD_FARM
+sheep_SOURCES		+= farm/sha1_file.c farm/trunk.c farm/snap.c farm/farm.c
+endif
+
 sheep_LDADD	  	= ../lib/libsheepdog.a -lpthread \
-			  $(libcpg_LIBS) $(libcfg_LIBS) $(libacrd_LIBS)
+			  $(libcpg_LIBS) $(libcfg_LIBS) $(libacrd_LIBS) $(LIBS)
 sheep_DEPENDENCIES	= ../lib/libsheepdog.a
 
 
-noinst_HEADERS		= work.h sheep_priv.h cluster.h strbuf.h
+noinst_HEADERS		= work.h sheep_priv.h cluster.h strbuf.h farm.h
 
 EXTRA_DIST		= 
 
-- 
1.7.8.rc3




More information about the sheepdog mailing list