[PATCHSET] cluster configure check improvements

Michael Adam obnox at samba.org
Tue Oct 30 10:15:56 MDT 2012


Hi,

attached find a patchset for review that improves our cluster (ctdb)
configure checks in Samba master (for waf and autoconf).

* the build against older (pre 1.2) ctdb versions is fixed
* the configure checks are fixed on system without libtalloc
  installed

These should go into master if found to be correct.

Cheers - Michael

PS:
* branch master-cluster-checks under git://git.samba.org/obnox/samba/samba-obnox.git
* gitweb: https://gitweb.samba.org/?p=obnox/samba/samba-obnox.git;a=log;h=refs/heads/master-cluster-checks

-------------- next part --------------
From 06f5bc51b19727248a04f86de54b48b42c32418b Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Tue, 30 Oct 2012 14:41:04 +0100
Subject: [PATCH 1/7] build(waf): fix a tab indentation to spaces

Signed-off-by: Michael Adam <obnox at samba.org>
---
 source3/wscript |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source3/wscript b/source3/wscript
index cc94053..9db03ec 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -1302,7 +1302,7 @@ main() {
         else:
             includes = ''
 
-	if not conf.env.USING_SYSTEM_TDB:
+        if not conf.env.USING_SYSTEM_TDB:
             includes = includes + ' ' + srcdir + '/lib/tdb/include'
 
         have_cluster_support = True
-- 
1.7.9.5


From 96b83b3617e76f21849c058fb371871ebd5f67f5 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Tue, 30 Oct 2012 14:43:42 +0100
Subject: [PATCH 2/7] build(waf): fix the cluster(ctdb) build without system
 talloc installed
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This is analogous to the earlier patch for tdb.
It temporarily adds the talloc include path to the
includes search list for the ctdb-header configure checks.

Signed-off-by: Michael Adam <obnox at samba.org>
Tested-by: Bj?rn Baumbach <bb at sernet.de>
---
 source3/wscript |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/source3/wscript b/source3/wscript
index 9db03ec..5cbfd35 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -1305,6 +1305,9 @@ main() {
         if not conf.env.USING_SYSTEM_TDB:
             includes = includes + ' ' + srcdir + '/lib/tdb/include'
 
+        if not conf.env.USING_SYSTEM_TALLOC:
+            includes = includes + ' ' + srcdir + '/lib/talloc'
+
         have_cluster_support = True
         ctdb_broken = ""
 
-- 
1.7.9.5


From 3cfa41445c4e17727b06624d4c89e0396e347011 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Baumbach?= <bb at sernet.de>
Date: Tue, 30 Oct 2012 13:40:48 +0100
Subject: [PATCH 3/7] build(autoconf): fix check for ctdb_private.h
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Bj?rn Baumbach <bb at sernet.de>
Reviewed-by: Michael Adam <obnox at samba.org>
---
 source3/configure.in |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source3/configure.in b/source3/configure.in
index fb00fee..327e55e 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -4989,7 +4989,7 @@ then
 fi
 
 if test "x$have_cluster_support" = "xyes" -a \
-	"x$ac_cv_header_ctdb_h" != "xyes"
+	"x$ac_cv_header_ctdb_private_h" != "xyes"
 then
 	have_cluster_support=no
 	ctdb_broken="ctdb_private.h is required for cluster support"
-- 
1.7.9.5


From 4d587a158c590bc8ba63ff32df9b0262412bdc87 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Baumbach?= <bb at sernet.de>
Date: Tue, 30 Oct 2012 13:26:24 +0100
Subject: [PATCH 4/7] build(autoconf): check if we have ctdb_protocol.h in the
 cluster checks
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Bj?rn Baumbach <bb at sernet.de>
Reviewed-by: Michael Adam <obnox at samba.org>
---
 source3/configure.in |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source3/configure.in b/source3/configure.in
index 327e55e..179d12d 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -4969,7 +4969,7 @@ ctdb_broken="no"
 SAVED_CPPFLAGS="$CPPFLAGS"
 CPPFLAGS="$CPPFLAGS ${SAMBA_CONFIGURE_CPPFLAGS} $CTDB_CPPFLAGS"
 
-AC_CHECK_HEADERS(ctdb.h ctdb_private.h,,,[
+AC_CHECK_HEADERS(ctdb.h ctdb_private.h ctdb_protocol.h ,,,[
 #include "confdefs.h"
 #define NO_CONFIG_H
 #include "replace.h"
-- 
1.7.9.5


From 27a708c17a494b33abf0d6eb38f1bfd6e204f21c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Baumbach?= <bb at sernet.de>
Date: Tue, 30 Oct 2012 13:59:41 +0100
Subject: [PATCH 5/7] build(waf): check if we have ctdb_protocol.h in the
 cluster checks
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Bj?rn Baumbach <bb at sernet.de>
Reviewed-by: Michael Adam <obnox at samba.org>
---
 source3/wscript |   22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/source3/wscript b/source3/wscript
index 5cbfd35..157a8c9 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -1367,6 +1367,28 @@ main() {
                 #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>
+                #include <ctdb_protocol.h>
+
+                int main(void)
+                {
+                    return 0;
+                }
+                ''',
+                'HAVE_CTDB_PROTOCOL_H',
+                addmain=False,
+                includes=includes,
+                msg='Checking for header ctdb_protocol.h')
+
+        if have_cluster_support:
+            conf.CHECK_CODE('''
+                #define NO_CONFIG_H
+                #include "replace.h"
+                #include "system/wait.h"
+                #include "system/network.h"
                 #include <talloc.h>
                 #include <tdb.h>
                 #include <ctdb.h>
-- 
1.7.9.5


From 893ed89905da9724123bf382d59128f998dfae5c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Baumbach?= <bb at sernet.de>
Date: Wed, 17 Oct 2012 16:54:33 +0200
Subject: [PATCH 6/7] s3:ctdb library: fix the build against older ctdb
 versions
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

by checking if we have the ctdb_protocol.h and including ctdb_private.h otherwise.

Signed-off-by: Bj?rn Baumbach <bb at sernet.de>
Reviewed-by: Michael Adam <obnox at samba.org>
---
 source3/lib/ctdb_conn.h |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/source3/lib/ctdb_conn.h b/source3/lib/ctdb_conn.h
index 9229536..0d648c7 100644
--- a/source3/lib/ctdb_conn.h
+++ b/source3/lib/ctdb_conn.h
@@ -23,7 +23,12 @@
 #ifdef CLUSTER_SUPPORT
 
 #include <tdb.h>
+
+#ifdef HAVE_CTDB_PROTOCOL_H
 #include <ctdb_protocol.h>
+#else
+#include <ctdb_private.h>
+#endif
 
 #else /* CLUSTER_SUPPORT */
 
-- 
1.7.9.5


From a65cd064b1122878481d7ff549ee3fdc092e8a67 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Baumbach?= <bb at sernet.de>
Date: Tue, 30 Oct 2012 16:45:30 +0100
Subject: [PATCH 7/7] s3-torture:test_ctdbconn: fix the build against older
 ctdb versions
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

by checking if we have the ctdb_protocol.h and including ctdb_private.h otherwise.

Signed-off-by: Bj?rn Baumbach <bb at sernet.de>
Reviewed-by: Michael Adam <obnox at samba.org>
---
 source3/torture/test_ctdbconn.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/source3/torture/test_ctdbconn.c b/source3/torture/test_ctdbconn.c
index 539e224..d018352 100644
--- a/source3/torture/test_ctdbconn.c
+++ b/source3/torture/test_ctdbconn.c
@@ -25,7 +25,13 @@
 #include "ctdb_conn.h"
 #include "lib/util/tevent_unix.h"
 #include "tdb.h"
+
+#ifdef HAVE_CTDB_PROTOCOL_H
 #include "ctdb_protocol.h"
+#else
+#include "ctdb_private.h"
+#endif
+
 #include "messages.h"
 
 struct ctdb_conn_test_state {
-- 
1.7.9.5

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 206 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20121030/6197aaa9/attachment.pgp>


More information about the samba-technical mailing list