s3:wscript: don't add ctdb include dir globally
authorStefan Metzmacher <metze@samba.org>
Tue, 8 Oct 2013 10:11:49 +0000 (12:11 +0200)
committerMichael Adam <obnox@samba.org>
Mon, 24 Mar 2014 16:09:10 +0000 (17:09 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
source3/wscript
source3/wscript_build

index 17cc17b835d1043206b3524a0f339687ed890292..c1fadef79f75c6301e734b60b3cccac242b422c3 100644 (file)
@@ -1438,8 +1438,9 @@ main() {
 
     else:
 
-        if Options.options.ctdb_dir:
-            conf.ADD_EXTRA_INCLUDES(Options.options.ctdb_dir + '/include')
+        have_cluster_support = True
+        ctdb_broken = ""
+        CTDB_CFLAGS = ""
 
         srcdir = os.path.realpath(conf.srcdir)
         if 'EXTRA_INCLUDES' in conf.env:
@@ -1447,15 +1448,16 @@ main() {
         else:
             includes = ''
 
+        if Options.options.ctdb_dir:
+            CTDB_CFLAGS = '-I' + Options.options.ctdb_dir + '/include'
+            includes = includes + ' ' + Options.options.ctdb_dir + '/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'
 
-        have_cluster_support = True
-        ctdb_broken = ""
-
         conf.CHECK_CODE('''
             #define NO_CONFIG_H
             #include "replace.h"
@@ -1691,6 +1693,7 @@ main() {
     if have_cluster_support:
         Logs.info("building with cluster support")
         conf.DEFINE('CLUSTER_SUPPORT', 1);
+        conf.env['CTDB_CFLAGS'] = CTDB_CFLAGS
     else:
         if Options.options.with_cluster_support == False:
             Logs.info("building without cluster support (--without-cluster-support)")
@@ -1699,6 +1702,7 @@ main() {
             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.undefine('CLUSTER_SUPPORT')
 
 
index ccded5fb0f211419f1150c6a735d0df42c552973..9fc33ceb1c5717472062d5aaff8e57eab79f9763 100755 (executable)
@@ -286,6 +286,7 @@ bld.SAMBA3_LIBRARY('samba-cluster-support',
                      tevent
                      tdb
                    ''',
+                   cflags=bld.CONFIG_GET("CTDB_CFLAGS"),
                    allow_undefined_symbols=True,
                    private_library=True)