[SCM] Samba Shared Repository - branch v3-6-test updated

Michael Adam obnox at samba.org
Sat Apr 2 00:58:25 MDT 2011


The branch, v3-6-test has been updated
       via  ceea108 s3:waf: add cluster support / ctdb checks.
       via  06efe32 s3:waf:compare_config_h3.sh: make diff tool configurable as env var "DIFF"
       via  8742074 s3:waf:compare_config_h3.sh: specify autoconf-config.h as commandline parameter
      from  8421f04 Fix bug #8047 - mdns registration doesn't work if "interfaces" is used in smb.conf

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test


- Log -----------------------------------------------------------------
commit ceea108f6dd1dca0f14785c2178996cc26e1d644
Author: Michael Adam <obnox at samba.org>
Date:   Sat Apr 2 02:20:49 2011 +0200

    s3:waf: add cluster support / ctdb checks.
    
    The checks are roughtly taken from the autoconf ctdb checks.
    
    I was not able to implement checks with CHECK_DECL, CHECK_TYPE,
    CHECK_HEADER and friends, because the ctdb headers seem to need too
    special a setup of includes and defines in order to compile.
    So I used CHECK_CODE() in all checks.
    
    In the long run, this should be changed.
    
    I supported a --with-ctdb-dir options to allow for building
    against a ctdb that is not installed into /usr (e.g. against
    a local git checkout). In order to implement this, I had to
    hand includes in to the CHECK_CODE function.
    Here I found a problem with CHECK_CODE (or even the core waf
    conf.check() function: The CHECK_CODE function does not
    expand the includes it gets (i.e. '#' is not expanded to the
    base dir, and relative paths are left relative). But the core
    check() function seems to ignore all include paths that are
    not absolute paths. Hence in particular the usual default '# .'
    for the includes is useless. So I preprocessed the list of includes
    for the cluster checks. But I assume that it would be useful
    to move this expansion into CHECK_CODE or even into the core
    waf check function.
    
    Autobuild-User: Michael Adam <obnox at samba.org>
    Autobuild-Date: Sat Apr  2 03:26:55 CEST 2011 on sn-devel-104

commit 06efe32e441274574a4f00fff78832c50df9a236
Author: Michael Adam <obnox at samba.org>
Date:   Sat Apr 2 00:33:52 2011 +0200

    s3:waf:compare_config_h3.sh: make diff tool configurable as env var "DIFF"

commit 8742074eb23eea3001fbff894afa84a22373e048
Author: Michael Adam <obnox at samba.org>
Date:   Sat Apr 2 00:29:51 2011 +0200

    s3:waf:compare_config_h3.sh: specify autoconf-config.h as commandline parameter

-----------------------------------------------------------------------

Summary of changes:
 buildtools/compare_config_h3.sh |   15 ++-
 source3/wscript                 |  196 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 207 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/buildtools/compare_config_h3.sh b/buildtools/compare_config_h3.sh
index 0f640a9..294af30 100755
--- a/buildtools/compare_config_h3.sh
+++ b/buildtools/compare_config_h3.sh
@@ -3,10 +3,17 @@
 # compare the generated config.h from a waf build with existing samba
 # build
 
+OLD_CONFIG=$HOME/samba_old/source3/include/config.h
+if test "x$1" != "x" ; then
+	OLD_CONFIG=$1
+fi
+
+if test "x$DIFF" = "x" ; then
+	DIFF="comm -23"
+fi
+
 grep "^.define" bin/default/source3/include/config.h | sort > waf-config.h
-grep "^.define" $HOME/samba_old/source3/include/config.h | sort > old-config.h
+grep "^.define" $OLD_CONFIG | sort > old-config.h
 
-comm -23 old-config.h waf-config.h
+$DIFF old-config.h waf-config.h
 
-#echo
-#diff -u old-config.h waf-config.h
diff --git a/source3/wscript b/source3/wscript
index e8bd625..e6e0b5a 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -60,6 +60,16 @@ def set_options(opt):
     opt.SAMBA3_ADD_OPTION('automount')
     opt.SAMBA3_ADD_OPTION('aio-support')
 
+    opt.SAMBA3_ADD_OPTION('cluster-support')
+
+    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)
+
+
 
 def configure(conf):
     from samba_utils import TO_LIST
@@ -1496,6 +1506,192 @@ main() {
         # For sys/quota.h and linux/quota.h
         conf.CHECK_HEADERS('sys/quota.h')
 
+
+    #
+    # checking for clustering extensions (CTDB)
+    #
+    if not Options.options.with_cluster_support:
+        have_cluster_support = False
+
+    else:
+
+        if Options.options.ctdb_dir:
+            conf.ADD_EXTRA_INCLUDES(Options.options.ctdb_dir + '/include')
+
+        srcdir = os.path.realpath(conf.srcdir)
+        if 'EXTRA_INCLUDES' in conf.env:
+            includes = ' '.join(conf.env['EXTRA_INCLUDES']).replace('#', srcdir + '/')
+        else:
+            includes = ''
+
+        have_cluster_support = True
+        ctdb_broken = ""
+
+        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_H',
+            addmain=False,
+            includes=includes,
+            msg='Checking for header ctdb.h')
+
+        if not conf.CONFIG_SET('HAVE_CTDB_H'):
+            have_cluster_support = False
+            ctdb_broken = "ctdb.h is required for cluster support"
+
+        if have_cluster_support:
+            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_PRIVATE_H',
+                addmain=False,
+                includes=includes,
+                msg='Checking for header ctdb_private.h')
+
+            if not conf.CONFIG_SET('HAVE_CTDB_PRIVATE_H'):
+                have_cluster_support = False
+                ctdb_broken = "ctdb_private.h is required for cluster support"
+
+        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>
+                #include <ctdb_private.h>
+
+                int main(void)
+                {
+                   int i = (int)CTDB_CONTROL_TRANS3_COMMIT;
+                   return 0;
+                }
+                ''',
+                'HAVE_CTDB_CONTROL_TRANS3_COMMIT_DECL',
+                addmain=False,
+                includes=includes,
+                msg='Checking for transaction support (TRANS3_COMMIT control)')
+
+            if not conf.CONFIG_SET('HAVE_CTDB_CONTROL_TRANS3_COMMIT_DECL'):
+                have_cluster_support = False
+                ctdb_broken = "ctdb transaction support missing or too old"
+
+        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>
+                #include <ctdb_private.h>
+
+                int main(void)
+                {
+                    int i = (int)CTDB_CONTROL_SCHEDULE_FOR_DELETION;
+                    return 0;
+                }
+                ''',
+                'HAVE_CTDB_CONTROL_SCHEDULE_FOR_DELETION_DECL',
+                addmain=False,
+                includes=includes,
+                msg='Checking for SCHEDULE_FOR_DELETION control')
+
+            if not conf.CONFIG_SET('HAVE_CTDB_CONTROL_SCHEDULE_FOR_DELETION_DECL'):
+                if not Options.optinons.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)")
+
+        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>
+                #include <ctdb_private.h>
+
+                int main(void)
+                {
+                    struct ctdb_control_tcp _x;
+                    return 0;
+                }
+                ''',
+                'HAVE_STRUCT_CTDB_CONTROL_TCP',
+                addmain=False,
+                includes=includes,
+                msg='Checking for ctdb ipv4 support')
+
+            if not conf.CONFIG_SET('HAVE_STRUCT_CTDB_CONTROL_TCP'):
+                have_cluster_support = False
+                ctdb_broken = "missing struct ctdb_control_tcp"
+
+        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>
+                #include <ctdb_private.h>
+
+                int main(void)
+                {
+                    struct ctdb_control_tcp_addr _x;
+                    return 0;
+                }
+                ''',
+                'HAVE_STRUCT_CTDB_CONTROL_TCP_ADDR',
+                addmain=False,
+                includes=includes,
+                msg='Checking for ctdb ipv6 support')
+
+    if have_cluster_support:
+        Logs.info("building with cluster support")
+        conf.DEFINE('CLUSTER_SUPPORT', 1);
+    else:
+        if not Options.options.with_cluster_support:
+            Logs.info("building without cluster support")
+        else:
+            Logs.warn("building without cluster support: " + ctdb_broken)
+        conf.undefine('CLUSTER_SUPPORT')
+
+
+
     conf.CHECK_CODE('__attribute__((destructor)) static void cleanup(void) { }',
 		    'HAVE_FUNCTION_ATTRIBUTE_DESTRUCTOR',
 		    addmain=False,


-- 
Samba Shared Repository


More information about the samba-cvs mailing list