summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-01-28 17:36:36 +0100
committerStefan Metzmacher <metze@samba.org>2009-01-29 17:40:13 +0100
commit11163720e6f30e83f523c5009e1e60b5cf28cda6 (patch)
tree09fbcbd7b915ed904b6ef2a1f7e2051a2985771b
parent7540d13956a8a69d25f6fbbc4f9a3417e91db1d2 (diff)
downloadsamba-11163720e6f30e83f523c5009e1e60b5cf28cda6.tar.gz
samba-11163720e6f30e83f523c5009e1e60b5cf28cda6.tar.bz2
samba-11163720e6f30e83f523c5009e1e60b5cf28cda6.zip
s3:configure: autodetect ctdb/cluster support
We need to make sure ctdb has transaction support and we autodetect ipv6 support. metze
-rw-r--r--source3/Makefile.in1
-rw-r--r--source3/configure.in119
-rw-r--r--source3/m4/check_path.m414
3 files changed, 115 insertions, 19 deletions
diff --git a/source3/Makefile.in b/source3/Makefile.in
index b3978eae40..5448643c1d 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -130,7 +130,6 @@ INSTALLPERMS_DATA = 0644
LOGFILEBASE = @logfilebase@
CONFIGFILE = $(CONFIGDIR)/smb.conf
LMHOSTSFILE = $(CONFIGDIR)/lmhosts
-CTDBDIR = @ctdbdir@
NCALRPCDIR = @ncalrpcdir@
# This is where smbpasswd et al go
diff --git a/source3/configure.in b/source3/configure.in
index b4c021cd0d..40130fb300 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -5152,17 +5152,128 @@ AC_MSG_RESULT([$samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT])
#################################################
# check for cluster extensions
-AC_MSG_CHECKING(whether to include cluster support)
+CTDB_CFLAGS=""
+AC_SUBST(CTDB_CFLAGS)
+AC_ARG_WITH(ctdb,
+[AS_HELP_STRING([--with-ctdb=DIR], [Where to find ctdb sources])],
+[ case "$withval" in
+ yes|no)
+ AC_MSG_WARN([--with-ctdb called without argument])
+ ;;
+ *)
+ CTDB_CPPFLAGS="-I$withval/include"
+ ;;
+ esac])
+
+SAVED_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS $CTDB_CPPFLAGS"
+ctdb_broken="missing or broken headers"
+
+AC_CHECK_HEADERS(ctdb.h ctdb_private.h,,,[
+#include "confdefs.h"
+#define NO_CONFIG_H
+#include "replace.h"
+#include "system/wait.h"
+#include "system/network.h"
+#define private #error __USED_RESERVED_WORD_private__
+#include <talloc.h>
+#include <tdb.h>
+#include <ctdb.h>
+])
+
+AC_HAVE_DECL(CTDB_CONTROL_TRANS2_COMMIT_RETRY,[
+#include "confdefs.h"
+#define NO_CONFIG_H
+#include "replace.h"
+#include "system/wait.h"
+#include "system/network.h"
+#include <talloc.h>
+#include <tdb.h>
+#include <ctdb.h>
+#include <ctdb_private.h>
+])
+if test x"$ac_cv_have_CTDB_CONTROL_TRANS2_COMMIT_RETRY_decl" = x"yes"; then
+ ctdb_broken=no
+else
+ ctdb_broken="missing transaction support"
+fi
+
+# in ctdb 1.0.57 ctdb_control_tcp was temparary renamed to ctdb_tcp_client
+AC_CHECK_TYPE(struct ctdb_tcp_client,[
+ AC_DEFINE([ctdb_control_tcp],[ctdb_tcp_client],[ctdb ipv4 support])
+],,[
+#include "confdefs.h"
+#define NO_CONFIG_H
+#include "replace.h"
+#include "system/wait.h"
+#include "system/network.h"
+#include <talloc.h>
+#include <tdb.h>
+#include <ctdb.h>
+#include <ctdb_private.h>
+])
+
+AC_CHECK_TYPE(struct ctdb_control_tcp,[
+ AC_DEFINE([HAVE_STRUCT_CTDB_CONTROL_TCP],[1],[ctdb ipv4 support])
+],[
+ ctdb_broken="missing struct ctdb_control_tcp"
+],[
+#include "confdefs.h"
+#define NO_CONFIG_H
+#include "replace.h"
+#include "system/wait.h"
+#include "system/network.h"
+#include <talloc.h>
+#include <tdb.h>
+#include <ctdb.h>
+#include <ctdb_private.h>
+])
+
+AC_CHECK_TYPE(struct ctdb_control_tcp_addr,[
+ AC_DEFINE([HAVE_STRUCT_CTDB_CONTROL_TCP_ADDR],[1],[ctdb ipv6 support])
+],,[
+#include "confdefs.h"
+#define NO_CONFIG_H
+#include "replace.h"
+#include "system/wait.h"
+#include "system/network.h"
+#include <talloc.h>
+#include <tdb.h>
+#include <ctdb.h>
+#include <ctdb_private.h>
+])
+CPPFLAGS="$SAVED_CPPFLAGS"
+
+AC_MSG_CHECKING(cluster support)
AC_ARG_WITH(cluster-support,
-[AS_HELP_STRING([--with-cluster-support], [Enable cluster extensions (default=no)])])
-if test "x$with_cluster_support" = "xyes"; then
+[AS_HELP_STRING([--with-cluster-support], [Enable cluster extensions (default=auto)])])
+
+if test x"$with_cluster_support" = x ; then
+ with_cluster_support="auto"
+fi
+
+if test x"$ac_cv_header_ctdb_private_h" != x"yes"; then
+ if test "x$with_cluster_support" = "xyes"; then
+ AC_MSG_ERROR("ctdb_private.h is required for cluster support")
+ fi
+ with_cluster_support=no
+fi
+
+if test x"$ctdb_broken" != x"no"; then
+ if test "x$with_cluster_support" = "xyes"; then
+ AC_MSG_ERROR(["cluster support: $ctdb_broken"])
+ fi
+ with_cluster_support=no
+fi
+
+if test "x$with_cluster_support" != "xno"; then
AC_DEFINE(CLUSTER_SUPPORT,1,[Whether to enable cluster extensions])
+ SAMBA_CPPFLAGS="${SAMBA_CPPFLAGS} ${CTDB_CPPFLAGS}"
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
-
#################################################
# check for ACL support
diff --git a/source3/m4/check_path.m4 b/source3/m4/check_path.m4
index 2a468d7002..12b998747a 100644
--- a/source3/m4/check_path.m4
+++ b/source3/m4/check_path.m4
@@ -215,19 +215,6 @@ AC_ARG_WITH(logfilebase,
#################################################
-# set ctdb source directory location
-AC_ARG_WITH(ctdb,
-[AS_HELP_STRING([--with-ctdb=DIR], [Where to find ctdb sources])],
-[ case "$withval" in
- yes|no)
- AC_MSG_WARN([--with-ctdb called without argument])
- ;;
- * )
- ctdbdir="$withval"
- ;;
- esac])
-
-#################################################
# set shared modules (internal lib) directory location
AC_ARG_WITH(modulesdir,
[AS_HELP_STRING([--with-modulesdir=DIR], [Where to put shared modules ($libdir)])],
@@ -297,7 +284,6 @@ AC_SUBST(lockdir)
AC_SUBST(piddir)
AC_SUBST(ncalrpcdir)
AC_SUBST(logfilebase)
-AC_SUBST(ctdbdir)
AC_SUBST(privatedir)
AC_SUBST(swatdir)
AC_SUBST(bindir)