[Ocfs2-tools-devel] [PATCH 3/9] ocfs2_controld: Make libdlmcontrol required

Joel Becker joel.becker at oracle.com
Wed Aug 13 17:15:33 PDT 2008


ocfs2_controld needs to use libdlmcontrol to talk to dlm_controld.  This
makes configure detect its presence.  It also separates
BUILD_OCFS2_CONTROLD from BUILD_CMAN_SUPPORT.  The parts required for
all ocfs2_controlds (cpg, openais, libdlm, libdlmcontrol) are tested
separately then the cman part specific to a cman controld.

This allows other stacks to check and set BUILD_XXX_SUPPORT for their
own controld independent of cpg/libdlm.

Signed-off-by: Joel Becker <joel.becker at oracle.com>
---
 Config.make.in          |    1 +
 configure.in            |   33 ++++++++++++++++++++++++---------
 ocfs2_controld/Makefile |    4 +++-
 3 files changed, 28 insertions(+), 10 deletions(-)

diff --git a/Config.make.in b/Config.make.in
index a509e7d..10bc790 100644
--- a/Config.make.in
+++ b/Config.make.in
@@ -76,6 +76,7 @@ BUILD_OCFS2CONSOLE = @BUILD_OCFS2CONSOLE@
 
 BUILD_DEBUGOCFS2 = @BUILD_DEBUGOCFS2@
 
+BUILD_OCFS2_CONTROLD = @BUILD_OCFS2_CONTROLD@
 BUILD_CMAN_SUPPORT = @BUILD_CMAN_SUPPORT@
 BUILD_FSDLM_SUPPORT = @BUILD_FSDLM_SUPPORT@
 CPG_LDFLAGS = @CPG_LDFLAGS@
diff --git a/configure.in b/configure.in
index a0a1431..41415f9 100644
--- a/configure.in
+++ b/configure.in
@@ -211,10 +211,8 @@ AC_CHECK_LIB(cman, cman_replyto_shutdown,
   [AC_MSG_WARN([libcman not found, cman support will not be built])])
 
 cpg_found=
-if test "x$cman_found" = "xyes"; then
-  AC_CHECK_HEADER(openais/cpg.h, cpg_found=yes,
-    [AC_MSG_WARN([openais/cpg.h not found, cman support will not be built])])
-fi
+AC_CHECK_HEADER(openais/cpg.h, cpg_found=yes,
+  [AC_MSG_WARN([openais/cpg.h not found, ocfs2_controld will not be built])])
 
 #
 # We can't use AC_CHECK_LIB on libcpg, because it is in
@@ -252,11 +250,22 @@ if test "x$CPG_LDFLAGS" != "x"; then
     AC_MSG_RESULT(yes)
 else
     AC_MSG_RESULT(no)
-    AC_MSG_WARN([libcpg not found, cman support will not be built])
+    AC_MSG_WARN([libcpg not found, ocfs2_controld will not be built])
     cpg_found=
 fi
 AC_SUBST(CPG_LDFLAGS)
 
+libdlmcontrol_found=
+AC_CHECK_LIB(dlmcontrol, dlmc_fs_connect,
+  [AC_CHECK_HEADER(libdlmcontrol.h, libdlmcontrol_found=yes,
+    [AC_MSG_WARN([libdlmcontrol.h not found, ocfs2_controld will not be built])],
+    [
+#include <sys/stat.h>
+#include <inttypes.h>
+#include <libdlm.h>
+])],
+  [AC_MSG_WARN([libdlmcontrol not found, ocfs2_controld will not be built])])
+
 LIBDLM_FOUND=
 AC_CHECK_HEADER(libdlm.h, LIBDLM_FOUND=yes,
   [AC_MSG_WARN([libdlm.h not found, fsdlm support will not be built])])
@@ -279,14 +288,20 @@ fi
 AC_SUBST(BUILD_FSDLM_SUPPORT)
 AC_SUBST(DL_LIBS)
 
-BUILD_CMAN_SUPPORT=
-if test "x$cman_found" = "xyes" -a "x$cpg_found" = "xyes"; then
+BUILD_OCFS2_CONTROLD=
+if test "x$cpg_found" = "xyes" -a "x$libdlmcontrol_found" = "xyes"; then
   if test "x$fsdlm_found" = "xyes"; then
-    BUILD_CMAN_SUPPORT=yes
+    BUILD_OCFS2_CONTROLD=yes
   else
-    AC_MSG_WARN([fsdlm not available, cman support will not be built])
+    AC_MSG_WARN([fsdlm support is not available, ocfs2_controld will not be built])
   fi
 fi
+AC_SUBST(BUILD_OCFS2_CONTROLD)
+
+BUILD_CMAN_SUPPORT=
+if test "x$cman_found" = "xyes" -a "x$BUILD_OCFS2_CONTROLD" = "xyes"; then
+  BUILD_CMAN_SUPPORT=yes
+fi
 AC_SUBST(BUILD_CMAN_SUPPORT)
 
 BUILD_OCFS2CONSOLE=
diff --git a/ocfs2_controld/Makefile b/ocfs2_controld/Makefile
index e6746ed..3a948a4 100644
--- a/ocfs2_controld/Makefile
+++ b/ocfs2_controld/Makefile
@@ -4,8 +4,10 @@ include $(TOPDIR)/Preamble.make
 
 sbindir = $(root_sbindir)
 
-ifneq ($(BUILD_CMAN_SUPPORT),)
+ifneq ($(BUILD_OCFS2_CONTROLD),)
+  ifneq ($(BUILD_CMAN_SUPPORT),)
 SBIN_PROGRAMS = ocfs2_controld.cman
+  endif
 UNINST_PROGRAMS = test_client
 endif
 
-- 
1.5.6.3




More information about the Ocfs2-tools-devel mailing list