[Sheepdog] [PATCH v2 4/5] make corosync cluster driver an optional feature

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Wed Nov 2 10:59:25 CET 2011


Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 configure.ac      |   15 ++++++++++++---
 sheep/Makefile.am |    6 +++++-
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index ca33fab..34bb4aa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -171,6 +171,11 @@ AC_ARG_ENABLE([coverage],
 	[  --enable-coverage       : coverage analysis of the codebase. ],
 	[ default="no" ])
 
+AC_ARG_ENABLE([corosync],
+	[  --enable-corosync       : build corosync cluster driver ],,
+	[ enable_corosync="yes" ],)
+AM_CONDITIONAL(BUILD_COROSYNC, test x$enable_corosync = xyes)
+
 AC_ARG_WITH([initddir],
 	[  --with-initddir=DIR     : path to init script directory. ],
 	[ INITDDIR="$withval" ],
@@ -214,9 +219,13 @@ else
 	GDB_FLAGS="-g"
 fi
 
-PKG_CHECK_MODULES([corosync],[corosync])
-PKG_CHECK_MODULES([libcpg],[libcpg])
-PKG_CHECK_MODULES([libcfg],[libcfg])
+if test "x${enable_corosync}" = xyes; then
+	PKG_CHECK_MODULES([corosync],[corosync])
+	PKG_CHECK_MODULES([libcpg],[libcpg])
+	PKG_CHECK_MODULES([libcfg],[libcfg])
+	AC_DEFINE_UNQUOTED([HAVE_COROSYNC], 1, [have corosync])
+	PACKAGE_FEATURES="$PACKAGE_FEATURES corosync"
+fi
 
 # extra warnings
 EXTRA_WARNINGS=""
diff --git a/sheep/Makefile.am b/sheep/Makefile.am
index 745fdde..da8be16 100644
--- a/sheep/Makefile.am
+++ b/sheep/Makefile.am
@@ -24,7 +24,11 @@ INCLUDES		= -I$(top_builddir)/include -I$(top_srcdir)/include $(libcpg_CFLAGS) $
 sbin_PROGRAMS		= sheep
 
 sheep_SOURCES		= sheep.c group.c sdnet.c store.c vdi.c work.c journal.c ops.c \
-			  cluster/corosync.c cluster/local.c
+			  cluster/local.c
+if BUILD_COROSYNC
+sheep_SOURCES		+= cluster/corosync.c
+endif
+
 sheep_LDADD	  	= $(libcpg_LIBS) $(libcfg_LIBS) ../lib/libsheepdog.a -lpthread
 sheep_DEPENDENCIES	= ../lib/libsheepdog.a
 
-- 
1.7.2.5




More information about the sheepdog mailing list