From 6c007951bb5ada8cc3a2eabdc40568fa84da2831 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 8 Oct 2013 12:11:49 +0200 Subject: [PATCH] s3:wscript: don't add ctdb include dir globally Signed-off-by: Stefan Metzmacher Reviewed-by: Michael Adam --- source3/wscript | 14 +++++++++----- source3/wscript_build | 1 + 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/source3/wscript b/source3/wscript index 17cc17b835d..c1fadef79f7 100644 --- a/source3/wscript +++ b/source3/wscript @@ -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') diff --git a/source3/wscript_build b/source3/wscript_build index ccded5fb0f2..9fc33ceb1c5 100755 --- a/source3/wscript_build +++ b/source3/wscript_build @@ -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) -- 2.11.4.GIT