From: Liu Yuan <tailai...@taobao.com>

Drive farm to work!

add two new lib dependency:
 - libssl

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 libssl-dev.

Signed-off-by: Dongsu Park <dongsu.p...@profitbricks.com>
Signed-off-by: Liu Yuan <tailai...@taobao.com>
---
 configure.ac      |   14 ++++++++++++++
 sheep/Makefile.am |    8 ++++++--
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index dac7b7d..bfad873 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,15 @@ 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_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..279af77 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/farm.h
 
 EXTRA_DIST             = 
 
-- 
1.7.8.2

-- 
sheepdog mailing list
sheepdog@lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/sheepdog

Reply via email to