[PATCH] Remove ctdb feature checks from configure

Michael Adam obnox at samba.org
Mon Oct 27 07:35:02 MDT 2014


On 2014-10-27 at 15:33 +1100, Amitay Isaacs wrote:
> On Sat, Oct 25, 2014 at 2:58 AM, Michael Adam <obnox at samba.org> wrote:
> > On 2014-10-24 at 23:00 +1100, Amitay Isaacs wrote:
> > >
> > > Whether we build CTDB standalone or as a top level build,
> > > we are always going to build CTDB version that's bundled.
> > > We are NOT going to build smbd file server version >= 4.2
> > > with older ctdb versions.  So there is no need to check
> > > whether CTDB features are supported or not.  If we want to
> > > use some ctdb feature in smbd, then it better be there in
> > > ctdb.
> >
> > I looked over your patches, and I think they are mostly good.
> >
> > Question:
> > Is it certain that we are building against shipped ctdb
> > if also a ctdb is installed with headers in /usr/include ?
> >
> > I guess/hope so, since the CTDB_INCLUDE should be checked
> > before the standard include paths...
> >
> > Attached two additional patches by me to further
> > simplify and clean the checks.
> >
> > > I agree with Michael that I have missed the autobuild and I
> > > should make sure that the samba-ctdb target builds correctly.
> >
> > Attached is another patch to remove the separate ctdb build from
> > autobuild's samba-ctdb target.
> >
> > If tests go well and we agree on the general direction
> > we can push the patchset, but I'd like to do a few more tests.
> > Currently running an autobuild with my patches on top of yours.
> 
> Your patches look good.  Thanks for autobuild.py changes that I missed.

Ok, counting that as reviewed and since noone objected, I'd
propose to pushe this patchset to master next.

Attached find the updated patchest with review tags.
One additional patch on top to check that ctdbd has been
installed by the top level "make install". Just intended as
an intermediate smoke test until we get full integration
test up and running.

Cheers - Michael

-------------- next part --------------
From 7b52f3c6433e9a70ec1db962f096670f7831c6d3 Mon Sep 17 00:00:00 2001
From: Amitay Isaacs <amitay at gmail.com>
Date: Fri, 10 Oct 2014 10:59:06 +1100
Subject: [PATCH 01/11] build: Remove configure option --enable-old-ctdb

CTDB source is now part of Samba tree and to enable clustering smbd
should be built against included CTDB.

Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Michael Adam <obnox at samba.org>
---
 source3/wscript | 24 ++++++------------------
 1 file changed, 6 insertions(+), 18 deletions(-)

diff --git a/source3/wscript b/source3/wscript
index 2083f01..5ad2dbca 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -55,9 +55,6 @@ def set_options(opt):
     opt.add_option('--with-ctdb-dir',
                    help=("Directory under which ctdb is installed"),
                    action="store", dest='ctdb_dir', default=None)
-    opt.add_option('--enable-old-ctdb',
-                  help=("enable building against (too) old version of ctdb (default=false)"),
-                  action="store_true", dest='enable_old_ctdb', default=False)
 
     opt.add_option('--with-libcephfs',
                    help=("Directory under which libcephfs is installed"),
@@ -1629,11 +1626,8 @@ main() {
             if ok:
                 CTDB_CFLAGS += ' -DHAVE_CTDB_CONTROL_SCHEDULE_FOR_DELETION_DECL=1'
             else:
-                if not Options.options.enable_old_ctdb:
-                    have_cluster_support = False
-                    ctdb_broken = "SCHEDULE_FOR_DELETION control missing"
-                else:
-                    Logs.warn("ignoring missing SCHEDULE_FOR_DELETION control (--enable-old-ctdb)")
+                have_cluster_support = False
+                ctdb_broken = "SCHEDULE_FOR_DELETION control missing"
 
         conf.CONFIG_RESET('HAVE_CTDB_CHECK_CODE')
         if have_cluster_support:
@@ -1659,11 +1653,8 @@ main() {
             if ok:
                 CTDB_CFLAGS += ' -DHAVE_CTDB_WANT_READONLY_DECL=1'
             else:
-                if not Options.options.enable_old_ctdb:
-                    have_cluster_support = False
-                    ctdb_broken = "support for CTDB readonly records missing"
-                else:
-                    Logs.warn("ignoring missing READONLY support (--enable-old-ctdb)")
+                have_cluster_support = False
+                ctdb_broken = "support for CTDB readonly records missing"
 
         conf.CONFIG_RESET('HAVE_CTDB_CHECK_CODE')
         if have_cluster_support:
@@ -1743,11 +1734,8 @@ main() {
             if ok:
                 CTDB_CFLAGS += ' -DHAVE_CTDB_CONTROL_CHECK_SRVIDS_DECL=1'
             else:
-                if not Options.options.enable_old_ctdb:
-                    have_cluster_support = False
-                    ctdb_broken = "CHECK_SRVIDS control missing"
-                else:
-                    Logs.warn("ignoring missing CHECK_SRVIDS control (--enable-old-ctdb)")
+                have_cluster_support = False
+                ctdb_broken = "CHECK_SRVIDS control missing"
 
     conf.CONFIG_RESET('HAVE_CTDB_CHECK_CODE')
     conf.undefine('HAVE_CTDB_CHECK_CODE')
-- 
1.9.1


From 4506ef3f97490df2d2e74e1e01ac2cb918ad7c41 Mon Sep 17 00:00:00 2001
From: Amitay Isaacs <amitay at gmail.com>
Date: Fri, 10 Oct 2014 10:54:15 +1100
Subject: [PATCH 02/11] build: Remove checks for ctdb features

Since we are always building with integrated CTDB, there is no need for
these checks.

Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Michael Adam <obnox at samba.org>
---
 source3/lib/cluster_support.c    |  18 -----
 source3/lib/ctdbd_conn.c         |  16 ----
 source3/lib/dbwrap/dbwrap_ctdb.c |  11 ---
 source3/wscript                  | 164 ---------------------------------------
 4 files changed, 209 deletions(-)

diff --git a/source3/lib/cluster_support.c b/source3/lib/cluster_support.c
index d6605fd..e2aef7b 100644
--- a/source3/lib/cluster_support.c
+++ b/source3/lib/cluster_support.c
@@ -62,24 +62,6 @@ const char *cluster_support_features(void)
 #ifdef HAVE_CTDB_PROTOCOL_H
 	_LINE_DEF(HAVE_CTDB_PROTOCOL_H)
 #endif
-#ifdef HAVE_CTDB_CONTROL_TRANS3_COMMIT_DECL
-	_LINE_DEF(HAVE_CTDB_CONTROL_TRANS3_COMMIT_DECL)
-#endif
-#ifdef HAVE_CTDB_CONTROL_SCHEDULE_FOR_DELETION_DECL
-	_LINE_DEF(HAVE_CTDB_CONTROL_SCHEDULE_FOR_DELETION_DECL)
-#endif
-#ifdef HAVE_CTDB_WANT_READONLY_DECL
-	_LINE_DEF(HAVE_CTDB_WANT_READONLY_DECL)
-#endif
-#ifdef HAVE_STRUCT_CTDB_CONTROL_TCP
-	_LINE_DEF(HAVE_STRUCT_CTDB_CONTROL_TCP)
-#endif
-#ifdef HAVE_STRUCT_CTDB_CONTROL_TCP_ADDR
-	_LINE_DEF(HAVE_STRUCT_CTDB_CONTROL_TCP_ADDR)
-#endif
-#ifdef HAVE_CTDB_CONTROL_CHECK_SRVIDS_DECL
-	_LINE_DEF(HAVE_CTDB_CONTROL_CHECK_SRVIDS_DECL)
-#endif
 #ifdef CTDB_PATH
 	_LINE_STR(CTDB_PATH)
 #endif
diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c
index a667482..fe3e25a 100644
--- a/source3/lib/ctdbd_conn.c
+++ b/source3/lib/ctdbd_conn.c
@@ -1110,20 +1110,13 @@ fail:
 
 bool ctdb_serverids_exist_supported(struct ctdbd_connection *conn)
 {
-#ifndef HAVE_CTDB_CONTROL_CHECK_SRVIDS_DECL
-	return false;
-#else /* HAVE_CTDB_CONTROL_CHECK_SRVIDS_DECL */
 	return true;
-#endif /* HAVE_CTDB_CONTROL_CHECK_SRVIDS_DECL */
 }
 
 bool ctdb_serverids_exist(struct ctdbd_connection *conn,
 			  const struct server_id *pids, unsigned num_pids,
 			  bool *results)
 {
-#ifndef HAVE_CTDB_CONTROL_CHECK_SRVIDS_DECL
-	return false;
-#else /* HAVE_CTDB_CONTROL_CHECK_SRVIDS_DECL */
 	unsigned i, num_received;
 	NTSTATUS status;
 	struct ctdb_vnn_list *vnns = NULL;
@@ -1267,7 +1260,6 @@ bool ctdb_serverids_exist(struct ctdbd_connection *conn,
 fail:
 	cluster_fatal("serverids_exist failed");
 	return false;
-#endif /* HAVE_CTDB_CONTROL_CHECK_SRVIDS_DECL */
 }
 
 /*
@@ -1421,11 +1413,7 @@ NTSTATUS ctdbd_parse(struct ctdbd_connection *conn, uint32_t db_id,
 	NTSTATUS status;
 	uint32_t flags;
 
-#ifdef HAVE_CTDB_WANT_READONLY_DECL
 	flags = local_copy ? CTDB_WANT_READONLY : 0;
-#else
-	flags = 0;
-#endif
 
 	ZERO_STRUCT(req);
 
@@ -1633,9 +1621,7 @@ NTSTATUS ctdbd_register_ips(struct ctdbd_connection *conn,
 	 * versions at runtime
 	 */
 	struct ctdb_control_tcp p4;
-#ifdef HAVE_STRUCT_CTDB_CONTROL_TCP_ADDR
 	struct ctdb_control_tcp_addr p;
-#endif
 	TDB_DATA data;
 	NTSTATUS status;
 	struct sockaddr_storage client;
@@ -1656,14 +1642,12 @@ NTSTATUS ctdbd_register_ips(struct ctdbd_connection *conn,
 		data.dptr = (uint8_t *)&p4;
 		data.dsize = sizeof(p4);
 		break;
-#ifdef HAVE_STRUCT_CTDB_CONTROL_TCP_ADDR
 	case AF_INET6:
 		memcpy(&p.dest.ip6, &server, sizeof(p.dest.ip6));
 		memcpy(&p.src.ip6, &client, sizeof(p.src.ip6));
 		data.dptr = (uint8_t *)&p;
 		data.dsize = sizeof(p);
 		break;
-#endif
 	default:
 		return NT_STATUS_INTERNAL_ERROR;
 	}
diff --git a/source3/lib/dbwrap/dbwrap_ctdb.c b/source3/lib/dbwrap/dbwrap_ctdb.c
index 0b30d9f..2aee435 100644
--- a/source3/lib/dbwrap/dbwrap_ctdb.c
+++ b/source3/lib/dbwrap/dbwrap_ctdb.c
@@ -867,7 +867,6 @@ static NTSTATUS db_ctdb_store(struct db_record *rec, TDB_DATA data, int flag)
 
 
 
-#ifdef HAVE_CTDB_CONTROL_SCHEDULE_FOR_DELETION_DECL
 static NTSTATUS db_ctdb_send_schedule_for_deletion(struct db_record *rec)
 {
 	NTSTATUS status;
@@ -911,7 +910,6 @@ static NTSTATUS db_ctdb_send_schedule_for_deletion(struct db_record *rec)
 
 	return status;
 }
-#endif
 
 static NTSTATUS db_ctdb_delete(struct db_record *rec)
 {
@@ -927,10 +925,7 @@ static NTSTATUS db_ctdb_delete(struct db_record *rec)
 		return status;
 	}
 
-#ifdef HAVE_CTDB_CONTROL_SCHEDULE_FOR_DELETION_DECL
 	status = db_ctdb_send_schedule_for_deletion(rec);
-#endif
-
 	return status;
 }
 
@@ -999,7 +994,6 @@ static int db_ctdb_record_destr(struct db_record* data)
 static bool db_ctdb_can_use_local_hdr(const struct ctdb_ltdb_header *hdr,
 				      bool read_only)
 {
-#ifdef HAVE_CTDB_WANT_READONLY_DECL
 	if (hdr->dmaster != get_my_vnn()) {
 		/* If we're not dmaster, it must be r/o copy. */
 		return read_only && (hdr->flags & CTDB_REC_RO_HAVE_READONLY);
@@ -1009,9 +1003,6 @@ static bool db_ctdb_can_use_local_hdr(const struct ctdb_ltdb_header *hdr,
 	 * If we want write access, no one may have r/o copies.
 	 */
 	return read_only || !(hdr->flags & CTDB_REC_RO_HAVE_DELEGATIONS);
-#else
-	return (hdr->dmaster == get_my_vnn());
-#endif
 }
 
 static bool db_ctdb_can_use_local_copy(TDB_DATA ctdb_data, bool read_only)
@@ -1638,7 +1629,6 @@ struct db_context *db_open_ctdb(TALLOC_CTX *mem_ctx,
 		return NULL;
 	}
 
-#ifdef HAVE_CTDB_WANT_READONLY_DECL
 	if (!result->persistent &&
 	    (dbwrap_flags & DBWRAP_FLAG_OPTIMIZE_READONLY_ACCESS))
 	{
@@ -1657,7 +1647,6 @@ struct db_context *db_open_ctdb(TALLOC_CTX *mem_ctx,
 			return NULL;
 		}
 	}
-#endif
 
 	lp_ctx = loadparm_init_s3(db_path, loadparm_s3_helpers());
 
diff --git a/source3/wscript b/source3/wscript
index 5ad2dbca..0c3c994 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -1573,170 +1573,6 @@ main() {
             if ok:
                 CTDB_CFLAGS += ' -DHAVE_CTDB_PROTOCOL_H=1'
 
-        conf.CONFIG_RESET('HAVE_CTDB_CHECK_CODE')
-        if have_cluster_support:
-            ok = 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>
-                #include <ctdb_private.h>
-
-                int main(void)
-                {
-                   int i = (int)CTDB_CONTROL_TRANS3_COMMIT;
-                   return 0;
-                }
-                ''',
-                'HAVE_CTDB_CHECK_CODE',
-                addmain=False,
-                includes=includes,
-                msg='Checking for transaction support (TRANS3_COMMIT control)')
-            if ok:
-                CTDB_CFLAGS += ' -DHAVE_CTDB_CONTROL_TRANS3_COMMIT_DECL=1'
-            else:
-                have_cluster_support = False
-                ctdb_broken = "ctdb transaction support missing or too old"
-
-        conf.CONFIG_RESET('HAVE_CTDB_CHECK_CODE')
-        if have_cluster_support:
-            ok = 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>
-                #include <ctdb_private.h>
-
-                int main(void)
-                {
-                    int i = (int)CTDB_CONTROL_SCHEDULE_FOR_DELETION;
-                    return 0;
-                }
-                ''',
-                'HAVE_CTDB_CHECK_CODE',
-                addmain=False,
-                includes=includes,
-                msg='Checking for SCHEDULE_FOR_DELETION control')
-            if ok:
-                CTDB_CFLAGS += ' -DHAVE_CTDB_CONTROL_SCHEDULE_FOR_DELETION_DECL=1'
-            else:
-                have_cluster_support = False
-                ctdb_broken = "SCHEDULE_FOR_DELETION control missing"
-
-        conf.CONFIG_RESET('HAVE_CTDB_CHECK_CODE')
-        if have_cluster_support:
-            ok = 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>
-
-               int main(void)
-               {
-                   int i = (int)CTDB_WANT_READONLY;
-                   return 0;
-               }
-               ''',
-               'HAVE_CTDB_CHECK_CODE',
-               addmain=False,
-               includes=includes,
-               msg='Checking for CTDB readonly records support')
-            if ok:
-                CTDB_CFLAGS += ' -DHAVE_CTDB_WANT_READONLY_DECL=1'
-            else:
-                have_cluster_support = False
-                ctdb_broken = "support for CTDB readonly records missing"
-
-        conf.CONFIG_RESET('HAVE_CTDB_CHECK_CODE')
-        if have_cluster_support:
-            ok = 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>
-                #include <ctdb_private.h>
-
-                int main(void)
-                {
-                    struct ctdb_control_tcp _x;
-                    return 0;
-                }
-                ''',
-                'HAVE_CTDB_CHECK_CODE',
-                addmain=False,
-                includes=includes,
-                msg='Checking for ctdb ipv4 support')
-            if ok:
-                CTDB_CFLAGS += ' -DHAVE_STRUCT_CTDB_CONTROL_TCP=1'
-            else:
-                have_cluster_support = False
-                ctdb_broken = "missing struct ctdb_control_tcp"
-
-        conf.CONFIG_RESET('HAVE_CTDB_CHECK_CODE')
-        if have_cluster_support:
-            ok = 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>
-                #include <ctdb_private.h>
-
-                int main(void)
-                {
-                    struct ctdb_control_tcp_addr _x;
-                    return 0;
-                }
-                ''',
-                'HAVE_CTDB_CHECK_CODE',
-                addmain=False,
-                includes=includes,
-                msg='Checking for ctdb ipv6 support')
-            if ok:
-                CTDB_CFLAGS += ' -DHAVE_STRUCT_CTDB_CONTROL_TCP_ADDR=1'
-
-        conf.CONFIG_RESET('HAVE_CTDB_CHECK_CODE')
-        if have_cluster_support:
-            ok = 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>
-                #include <ctdb_private.h>
-
-                int main(void)
-                {
-                    int i = (int)CTDB_CONTROL_CHECK_SRVIDS;
-                    return 0;
-                }
-                ''',
-                'HAVE_CTDB_CHECK_CODE',
-                addmain=False,
-                includes=includes,
-                msg='Checking for CHECK_SRVIDS control')
-            if ok:
-                CTDB_CFLAGS += ' -DHAVE_CTDB_CONTROL_CHECK_SRVIDS_DECL=1'
-            else:
-                have_cluster_support = False
-                ctdb_broken = "CHECK_SRVIDS control missing"
-
     conf.CONFIG_RESET('HAVE_CTDB_CHECK_CODE')
     conf.undefine('HAVE_CTDB_CHECK_CODE')
     if have_cluster_support:
-- 
1.9.1


From eb824ef9d63e766c2de59d25eb237d47026b7847 Mon Sep 17 00:00:00 2001
From: Amitay Isaacs <amitay at gmail.com>
Date: Fri, 10 Oct 2014 11:42:05 +1100
Subject: [PATCH 03/11] build: Remove configure option --with-ctdb-dir

Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Michael Adam <obnox at samba.org>
---
 source3/wscript | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/source3/wscript b/source3/wscript
index 0c3c994..bac488c 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -52,10 +52,6 @@ def set_options(opt):
     opt.SAMBA3_ADD_OPTION('fake-kaserver',
                           help=("Include AFS fake-kaserver support"), default=False)
 
-    opt.add_option('--with-ctdb-dir',
-                   help=("Directory under which ctdb is installed"),
-                   action="store", dest='ctdb_dir', default=None)
-
     opt.add_option('--with-libcephfs',
                    help=("Directory under which libcephfs is installed"),
                    action="store", dest='libcephfs_dir', default=None)
@@ -1483,10 +1479,7 @@ main() {
         else:
             includes = ''
 
-        if Options.options.ctdb_dir:
-            CTDB_INCLUDE = Options.options.ctdb_dir + '/include'
-        else:
-            CTDB_INCLUDE = conf.srcdir + '/ctdb/include'
+        CTDB_INCLUDE = conf.srcdir + '/ctdb/include'
         includes = includes + ' ' + CTDB_INCLUDE
 
         if not conf.env.USING_SYSTEM_TDB:
-- 
1.9.1


From b6c50cb445c79c005c07d3d0237e9ffe9b3a1aaa Mon Sep 17 00:00:00 2001
From: Amitay Isaacs <amitay at gmail.com>
Date: Fri, 10 Oct 2014 12:02:26 +1100
Subject: [PATCH 04/11] ctdb: Rename ctdb socket variable from CTDB_PATH to
 CTDB_SOCKET

Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Michael Adam <obnox at samba.org>
---
 ctdb/client/ctdb_client.c     | 2 +-
 ctdb/include/ctdb_protocol.h  | 4 ++--
 ctdb/utils/pmda/pmda_ctdb.c   | 2 +-
 source3/lib/cluster_support.c | 4 ++--
 source3/lib/ctdbd_conn.c      | 2 +-
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/ctdb/client/ctdb_client.c b/ctdb/client/ctdb_client.c
index 7d629db..424937a 100644
--- a/ctdb/client/ctdb_client.c
+++ b/ctdb/client/ctdb_client.c
@@ -3375,7 +3375,7 @@ struct ctdb_context *ctdb_init(struct event_context *ev)
 	ctdb->lastid = INT_MAX-200;
 	CTDB_NO_MEMORY_NULL(ctdb, ctdb->idr);
 
-	ret = ctdb_set_socketname(ctdb, CTDB_PATH);
+	ret = ctdb_set_socketname(ctdb, CTDB_SOCKET);
 	if (ret != 0) {
 		DEBUG(DEBUG_ERR,(__location__ " ctdb_set_socketname failed.\n"));
 		talloc_free(ctdb);
diff --git a/ctdb/include/ctdb_protocol.h b/ctdb/include/ctdb_protocol.h
index 61d5735..72161af 100644
--- a/ctdb/include/ctdb_protocol.h
+++ b/ctdb/include/ctdb_protocol.h
@@ -22,9 +22,9 @@
 
 /* location of daemon socket, set at configure time */
 #ifdef SOCKPATH
-#define CTDB_PATH 	SOCKPATH
+#define CTDB_SOCKET 	SOCKPATH
 #else
-#define CTDB_PATH 	"/var/run/ctdb/ctdbd.socket"
+#define CTDB_SOCKET 	"/var/run/ctdb/ctdbd.socket"
 #endif
 
 /* default ctdb port number */
diff --git a/ctdb/utils/pmda/pmda_ctdb.c b/ctdb/utils/pmda/pmda_ctdb.c
index a686389..2beac8f 100644
--- a/ctdb/utils/pmda/pmda_ctdb.c
+++ b/ctdb/utils/pmda/pmda_ctdb.c
@@ -197,7 +197,7 @@ pmda_ctdb_daemon_connect(void)
 
 	socket_name = getenv("CTDB_SOCKET");
 	if (socket_name == NULL) {
-		socket_name = CTDB_PATH;
+		socket_name = CTDB_SOCKET;
 	}
 
 	ret = ctdb_set_socketname(ctdb, socket_name);
diff --git a/source3/lib/cluster_support.c b/source3/lib/cluster_support.c
index e2aef7b..afe2260 100644
--- a/source3/lib/cluster_support.c
+++ b/source3/lib/cluster_support.c
@@ -62,8 +62,8 @@ const char *cluster_support_features(void)
 #ifdef HAVE_CTDB_PROTOCOL_H
 	_LINE_DEF(HAVE_CTDB_PROTOCOL_H)
 #endif
-#ifdef CTDB_PATH
-	_LINE_STR(CTDB_PATH)
+#ifdef CTDB_SOCKET
+	_LINE_STR(CTDB_SOCKET)
 #endif
 #ifdef CTDB_VERSION
 	_LINE_INT(CTDB_VERSION)
diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c
index fe3e25a..5044ddf 100644
--- a/source3/lib/ctdbd_conn.c
+++ b/source3/lib/ctdbd_conn.c
@@ -201,7 +201,7 @@ const char *lp_ctdbd_socket(void)
 		return ret;
 	}
 
-	return CTDB_PATH;
+	return CTDB_SOCKET;
 }
 
 /*
-- 
1.9.1


From c991b79718aed7858f88d413b432837332bf6391 Mon Sep 17 00:00:00 2001
From: Amitay Isaacs <amitay at gmail.com>
Date: Fri, 10 Oct 2014 14:25:34 +1100
Subject: [PATCH 05/11] build: Remove configure checks for ctdb headers

Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Michael Adam <obnox at samba.org>
---
 source3/lib/cluster_support.c   | 18 +--------
 source3/lib/ctdb_conn.c         |  4 --
 source3/torture/test_ctdbconn.c |  4 --
 source3/wscript                 | 82 +----------------------------------------
 4 files changed, 2 insertions(+), 106 deletions(-)

diff --git a/source3/lib/cluster_support.c b/source3/lib/cluster_support.c
index afe2260..6a5f91d 100644
--- a/source3/lib/cluster_support.c
+++ b/source3/lib/cluster_support.c
@@ -20,18 +20,11 @@
 #include <tdb.h>
 #include "cluster_support.h"
 
-#ifdef HAVE_CTDB_H
+#ifdef CLUSTER_SUPPORT
 #include <ctdb.h>
-#define CLUSTER_SUPPORT 1
-#endif
-
-#ifdef HAVE_CTDB_PROTOCOL_H
 #include <ctdb_protocol.h>
-#else
-#ifdef HAVE_CTDB_PRIVATE_H
 #include <ctdb_private.h>
 #endif
-#endif
 
 bool cluster_support_available(void)
 {
@@ -53,15 +46,6 @@ const char *cluster_support_features(void)
 #else
 	"   NONE\n"
 #endif
-#ifdef HAVE_CTDB_H
-	_LINE_DEF(HAVE_CTDB_H)
-#endif
-#ifdef HAVE_CTDB_PRIVATE_H
-	_LINE_DEF(HAVE_CTDB_PRIVATE_H)
-#endif
-#ifdef HAVE_CTDB_PROTOCOL_H
-	_LINE_DEF(HAVE_CTDB_PROTOCOL_H)
-#endif
 #ifdef CTDB_SOCKET
 	_LINE_STR(CTDB_SOCKET)
 #endif
diff --git a/source3/lib/ctdb_conn.c b/source3/lib/ctdb_conn.c
index 0996511..1bba8e7 100644
--- a/source3/lib/ctdb_conn.c
+++ b/source3/lib/ctdb_conn.c
@@ -23,11 +23,7 @@
 
 #include <tdb.h>
 
-#ifdef HAVE_CTDB_PROTOCOL_H
 #include <ctdb_protocol.h>
-#else
-#include <ctdb_private.h>
-#endif
 
 #include "lib/async_req/async_sock.h"
 
diff --git a/source3/torture/test_ctdbconn.c b/source3/torture/test_ctdbconn.c
index ff45a02..1f80cff 100644
--- a/source3/torture/test_ctdbconn.c
+++ b/source3/torture/test_ctdbconn.c
@@ -25,11 +25,7 @@
 #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"
 
diff --git a/source3/wscript b/source3/wscript
index bac488c..01c9c35 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -1488,89 +1488,9 @@ main() {
         if not conf.env.USING_SYSTEM_TALLOC:
             includes = includes + ' ' + srcdir + '/lib/talloc'
 
-        ok = conf.CHECK_CODE('''
-            #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>
-
-            int main(void)
-            {
-                return 0;
-            }
-            ''',
-            'HAVE_CTDB_CHECK_CODE',
-            addmain=False,
-            includes=includes,
-            msg='Checking for header ctdb.h')
-        if ok:
-            CTDB_CFLAGS += ' -DHAVE_CTDB_H=1'
-        else:
-            have_cluster_support = False
-            ctdb_broken = "ctdb.h is required for cluster support"
-
-        conf.CONFIG_RESET('HAVE_CTDB_CHECK_CODE')
-        if have_cluster_support:
-            ok = conf.CHECK_CODE('''
-                #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>
-                #include <ctdb_private.h>
-
-                int main(void)
-                {
-                    return 0;
-                }
-                ''',
-                'HAVE_CTDB_CHECK_CODE',
-                addmain=False,
-                includes=includes,
-                msg='Checking for header ctdb_private.h')
-            if ok:
-                CTDB_CFLAGS += ' -DHAVE_CTDB_PRIVATE_H=1'
-            else:
-                have_cluster_support = False
-                ctdb_broken = "ctdb_private.h is required for cluster support"
-
-        conf.CONFIG_RESET('HAVE_CTDB_CHECK_CODE')
-        if have_cluster_support:
-            ok = conf.CHECK_CODE('''
-                #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>
-                #include <ctdb_protocol.h>
-
-                int main(void)
-                {
-                    return 0;
-                }
-                ''',
-                'HAVE_CTDB_CHECK_CODE',
-                addmain=False,
-                includes=includes,
-                msg='Checking for header ctdb_protocol.h')
-            if ok:
-                CTDB_CFLAGS += ' -DHAVE_CTDB_PROTOCOL_H=1'
-
-    conf.CONFIG_RESET('HAVE_CTDB_CHECK_CODE')
-    conf.undefine('HAVE_CTDB_CHECK_CODE')
     if have_cluster_support:
         Logs.info("building with cluster support")
-        conf.env['CTDB_CFLAGS'] = CTDB_CFLAGS
+        conf.env['CTDB_CFLAGS'] = '-DCLUSTER_SUPPORT=1'
         conf.env['CTDB_INCLUDE'] = CTDB_INCLUDE
     else:
         if Options.options.with_cluster_support == False:
-- 
1.9.1


From 39c5c590157f476dab584751c69b8c2b2157be55 Mon Sep 17 00:00:00 2001
From: Amitay Isaacs <amitay at gmail.com>
Date: Fri, 10 Oct 2014 14:29:51 +1100
Subject: [PATCH 06/11] build: Simplify check for building with ctdb

Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Michael Adam <obnox at samba.org>
---
 source3/wscript | 25 +++++--------------------
 wscript         |  3 +--
 2 files changed, 6 insertions(+), 22 deletions(-)

diff --git a/source3/wscript b/source3/wscript
index 01c9c35..191e96b 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -1460,19 +1460,14 @@ main() {
             conf.DEFINE('WITH_QUOTAS', '1')
 
     #
-    # checking for clustering extensions (CTDB)
+    # checking for clustering (CTDB)
     #
-    if Options.options.with_cluster_support == False:
+    if not Options.options.with_cluster_support:
         # configure is called with --without-cluster-support,
         # so don't check for and build w/o ctdb support.
-        have_cluster_support = False
-
+        Logs.info("building without cluster support (--without-cluster-support)")
+        conf.env.with_ctdb = False
     else:
-
-        have_cluster_support = True
-        ctdb_broken = ""
-        CTDB_CFLAGS = ""
-
         srcdir = os.path.realpath(conf.srcdir)
         if 'EXTRA_INCLUDES' in conf.env:
             includes = ' '.join(conf.env['EXTRA_INCLUDES']).replace('#', srcdir + '/')
@@ -1488,20 +1483,10 @@ main() {
         if not conf.env.USING_SYSTEM_TALLOC:
             includes = includes + ' ' + srcdir + '/lib/talloc'
 
-    if have_cluster_support:
         Logs.info("building with cluster support")
         conf.env['CTDB_CFLAGS'] = '-DCLUSTER_SUPPORT=1'
         conf.env['CTDB_INCLUDE'] = CTDB_INCLUDE
-    else:
-        if Options.options.with_cluster_support == False:
-            Logs.info("building without cluster support (--without-cluster-support)")
-        elif Options.options.with_cluster_support == True:
-            Logs.error("Cluster support not available: " + ctdb_broken)
-            conf.fatal("Cluster support not found, but --with-cluster-support was specified")
-        else:
-            Logs.info("building without cluster support: " + ctdb_broken)
-        conf.env['CTDB_CFLAGS'] = ''
-
+        conf.env.with_ctdb = True
 
     conf.CHECK_CODE('__attribute__((destructor)) static void cleanup(void) { }',
                     'HAVE_FUNCTION_ATTRIBUTE_DESTRUCTOR',
diff --git a/wscript b/wscript
index ee0b7ee..37a1f10 100644
--- a/wscript
+++ b/wscript
@@ -167,8 +167,7 @@ def configure(conf):
     conf.RECURSE('selftest')
     conf.RECURSE('source3')
     conf.RECURSE('lib/texpect')
-    if Options.options.with_cluster_support:
-        conf.env.with_ctdb = True
+    if conf.env.with_ctdb:
         conf.RECURSE('ctdb')
 
     conf.SAMBA_CHECK_UNDEFINED_SYMBOL_FLAGS()
-- 
1.9.1


From e38563c3900d7b9c8e85ff42f7c64ec9be9cc180 Mon Sep 17 00:00:00 2001
From: Amitay Isaacs <amitay at gmail.com>
Date: Tue, 21 Oct 2014 11:53:29 +1100
Subject: [PATCH 07/11] ctdb: Rename CTDB_VERSION to CTDB_PROTOCOL

CTDB_VERSION really is the ctdb protocol version.

Signed-off-by: Amitay Isaacs <amitay at gmail.com>
Reviewed-by: Michael Adam <obnox at samba.org>
---
 ctdb/client/ctdb_client.c     |  4 ++--
 ctdb/include/ctdb_protocol.h  |  2 +-
 ctdb/server/ctdb_daemon.c     |  6 +++---
 ctdb/tcp/tcp_io.c             |  2 +-
 ctdb/tools/ctdb.c             |  4 ++--
 source3/lib/cluster_support.c |  6 ++----
 source3/lib/ctdb_conn.c       |  4 ++--
 source3/lib/ctdbd_conn.c      | 12 ++++++------
 8 files changed, 19 insertions(+), 21 deletions(-)

diff --git a/ctdb/client/ctdb_client.c b/ctdb/client/ctdb_client.c
index 424937a..07b17d0 100644
--- a/ctdb/client/ctdb_client.c
+++ b/ctdb/client/ctdb_client.c
@@ -54,7 +54,7 @@ struct ctdb_req_header *_ctdbd_allocate_pkt(struct ctdb_context *ctdb,
 	hdr->length       = length;
 	hdr->operation    = operation;
 	hdr->ctdb_magic   = CTDB_MAGIC;
-	hdr->ctdb_version = CTDB_VERSION;
+	hdr->ctdb_version = CTDB_PROTOCOL;
 	hdr->srcnode      = ctdb->pnn;
 	if (ctdb->vnn_map) {
 		hdr->generation = ctdb->vnn_map->generation;
@@ -216,7 +216,7 @@ void ctdb_client_read_cb(uint8_t *data, size_t cnt, void *args)
 		goto done;
 	}
 
-	if (hdr->ctdb_version != CTDB_VERSION) {
+	if (hdr->ctdb_version != CTDB_PROTOCOL) {
 		ctdb_set_error(ctdb, "Bad CTDB version 0x%x rejected in client\n", hdr->ctdb_version);
 		goto done;
 	}
diff --git a/ctdb/include/ctdb_protocol.h b/ctdb/include/ctdb_protocol.h
index 72161af..725e426 100644
--- a/ctdb/include/ctdb_protocol.h
+++ b/ctdb/include/ctdb_protocol.h
@@ -272,7 +272,7 @@ enum ctdb_operation {
 };
 
 #define CTDB_MAGIC 0x43544442 /* CTDB */
-#define CTDB_VERSION 1
+#define CTDB_PROTOCOL 1
 
 enum ctdb_controls {CTDB_CONTROL_PROCESS_EXISTS          = 0,
 		    CTDB_CONTROL_STATISTICS              = 1,
diff --git a/ctdb/server/ctdb_daemon.c b/ctdb/server/ctdb_daemon.c
index 65b7109..b21e123 100644
--- a/ctdb/server/ctdb_daemon.c
+++ b/ctdb/server/ctdb_daemon.c
@@ -814,7 +814,7 @@ static void daemon_incoming_packet(void *p, struct ctdb_req_header *hdr)
 		goto done;
 	}
 
-	if (hdr->ctdb_version != CTDB_VERSION) {
+	if (hdr->ctdb_version != CTDB_PROTOCOL) {
 		ctdb_set_error(client->ctdb, "Bad CTDB version 0x%x rejected in daemon\n", hdr->ctdb_version);
 		goto done;
 	}
@@ -876,7 +876,7 @@ static void ctdb_daemon_read_cb(uint8_t *data, size_t cnt, void *args)
 		return;
 	}
 
-	if (hdr->ctdb_version != CTDB_VERSION) {
+	if (hdr->ctdb_version != CTDB_PROTOCOL) {
 		ctdb_set_error(client->ctdb, "Bad CTDB version 0x%x rejected in daemon\n", hdr->ctdb_version);
 		return;
 	}
@@ -1360,7 +1360,7 @@ struct ctdb_req_header *_ctdb_transport_allocate(struct ctdb_context *ctdb,
 	hdr->length       = length;
 	hdr->operation    = operation;
 	hdr->ctdb_magic   = CTDB_MAGIC;
-	hdr->ctdb_version = CTDB_VERSION;
+	hdr->ctdb_version = CTDB_PROTOCOL;
 	hdr->generation   = ctdb->vnn_map->generation;
 	hdr->srcnode      = ctdb->pnn;
 
diff --git a/ctdb/tcp/tcp_io.c b/ctdb/tcp/tcp_io.c
index 5111195..a951320 100644
--- a/ctdb/tcp/tcp_io.c
+++ b/ctdb/tcp/tcp_io.c
@@ -63,7 +63,7 @@ void ctdb_tcp_read_cb(uint8_t *data, size_t cnt, void *args)
 		goto failed;
 	}
 
-	if (hdr->ctdb_version != CTDB_VERSION) {
+	if (hdr->ctdb_version != CTDB_PROTOCOL) {
 		DEBUG(DEBUG_ALERT, (__location__ " Bad CTDB version 0x%x rejected\n", 
 			  hdr->ctdb_version));
 		goto failed;
diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c
index c34e33d..8faeb43 100644
--- a/ctdb/tools/ctdb.c
+++ b/ctdb/tools/ctdb.c
@@ -484,7 +484,7 @@ static void show_statistics(struct ctdb_statistics *s, int show_header)
 			printf("max_childwrite_latency:");
 			printf("\n");
 		}
-		printf("%d:", CTDB_VERSION);
+		printf("%d:", CTDB_PROTOCOL);
 		printf("%d:", (int)s->statistics_current_time.tv_sec);
 		printf("%d:", (int)s->statistics_start_time.tv_sec);
 		for (i=0;i<ARRAY_SIZE(fields);i++) {
@@ -511,7 +511,7 @@ static void show_statistics(struct ctdb_statistics *s, int show_header)
 		printf("%.6f:", s->childwrite_latency.max);
 		printf("\n");
 	} else {
-		printf("CTDB version %u\n", CTDB_VERSION);
+		printf("CTDB version %u\n", CTDB_PROTOCOL);
 		printf("Current time of statistics  :                %s", ctime(&s->statistics_current_time.tv_sec));
 		printf("Statistics collected since  : (%03d %02d:%02d:%02d) %s", days, hours, minutes, seconds, ctime(&s->statistics_start_time.tv_sec));
 
diff --git a/source3/lib/cluster_support.c b/source3/lib/cluster_support.c
index 6a5f91d..b8925aa 100644
--- a/source3/lib/cluster_support.c
+++ b/source3/lib/cluster_support.c
@@ -21,9 +21,7 @@
 #include "cluster_support.h"
 
 #ifdef CLUSTER_SUPPORT
-#include <ctdb.h>
 #include <ctdb_protocol.h>
-#include <ctdb_private.h>
 #endif
 
 bool cluster_support_available(void)
@@ -49,8 +47,8 @@ const char *cluster_support_features(void)
 #ifdef CTDB_SOCKET
 	_LINE_STR(CTDB_SOCKET)
 #endif
-#ifdef CTDB_VERSION
-	_LINE_INT(CTDB_VERSION)
+#ifdef CTDB_PROTOCOL
+	_LINE_INT(CTDB_PROTOCOL)
 #endif
 	"";
 
diff --git a/source3/lib/ctdb_conn.c b/source3/lib/ctdb_conn.c
index 1bba8e7..c705c21 100644
--- a/source3/lib/ctdb_conn.c
+++ b/source3/lib/ctdb_conn.c
@@ -179,7 +179,7 @@ struct tevent_req *ctdb_conn_control_send(TALLOC_CTX *mem_ctx,
 	hdr = &state->req.hdr;
 	hdr->length = offsetof(struct ctdb_req_control, data) + datalen;
 	hdr->ctdb_magic    = CTDB_MAGIC;
-	hdr->ctdb_version  = CTDB_VERSION;
+	hdr->ctdb_version  = CTDB_PROTOCOL;
 	hdr->operation     = CTDB_REQ_CONTROL;
 	hdr->reqid         = 1; /* FIXME */
 	hdr->destnode      = vnn;
@@ -306,7 +306,7 @@ struct tevent_req *ctdb_conn_msg_write_send(TALLOC_CTX *mem_ctx,
 
 	h->length = offsetof(struct ctdb_req_message, data) + msg_len;
 	h->ctdb_magic = CTDB_MAGIC;
-	h->ctdb_version = CTDB_VERSION;
+	h->ctdb_version = CTDB_PROTOCOL;
 	h->generation = 1;
 	h->operation  = CTDB_REQ_MESSAGE;
 	h->destnode   = vnn;
diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c
index 5044ddf..a26f410 100644
--- a/source3/lib/ctdbd_conn.c
+++ b/source3/lib/ctdbd_conn.c
@@ -767,7 +767,7 @@ NTSTATUS ctdbd_messaging_send_blob(struct ctdbd_connection *conn,
 
 	r.hdr.length = offsetof(struct ctdb_req_message, data) + buflen;
 	r.hdr.ctdb_magic = CTDB_MAGIC;
-	r.hdr.ctdb_version = CTDB_VERSION;
+	r.hdr.ctdb_version = CTDB_PROTOCOL;
 	r.hdr.generation = 1;
 	r.hdr.operation  = CTDB_REQ_MESSAGE;
 	r.hdr.destnode   = dst_vnn;
@@ -826,7 +826,7 @@ static NTSTATUS ctdbd_control(struct ctdbd_connection *conn,
 	ZERO_STRUCT(req);
 	req.hdr.length = offsetof(struct ctdb_req_control, data) + data.dsize;
 	req.hdr.ctdb_magic   = CTDB_MAGIC;
-	req.hdr.ctdb_version = CTDB_VERSION;
+	req.hdr.ctdb_version = CTDB_PROTOCOL;
 	req.hdr.operation    = CTDB_REQ_CONTROL;
 	req.hdr.reqid        = ctdbd_next_reqid(conn);
 	req.hdr.destnode     = vnn;
@@ -947,7 +947,7 @@ bool ctdb_processes_exist(struct ctdbd_connection *conn,
 		req.hdr.length = offsetof(struct ctdb_req_control, data);
 		req.hdr.length += sizeof(pid);
 		req.hdr.ctdb_magic   = CTDB_MAGIC;
-		req.hdr.ctdb_version = CTDB_VERSION;
+		req.hdr.ctdb_version = CTDB_PROTOCOL;
 		req.hdr.operation    = CTDB_REQ_CONTROL;
 		req.hdr.reqid        = reqids[i];
 		req.hdr.destnode     = pids[i].vnn;
@@ -1143,7 +1143,7 @@ bool ctdb_serverids_exist(struct ctdbd_connection *conn,
 
 		req.hdr.length = offsetof(struct ctdb_req_control, data);
 		req.hdr.ctdb_magic   = CTDB_MAGIC;
-		req.hdr.ctdb_version = CTDB_VERSION;
+		req.hdr.ctdb_version = CTDB_PROTOCOL;
 		req.hdr.operation    = CTDB_REQ_CONTROL;
 		req.hdr.reqid        = vnn->reqid;
 		req.hdr.destnode     = vnn->vnn;
@@ -1354,7 +1354,7 @@ NTSTATUS ctdbd_migrate(struct ctdbd_connection *conn, uint32_t db_id,
 
 	req.hdr.length = offsetof(struct ctdb_req_call, data) + key.dsize;
 	req.hdr.ctdb_magic   = CTDB_MAGIC;
-	req.hdr.ctdb_version = CTDB_VERSION;
+	req.hdr.ctdb_version = CTDB_PROTOCOL;
 	req.hdr.operation    = CTDB_REQ_CALL;
 	req.hdr.reqid        = ctdbd_next_reqid(conn);
 	req.flags            = CTDB_IMMEDIATE_MIGRATION;
@@ -1419,7 +1419,7 @@ NTSTATUS ctdbd_parse(struct ctdbd_connection *conn, uint32_t db_id,
 
 	req.hdr.length = offsetof(struct ctdb_req_call, data) + key.dsize;
 	req.hdr.ctdb_magic   = CTDB_MAGIC;
-	req.hdr.ctdb_version = CTDB_VERSION;
+	req.hdr.ctdb_version = CTDB_PROTOCOL;
 	req.hdr.operation    = CTDB_REQ_CALL;
 	req.hdr.reqid        = ctdbd_next_reqid(conn);
 	req.flags            = flags;
-- 
1.9.1


From fbf1132c7e9dff2f4e1a26d7c4956ca78d522c29 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Fri, 24 Oct 2014 17:42:51 +0200
Subject: [PATCH 08/11] autobuild: adapt samba-ctdb target does not need a
 separate ctdb build any more

Signed-off-by: Michael Adam <obnox at samba.org>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
---
 script/autobuild.py | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/script/autobuild.py b/script/autobuild.py
index c5d3cad..d62538e 100755
--- a/script/autobuild.py
+++ b/script/autobuild.py
@@ -58,14 +58,9 @@ tasks = {
                      ("tdb-make", "cd lib/tdb && make", "text/plain"),
                      ("tdb-install", "cd lib/tdb && make install", "text/plain"),
 
-                     # build and install ctdb:
-                     ("ctdb-configure", "cd ./ctdb && PKG_CONFIG_PATH=${PREFIX_DIR}/lib/pkgconfig:${PKG_CONFIG_PATH} ./configure ${PREFIX} --bundled-libraries=!tdb", "text/plain"),
-                     ("ctdb-make", "cd ./ctdb && make all", "text/plain"),
-                     ("ctdb-install", "cd ./ctdb && make install", "text/plain"),
-                     ("ctdb-header-ls", "ls ${PREFIX_DIR}/include/ctdb.h", "text/plain"),
 
                      # build samba with cluster support against this ctdb:
-                     ("samba-configure", "PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=${PREFIX_DIR}/lib/pkgconfig:${PKG_CONFIG_PATH} ./configure.developer ${PREFIX} --with-selftest-prefix=./bin/ab --with-cluster-support --with-ctdb-dir=${PREFIX_DIR} --bundled-libraries=!tdb", "text/plain"),
+                     ("samba-configure", "PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=${PREFIX_DIR}/lib/pkgconfig:${PKG_CONFIG_PATH} ./configure.developer ${PREFIX} --with-selftest-prefix=./bin/ab --with-cluster-support --bundled-libraries=!tdb", "text/plain"),
                      ("samba-make", "make", "text/plain"),
                      ("samba-check", "./bin/smbd -b | grep CLUSTER_SUPPORT", "text/plain"),
                      ("samba-install", "make install", "text/plain"),
-- 
1.9.1


From e76ee4dfd881c355d256e9c4359c08b13ac9897b Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Fri, 24 Oct 2014 17:53:08 +0200
Subject: [PATCH 09/11] build: further simplify --with-cluster-support case in
 configure

includes were only built for the ctdb checks and they are now
gone because we are building against included ctdb.

Signed-off-by: Michael Adam <obnox at samba.org>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
---
 source3/wscript | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)

diff --git a/source3/wscript b/source3/wscript
index 191e96b..b8877a1 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -1468,24 +1468,9 @@ main() {
         Logs.info("building without cluster support (--without-cluster-support)")
         conf.env.with_ctdb = False
     else:
-        srcdir = os.path.realpath(conf.srcdir)
-        if 'EXTRA_INCLUDES' in conf.env:
-            includes = ' '.join(conf.env['EXTRA_INCLUDES']).replace('#', srcdir + '/')
-        else:
-            includes = ''
-
-        CTDB_INCLUDE = conf.srcdir + '/ctdb/include'
-        includes = includes + ' ' + CTDB_INCLUDE
-
-        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'
-
         Logs.info("building with cluster support")
         conf.env['CTDB_CFLAGS'] = '-DCLUSTER_SUPPORT=1'
-        conf.env['CTDB_INCLUDE'] = CTDB_INCLUDE
+        conf.env['CTDB_INCLUDE'] = conf.srcdir + '/ctdb/include'
         conf.env.with_ctdb = True
 
     conf.CHECK_CODE('__attribute__((destructor)) static void cleanup(void) { }',
-- 
1.9.1


From b6d85d29ce356338a40b800f60502f4f50e99899 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Fri, 24 Oct 2014 17:55:17 +0200
Subject: [PATCH 10/11] build: adapt comments for the clustering choice

Signed-off-by: Michael Adam <obnox at samba.org>
Reviewed-by: Amitay Isaacs <amitay at gmail.com>
---
 source3/wscript | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/source3/wscript b/source3/wscript
index b8877a1..ba1125e 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -1460,11 +1460,9 @@ main() {
             conf.DEFINE('WITH_QUOTAS', '1')
 
     #
-    # checking for clustering (CTDB)
+    # cluster support (CTDB)
     #
     if not Options.options.with_cluster_support:
-        # configure is called with --without-cluster-support,
-        # so don't check for and build w/o ctdb support.
         Logs.info("building without cluster support (--without-cluster-support)")
         conf.env.with_ctdb = False
     else:
-- 
1.9.1


From 21baa35e3b4602889a52a3b664761f2c0fc2181a Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Sat, 25 Oct 2014 18:01:30 +0200
Subject: [PATCH 11/11] autobuild: check whether ctdbd has been installed in
 the samba-ctdb target

An intermediate test until we have full runtime-tests.

Signed-off-by: Michael Adam <obnox at samba.org>
---
 script/autobuild.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/script/autobuild.py b/script/autobuild.py
index d62538e..2b25a10 100755
--- a/script/autobuild.py
+++ b/script/autobuild.py
@@ -64,6 +64,7 @@ tasks = {
                      ("samba-make", "make", "text/plain"),
                      ("samba-check", "./bin/smbd -b | grep CLUSTER_SUPPORT", "text/plain"),
                      ("samba-install", "make install", "text/plain"),
+                     ("ctdb-check", "test -e ${PREFIX_DIR}/sbin/ctdbd", "text/plain"),
 
                      # clean up:
                      ("check-clean-tree", "script/clean-source-tree.sh", "text/plain"),
-- 
1.9.1

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20141027/1555892f/attachment.pgp>


More information about the samba-technical mailing list