[SCM] Samba Shared Repository - branch master updated
Andrew Bartlett
abartlet at samba.org
Fri Sep 7 13:46:03 UTC 2018
The branch, master has been updated
via 4847daf wafsamba/samba_waf18: redefine flex function
via 364077d lib/replace/wscript: fix detection of a fallthrough attribute for clang
via 311e1eb wafsamba/samba_autoconf: when setting undefined result, use empty tuple
via 193fdbf s3/wscript: fix flex detection
via e761271 s3/wscript: fix bison detection
from 4a63ab9 s4/selftest/tests: Enabled samba.tests.samba_tool.computer
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 4847daf0b762db205812347c8e31edd3a3ef5039
Author: Alexander Bokovoy <ab at samba.org>
Date: Thu Sep 6 09:36:18 2018 +0300
wafsamba/samba_waf18: redefine flex function
There is a bug in waf: flex routine adjusts its inputs against
the task's current working directory but assumes it is being called from
within the build variant directory.
For Samba this means we adjust one level up than the actual work
directory we use to run (bin/ vs bin/default) and flex doesn't find the
source files.
Fix the issue by creating a local override of flex definition that
utilizes the same workd directory for both path adjustment and running
the flex itself.
Signed-off-by: Alexander Bokovoy <ab at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
Autobuild-Date(master): Fri Sep 7 15:45:36 CEST 2018 on sn-devel-144
commit 364077d262012af0346afad6d9b9c3999054563f
Author: Alexander Bokovoy <ab at samba.org>
Date: Thu Sep 6 09:50:58 2018 +0000
lib/replace/wscript: fix detection of a fallthrough attribute for clang
clang issues a warning but otherwise allows our test to be compiled and
linked. We consider this case a successful pass for a fallthrough
attribute detection while it is an error.
Turn missing declaration warning into an error so that we actually do
not define fallthrough attribute support in case it doesn't really work.
Fixes FreeBSD 11.2 with clang.
Signed-off-by: Alexander Bokovoy <ab at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit 311e1eb67306d6a639ce80b94a16ea2ef19592f0
Author: Alexander Bokovoy <ab at samba.org>
Date: Thu Sep 6 07:51:00 2018 +0000
wafsamba/samba_autoconf: when setting undefined result, use empty tuple
A difference between waf 1.x and 2.x is that we gained 0 as an undefined
variable in the cache file. This does not allow to differentiate unset
and set to 0 defines.
Force to use empty tuple () to signify unset defines.
Also, fix handling of extra cflags in case of 'strict=True': if
extra_cflags were not defined, we'd append None to the cflags list and
it confuses conf.check() later. 'None' is added to the command line of a
tool executed by the conf.check() which, depending on a tool, may be
treated as an error and cause wrong test result.
Signed-off-by: Alexander Bokovoy <ab at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit 193fdbf181ad7848cabf56db9780571aeb91aa3a
Author: Ralph Boehme <slow at samba.org>
Date: Wed Sep 5 13:47:17 2018 +0200
s3/wscript: fix flex detection
Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
commit e7612710d1e94d18f80649deb17e6defae9a5b23
Author: Ralph Boehme <slow at samba.org>
Date: Wed Sep 5 13:46:37 2018 +0200
s3/wscript: fix bison detection
Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Andrew Bartlett <abartlet at samba.org>
-----------------------------------------------------------------------
Summary of changes:
buildtools/wafsamba/samba_autoconf.py | 11 ++++++++--
buildtools/wafsamba/samba_waf18.py | 41 +++++++++++++++++++++++++++++------
lib/replace/wscript | 1 +
source3/wscript | 4 ++--
4 files changed, 46 insertions(+), 11 deletions(-)
Changeset truncated at 500 lines:
diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py
index 02fbeec..6b940e5 100644
--- a/buildtools/wafsamba/samba_autoconf.py
+++ b/buildtools/wafsamba/samba_autoconf.py
@@ -402,7 +402,8 @@ def CHECK_CODE(conf, code, define,
extra_cflags = "-Werror"
elif conf.env["CC_NAME"] == "xlc":
extra_cflags = "-qhalt=w"
- cflags.append(extra_cflags)
+ if extra_cflags:
+ cflags.append(extra_cflags)
if local_include:
cflags.append('-I%s' % conf.path.abspath())
@@ -451,7 +452,13 @@ def CHECK_CODE(conf, code, define,
raise
return False
else:
- # success
+ # Success is indicated by ret but we should unset
+ # defines set by WAF's c_config.check() because it
+ # defines it to int(ret) and we want to undefine it
+ if not ret:
+ conf.undefine(define)
+ conf.COMPOUND_END(False)
+ return False
if not define_ret:
conf.DEFINE(define, 1)
conf.COMPOUND_END(True)
diff --git a/buildtools/wafsamba/samba_waf18.py b/buildtools/wafsamba/samba_waf18.py
index ff20bc2..8a4558d 100644
--- a/buildtools/wafsamba/samba_waf18.py
+++ b/buildtools/wafsamba/samba_waf18.py
@@ -6,9 +6,36 @@ from waflib import ConfigSet
from waflib.TaskGen import feature, after
from waflib.Configure import conf, ConfigurationContext
-from waflib.Tools import bison, flex
-sys.modules['bison'] = bison
-sys.modules['flex'] = flex
+from waflib.Tools.flex import decide_ext
+
+# This version of flexfun runs in tsk.get_cwd() as opposed to the
+# bld.variant_dir: since input paths adjusted against tsk.get_cwd(), we have to
+# use tsk.get_cwd() for the work directory as well.
+def flexfun(tsk):
+ env = tsk.env
+ bld = tsk.generator.bld
+ def to_list(xx):
+ if isinstance(xx, str):
+ return [xx]
+ return xx
+ tsk.last_cmd = lst = []
+ lst.extend(to_list(env.FLEX))
+ lst.extend(to_list(env.FLEXFLAGS))
+ inputs = [a.path_from(tsk.get_cwd()) for a in tsk.inputs]
+ if env.FLEX_MSYS:
+ inputs = [x.replace(os.sep, '/') for x in inputs]
+ lst.extend(inputs)
+ lst = [x for x in lst if x]
+ txt = bld.cmd_and_log(lst, cwd=tsk.get_cwd(), env=env.env or None, quiet=0)
+ tsk.outputs[0].write(txt.replace('\r\n', '\n').replace('\r', '\n')) # issue #1207
+
+TaskGen.declare_chain(
+ name = 'flex',
+ rule = flexfun, # issue #854
+ ext_in = '.l',
+ decider = decide_ext,
+)
+
for y in (Build.BuildContext, Build.CleanContext, Build.InstallContext, Build.UninstallContext, Build.ListContext):
class tmp(y):
@@ -69,10 +96,10 @@ def apply_incpaths(self):
def define(self, key, val, quote=True, comment=None):
assert key and isinstance(key, str)
- if val is True:
- val = 1
- elif val in (False, None):
- val = 0
+ if val is None:
+ val = ()
+ elif isinstance(val, bool):
+ val = int(val)
# waf 1.5
self.env[key] = val
diff --git a/lib/replace/wscript b/lib/replace/wscript
index fa9b837..3d47c37 100644
--- a/lib/replace/wscript
+++ b/lib/replace/wscript
@@ -314,6 +314,7 @@ def configure(conf):
'HAVE_FALLTHROUGH_ATTRIBUTE',
addmain=False,
strict=True,
+ cflags=['-Werror=missing-declarations'],
msg='Checking for fallthrough attribute')
# these may be builtins, so we need the link=False strategy
diff --git a/source3/wscript b/source3/wscript
index 9037b64..cf7beb7 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -1618,12 +1618,12 @@ main() {
if Options.options.with_spotlight:
Logs.info("Requested Spotlight support, checking for bison")
- bison.detect(conf)
+ bison.configure(conf)
if not conf.env['BISON']:
conf.fatal("Spotlight support requested but bison missing")
conf.CHECK_COMMAND('%s --version | head -n1' % conf.env['BISON'], msg='Using bison version', define=None, on_target=False)
Logs.info("Requested Spotlight support, checking for flex")
- flex.detect(conf)
+ flex.configure(conf)
if not conf.env['FLEX']:
conf.fatal("Spotlight support requested but flex missing")
conf.CHECK_COMMAND('%s --version' % conf.env['FLEX'], msg='Using flex version', define=None, on_target=False)
--
Samba Shared Repository
More information about the samba-cvs
mailing list