diff options
author | Michael Adam <obnox@samba.org> | 2011-03-31 15:23:28 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2011-03-31 18:10:22 +0200 |
commit | e9e23cc948f88974c94b3221fc65be093197bcb2 (patch) | |
tree | 3b9af654ead1927392bf1a8a364958b6cd8ad44f | |
parent | a9b04e4a79b1c45a8b08a5fbdb18f818a1efa9f0 (diff) | |
download | samba-e9e23cc948f88974c94b3221fc65be093197bcb2.tar.gz samba-e9e23cc948f88974c94b3221fc65be093197bcb2.tar.xz samba-e9e23cc948f88974c94b3221fc65be093197bcb2.zip |
s3:configure: rework logic of ctdb/clustering checks
-rw-r--r-- | source3/configure.in | 190 |
1 files changed, 113 insertions, 77 deletions
diff --git a/source3/configure.in b/source3/configure.in index 5a7fe287d21..0b479dd465a 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -5399,9 +5399,20 @@ if test x"$samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT" = x"yes"; then fi AC_MSG_RESULT([$samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT]) + ################################################# # check for cluster extensions +AC_MSG_CHECKING(cluster support) +AC_ARG_WITH(cluster-support, +[AS_HELP_STRING([--with-cluster-support], [Enable cluster extensions (default=auto)])]) + +if test x"$with_cluster_support" = x ; then + with_cluster_support="auto" +fi + +AC_MSG_RESULT($with_cluster_support) + AC_ARG_WITH(ctdb, [AS_HELP_STRING([--with-ctdb=DIR], [Where to find ctdb sources])], [ case "$withval" in @@ -5413,9 +5424,15 @@ AC_ARG_WITH(ctdb, ;; esac]) +if test "$with_cluster_support" != "no" ; then + +AC_MSG_NOTICE(checking whether cluster support is available) + +have_cluster_support="yes" +ctdb_broken="no" + SAVED_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS ${SAMBA_CONFIGURE_CPPFLAGS} $CTDB_CPPFLAGS" -ctdb_broken="missing or broken headers" AC_CHECK_HEADERS(ctdb.h ctdb_private.h,,,[ #include "confdefs.h" @@ -5429,99 +5446,118 @@ AC_CHECK_HEADERS(ctdb.h ctdb_private.h,,,[ #include <ctdb.h> ]) -AC_HAVE_DECL(CTDB_CONTROL_TRANS3_COMMIT,[ -#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_TRANS3_COMMIT_decl" = x"yes"; then - ctdb_broken=no -else - ctdb_broken="ctdb transaction support missing or too old" +if test "x$have_cluster_support" = "xyes" -a \ + "x$ac_cv_header_ctdb_h" != "xyes" +then + have_cluster_support=no + ctdb_broken="ctdb.h is required for cluster support" fi -# In ctdb 1.0.57, ctdb_control_tcp was temporarily 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" +if test "x$have_cluster_support" = "xyes" -a \ + "x$ac_cv_header_ctdb_h" != "xyes" +then + have_cluster_support=no + ctdb_broken="ctdb_private.h is required for cluster support" +fi + + +if test "x$have_cluster_support" = "xyes" ; then + AC_HAVE_DECL(CTDB_CONTROL_TRANS3_COMMIT,[ + #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_TRANS3_COMMIT_decl" != x"yes"; then + ctdb_broken="ctdb transaction support missing or too old" + have_cluster_support=no + fi +fi -AC_MSG_CHECKING(cluster support) -AC_ARG_WITH(cluster-support, -[AS_HELP_STRING([--with-cluster-support], [Enable cluster extensions (default=auto)])]) +if test "x$have_cluster_support" = "xyes" ; then + # In ctdb 1.0.57, ctdb_control_tcp was temporarily 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> + ]) +fi -if test x"$with_cluster_support" = x ; then - with_cluster_support="auto" +if test "x$have_cluster_support" = "xyes" ; then + 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" + have_cluster_support=no + ],[ + #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> + ]) 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 +# test for optional ipv6 support in ctdb: +if test "x$have_cluster_support" = "xyes" ; then + 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> + ]) 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 +CPPFLAGS="$SAVED_CPPFLAGS" + +fi # (if test "$with_cluster_support" != "no") + +if test x"$have_cluster_support" = "xno" ; then + case "$with_cluster_support" in + yes) + AC_MSG_ERROR(["cluster support not available: $ctdb_broken"]) + ;; + auto) + AC_MSG_WARN(["cluster support not available: $ctdb_broken"]) + ;; + esac 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) + AC_MSG_NOTICE(Building with cluster support) else - AC_MSG_RESULT(no) + AC_MSG_NOTICE(Building without cluster support) fi + ################################################# # check for rtnetlink |