[SCM] Samba Shared Repository - branch v4-11-test updated

Karolin Seeger kseeger at samba.org
Wed Dec 4 10:16:03 UTC 2019


The branch, v4-11-test has been updated
       via  91f39dbda15 smbd: Increase a debug level
       via  ec4381228f3 heimdal-build: avoid hard-coded /usr/include/heimdal in asn1_compile-generated code.
       via  c37b94fd0a7 ldb: Release ldb 2.0.8
       via  1c8ac011360 autobuild: harden samba-xc test suite
       via  b7894c151ab wafsamba: pass environment to cross-execute tests
       via  98dc227dce9 wafsamba: avoid pre-forking if cross-compilation is enabled
       via  e1a0813aa5c wafsamba: use test_args instead of exec_args to support cross-compilation
       via  b691110c267 waf: upgrade to 2.0.18
      from  70c829304e0 ctdb-tcp: Close inflight connecting TCP sockets after fork

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-11-test


- Log -----------------------------------------------------------------
commit 91f39dbda151f6a2768b6e5eff59f931f303721f
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Jul 9 20:04:03 2019 +0200

    smbd: Increase a debug level
    
    This is not a real error, it happens when the share mode record is not
    around.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=14211
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit 4b05fe7ca73dae30807680f0e0401340bfb2c738)
    
    Autobuild-User(v4-11-test): Karolin Seeger <kseeger at samba.org>
    Autobuild-Date(v4-11-test): Wed Dec  4 10:15:19 UTC 2019 on sn-devel-184

commit ec4381228f33f04362cd05bdba330ffc89c0e162
Author: Uri Simchoni <uri at samba.org>
Date:   Sun Oct 20 21:36:11 2019 +0300

    heimdal-build: avoid hard-coded /usr/include/heimdal in asn1_compile-generated code.
    
    This fixes a cross-compilation issue, as cross-compilers (rightly)
    complain if host include directories are in the include path.
    
    The fix is taken from buildroot (https://github.com/buildroot/buildroot/blob/8b11b96f41a6ffa76556c9bf03a863955871ee57/package/samba4/0006-heimdal_build-wscript_build-do-not-add-host-include-.patch) where it was applied by Bernd Kuhls <bernd.kuhls at t-online.de>.
    
    This reverts some of 3fe2bfddda6149f6bf7402720226e9285f479fef, but
    building Samba's bundled Heimdal with a system roken is not supported
    anyway.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13856
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date(master): Sun Dec  1 10:22:01 UTC 2019 on sn-devel-184
    
    (cherry picked from commit 27fc062d7ea2207242d5a2c9933f3de5fa206488)

commit c37b94fd0a7b24df93b664ad4c2d197c516c9dce
Author: Uri Simchoni <uri at samba.org>
Date:   Thu Nov 28 21:19:51 2019 +0200

    ldb: Release ldb 2.0.8
    
    * Upgrade waf to version 2.0.18 to match the rest of Samba 4.11.x
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13846
    
    Signed-off-by: Uri Simchoni <uri at samba.org>

commit 1c8ac011360541bd0d1c3675ae8a99fd21dd5ab7
Author: Uri Simchoni <uri at samba.org>
Date:   Wed Oct 9 21:53:43 2019 +0300

    autobuild: harden samba-xc test suite
    
    Add more checks which directly test the behavior of
    --cross-answers and --cross-execute.
    
    Previous test tested things in a round-about way, checking
    that running in all three modes (native, cross-execute,
    cross-answers) yields the same result. It was vulnerable
    to a degradation in which cross-compilation modes didn't
    work at all and were running native tests, which is
    what happened with the upgrade of waf.
    
    The added tests check the following:
    - That cross-excute with cross-answers sets the cross-answers file
    - That the content of cross-answers file actually affects the build
      configuration
    - That a missing line in cross-answers fails the build
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13846
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User(master): Uri Simchoni <uri at samba.org>
    Autobuild-Date(master): Sun Oct 20 13:29:58 UTC 2019 on sn-devel-184
    
    (cherry picked from commit 649d15bb969b6d27fd4554f49600366bb3df4712)

commit b7894c151ab2c10774a4cedde82b97fd5da26307
Author: Uri Simchoni <uri at samba.org>
Date:   Mon Oct 7 00:37:41 2019 +0300

    wafsamba: pass environment to cross-execute tests
    
    This can come in handy for cross-execute scripts in general, and
    is particularly required by the samba-xc test for cross-answers /
    cross-execute, because Samba sets LD_LIBRARY_PATH during rpath
    checks, and the test program needs that in order to successfully
    run.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13846
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    (cherry picked from commit fdfd69840902f4b13db2a204a0ca87a578b61b85)

commit 98dc227dce980307ec58bd326b773e41272d4c98
Author: Uri Simchoni <uri at samba.org>
Date:   Mon Oct 7 00:37:31 2019 +0300

    wafsamba: avoid pre-forking if cross-compilation is enabled
    
    Waf supports pre-forking to run configuration tests, but this
    doesn't play well with Samba's cross-compilation support, because
    Samba monkey-patches the actual fork+exec, which doesn't happen
    in a pre-forked process pool.
    
    This patch emulates the impact of WAF_NO_PREFORK env var when
    cross-compilation is enabled.
    
    The blueprint for the solution has been suggested by Thomas Nagy
    in https://bugzilla.samba.org/show_bug.cgi?id=13846#c7 (item #2)
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13846
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    (cherry picked from commit 5a4ade953420a4122c80d291ac53310abd6a279c)

commit e1a0813aa5c2f52648667863a082f9ebf82d0d88
Author: Uri Simchoni <uri at samba.org>
Date:   Mon Oct 7 00:37:17 2019 +0300

    wafsamba: use test_args instead of exec_args to support cross-compilation
    
    exec_args seems to have been a custom addition to Samba's copy of waf.
    Upstream Waf has an identically-purposed parameter called test_args.
    
    This parameter is being used for addiing runtime args to test programs that
    are being run during configuration phases.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13846
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    (cherry picked from commit e00e93350288dc212fed3f1be2adf78dcb6e58e7)

commit b691110c2677769dae22b78a62a749a520ae48e7
Author: Uri Simchoni <uri at samba.org>
Date:   Mon Oct 7 00:36:42 2019 +0300

    waf: upgrade to 2.0.18
    
    This is required to get the new test_args parameter to conf.check, which
    facilitates passing arguments to configuration test programs.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13846
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    (cherry picked from commit 09e282ec8173f2935bdb579e0396f269ce712e0d)

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

Summary of changes:
 buildtools/bin/waf                                 |   2 +-
 buildtools/wafsamba/samba_autoconf.py              |   6 +-
 buildtools/wafsamba/samba_cross.py                 |   7 +-
 buildtools/wafsamba/wafsamba.py                    |   2 +-
 lib/ldb/ABI/{ldb-2.0.5.sigs => ldb-2.0.8.sigs}     |   0
 ...yldb-util-1.1.10.sigs => pyldb-util-2.0.8.sigs} |   0
 lib/ldb/wscript                                    |   2 +-
 script/autobuild.py                                |  10 ++
 source3/locking/share_mode_lock.c                  |   4 +-
 source4/heimdal_build/wscript_build                |   2 +-
 third_party/waf/waflib/Configure.py                |  20 ++-
 third_party/waf/waflib/Context.py                  |   6 +-
 third_party/waf/waflib/Scripting.py                |   7 +-
 third_party/waf/waflib/TaskGen.py                  |   2 +-
 third_party/waf/waflib/Tools/asm.py                |  37 +++-
 third_party/waf/waflib/Tools/c_aliases.py          |   6 +-
 third_party/waf/waflib/Tools/c_config.py           |   9 +-
 third_party/waf/waflib/Tools/c_tests.py            |   3 +-
 third_party/waf/waflib/Tools/gas.py                |   1 +
 third_party/waf/waflib/Tools/javaw.py              |   2 +-
 third_party/waf/waflib/Tools/nasm.py               |   5 +
 third_party/waf/waflib/Tools/python.py             |  27 +--
 third_party/waf/waflib/extras/doxygen.py           |  11 +-
 third_party/waf/waflib/extras/fast_partial.py      |  28 ++-
 third_party/waf/waflib/extras/genpybind.py         | 194 +++++++++++++++++++++
 third_party/waf/waflib/extras/local_rpath.py       |   8 +-
 third_party/waf/waflib/extras/objcopy.py           |   9 +-
 27 files changed, 351 insertions(+), 59 deletions(-)
 copy lib/ldb/ABI/{ldb-2.0.5.sigs => ldb-2.0.8.sigs} (100%)
 copy lib/ldb/ABI/{pyldb-util-1.1.10.sigs => pyldb-util-2.0.8.sigs} (100%)
 create mode 100644 third_party/waf/waflib/extras/genpybind.py


Changeset truncated at 500 lines:

diff --git a/buildtools/bin/waf b/buildtools/bin/waf
index 8413f2332b7..11ce8e7480a 100755
--- a/buildtools/bin/waf
+++ b/buildtools/bin/waf
@@ -32,7 +32,7 @@ POSSIBILITY OF SUCH DAMAGE.
 
 import os, sys, inspect
 
-VERSION="2.0.17"
+VERSION="2.0.18"
 REVISION="x"
 GIT="x"
 INSTALL="x"
diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py
index 8e5dfb87102..62d3e20a15c 100644
--- a/buildtools/wafsamba/samba_autoconf.py
+++ b/buildtools/wafsamba/samba_autoconf.py
@@ -423,9 +423,9 @@ def CHECK_CODE(conf, code, define,
     cflags.extend(ccflags)
 
     if on_target:
-        exec_args = conf.SAMBA_CROSS_ARGS(msg=msg)
+        test_args = conf.SAMBA_CROSS_ARGS(msg=msg)
     else:
-        exec_args = []
+        test_args = []
 
     conf.COMPOUND_START(msg)
 
@@ -440,7 +440,7 @@ def CHECK_CODE(conf, code, define,
                      type=type,
                      msg=msg,
                      quote=quote,
-                     exec_args=exec_args,
+                     test_args=test_args,
                      define_ret=define_ret)
     except Exception:
         if always:
diff --git a/buildtools/wafsamba/samba_cross.py b/buildtools/wafsamba/samba_cross.py
index 8863c2c53e7..0868a855a0d 100644
--- a/buildtools/wafsamba/samba_cross.py
+++ b/buildtools/wafsamba/samba_cross.py
@@ -120,7 +120,8 @@ class cross_Popen(Utils.subprocess.Popen):
             if use_answers:
                 p = real_Popen(newargs,
                                stdout=Utils.subprocess.PIPE,
-                               stderr=Utils.subprocess.PIPE)
+                               stderr=Utils.subprocess.PIPE,
+                               env=kw.get('env', {}))
                 ce_out, ce_err = p.communicate()
                 ans = (p.returncode, samba_utils.get_string(ce_out))
                 add_answer(ca_file, msg, ans)
@@ -139,7 +140,7 @@ class cross_Popen(Utils.subprocess.Popen):
 
 @conf
 def SAMBA_CROSS_ARGS(conf, msg=None):
-    '''get exec_args to pass when running cross compiled binaries'''
+    '''get test_args to pass when running cross compiled binaries'''
     if not conf.env.CROSS_COMPILE:
         return []
 
@@ -147,6 +148,8 @@ def SAMBA_CROSS_ARGS(conf, msg=None):
     if real_Popen is None:
         real_Popen  = Utils.subprocess.Popen
         Utils.subprocess.Popen = cross_Popen
+        Utils.run_process = Utils.run_regular_process
+        Utils.get_process = Utils.alloc_process_pool = Utils.nada
 
     ret = []
 
diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py
index 76d65ebfcb6..205d5b4ac32 100644
--- a/buildtools/wafsamba/wafsamba.py
+++ b/buildtools/wafsamba/wafsamba.py
@@ -38,7 +38,7 @@ LIB_PATH="shared"
 
 os.environ['PYTHONUNBUFFERED'] = '1'
 
-if Context.HEXVERSION not in (0x2001100,):
+if Context.HEXVERSION not in (0x2001200,):
     Logs.error('''
 Please use the version of waf that comes with Samba, not
 a system installed version. See http://wiki.samba.org/index.php/Waf
diff --git a/lib/ldb/ABI/ldb-2.0.5.sigs b/lib/ldb/ABI/ldb-2.0.8.sigs
similarity index 100%
copy from lib/ldb/ABI/ldb-2.0.5.sigs
copy to lib/ldb/ABI/ldb-2.0.8.sigs
diff --git a/lib/ldb/ABI/pyldb-util-1.1.10.sigs b/lib/ldb/ABI/pyldb-util-2.0.8.sigs
similarity index 100%
copy from lib/ldb/ABI/pyldb-util-1.1.10.sigs
copy to lib/ldb/ABI/pyldb-util-2.0.8.sigs
diff --git a/lib/ldb/wscript b/lib/ldb/wscript
index 750306fbddb..5b5c42d1431 100644
--- a/lib/ldb/wscript
+++ b/lib/ldb/wscript
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 
 APPNAME = 'ldb'
-VERSION = '2.0.7'
+VERSION = '2.0.8'
 
 import sys, os
 
diff --git a/script/autobuild.py b/script/autobuild.py
index cf665bd6a7c..41a373b9b90 100755
--- a/script/autobuild.py
+++ b/script/autobuild.py
@@ -442,12 +442,22 @@ tasks = {
         ("configure-native", "./configure.developer --with-selftest-prefix=./bin/ab" + samba_configure_params),
         ("configure-cross-execute", "./configure.developer --out ./bin-xe --cross-compile --cross-execute=script/identity_cc.sh" \
             " --cross-answers=./bin-xe/cross-answers.txt --with-selftest-prefix=./bin-xe/ab" + samba_configure_params),
+        ("verify-cross-execute-output", "grep '^Checking value of NSIG' ./bin-xe/cross-answers.txt"),
         ("configure-cross-answers", "./configure.developer --out ./bin-xa --cross-compile" \
             " --cross-answers=./bin-xe/cross-answers.txt --with-selftest-prefix=./bin-xa/ab" + samba_configure_params),
         ("compare-results", "script/compare_cc_results.py "
             "./bin/c4che/default{} "
             "./bin-xe/c4che/default{} "
             "./bin-xa/c4che/default{}".format(*([CACHE_SUFFIX]*3))),
+        ("modify-cross-answers", "sed -i.bak -e 's/^\\(Checking value of NSIG:\\) .*/\\1 \"1234\"/' ./bin-xe/cross-answers.txt"),
+        ("configure-cross-answers-modified", "./configure.developer --out ./bin-xa2 --cross-compile" \
+            " --cross-answers=./bin-xe/cross-answers.txt --with-selftest-prefix=./bin-xa2/ab" + samba_configure_params),
+        ("verify-cross-answers", "test $(sed -n -e 's/VALUEOF_NSIG = \\(.*\\)/\\1/p' ./bin-xa2/c4che/default{})" \
+            " = \"'1234'\"".format(CACHE_SUFFIX)),
+        ("invalidate-cross-answers", "sed -i.bak -e '/^Checking value of NSIG/d' ./bin-xe/cross-answers.txt"),
+        ("configure-cross-answers-fail", "./configure.developer --out ./bin-xa3 --cross-compile" \
+            " --cross-answers=./bin-xe/cross-answers.txt --with-selftest-prefix=./bin-xa3/ab" + samba_configure_params + \
+            " ; test $? -ne 0"),
         ],
 
     # test build with -O3 -- catches extra warnings and bugs, tests the ad_dc environments
diff --git a/source3/locking/share_mode_lock.c b/source3/locking/share_mode_lock.c
index 372e188c1c0..c70041ecf62 100644
--- a/source3/locking/share_mode_lock.c
+++ b/source3/locking/share_mode_lock.c
@@ -593,8 +593,8 @@ struct share_mode_lock *get_share_mode_lock(
 			smb_fname,
 			old_write_time);
 		if (!NT_STATUS_IS_OK(status)) {
-			DBG_WARNING("get_static_share_mode_data failed: %s\n",
-				    nt_errstr(status));
+			DBG_DEBUG("get_static_share_mode_data failed: %s\n",
+				  nt_errstr(status));
 			TALLOC_FREE(static_share_mode_record);
 			goto fail;
 		}
diff --git a/source4/heimdal_build/wscript_build b/source4/heimdal_build/wscript_build
index 163b622fca9..27adbc06dc6 100644
--- a/source4/heimdal_build/wscript_build
+++ b/source4/heimdal_build/wscript_build
@@ -140,7 +140,7 @@ def HEIMDAL_ASN1(name, source,
             samba_cflags   = CURRENT_CFLAGS(bld, name, ''),
             depends_on     = '',
             samba_deps     = to_list('roken replace'),
-            samba_includes = includes + ["/usr/include/heimdal"],
+            samba_includes = includes,
             local_include  = True)
 
 
diff --git a/third_party/waf/waflib/Configure.py b/third_party/waf/waflib/Configure.py
index db09c0e3a40..5762eb66954 100644
--- a/third_party/waf/waflib/Configure.py
+++ b/third_party/waf/waflib/Configure.py
@@ -524,7 +524,7 @@ def run_build(self, *k, **kw):
 	Though this function returns *0* by default, the build may set an attribute named *retval* on the
 	build context object to return a particular value. See :py:func:`waflib.Tools.c_config.test_exec_fun` for example.
 
-	This function also provides a limited cache. To use it, provide the following option::
+	This function also features a cache which can be enabled by the following option::
 
 		def options(opt):
 			opt.add_option('--confcache', dest='confcache', default=0,
@@ -535,10 +535,21 @@ def run_build(self, *k, **kw):
 		$ waf configure --confcache
 
 	"""
-	lst = [str(v) for (p, v) in kw.items() if p != 'env']
-	h = Utils.h_list(lst)
+	buf = []
+	for key in sorted(kw.keys()):
+		v = kw[key]
+		if hasattr(v, '__call__'):
+			buf.append(Utils.h_fun(v))
+		else:
+			buf.append(str(v))
+	h = Utils.h_list(buf)
 	dir = self.bldnode.abspath() + os.sep + (not Utils.is_win32 and '.' or '') + 'conf_check_' + Utils.to_hex(h)
 
+	cachemode = kw.get('confcache', getattr(Options.options, 'confcache', None))
+
+	if not cachemode and os.path.exists(dir):
+		shutil.rmtree(dir)
+
 	try:
 		os.makedirs(dir)
 	except OSError:
@@ -549,7 +560,6 @@ def run_build(self, *k, **kw):
 	except OSError:
 		self.fatal('cannot use the configuration test folder %r' % dir)
 
-	cachemode = getattr(Options.options, 'confcache', None)
 	if cachemode == 1:
 		try:
 			proj = ConfigSet.ConfigSet(os.path.join(dir, 'cache_run_build'))
@@ -589,7 +599,7 @@ def run_build(self, *k, **kw):
 		else:
 			ret = getattr(bld, 'retval', 0)
 	finally:
-		if cachemode == 1:
+		if cachemode:
 			# cache the results each time
 			proj = ConfigSet.ConfigSet()
 			proj['cache_run_build'] = ret
diff --git a/third_party/waf/waflib/Context.py b/third_party/waf/waflib/Context.py
index d0759aada58..e3305fa3341 100644
--- a/third_party/waf/waflib/Context.py
+++ b/third_party/waf/waflib/Context.py
@@ -11,13 +11,13 @@ from waflib import Utils, Errors, Logs
 import waflib.Node
 
 # the following 3 constants are updated on each new release (do not touch)
-HEXVERSION=0x2001100
+HEXVERSION=0x2001200
 """Constant updated on new releases"""
 
-WAFVERSION="2.0.17"
+WAFVERSION="2.0.18"
 """Constant updated on new releases"""
 
-WAFREVISION="6bc6cb599c702e985780e9f705b291b812123693"
+WAFREVISION="314689b8994259a84f0de0aaef74d7ce91f541ad"
 """Git revision when the waf version is updated"""
 
 ABI = 20
diff --git a/third_party/waf/waflib/Scripting.py b/third_party/waf/waflib/Scripting.py
index ae17a8b4503..68dccf29ce0 100644
--- a/third_party/waf/waflib/Scripting.py
+++ b/third_party/waf/waflib/Scripting.py
@@ -332,7 +332,12 @@ def distclean(ctx):
 		else:
 			remove_and_log(env.out_dir, shutil.rmtree)
 
-		for k in (env.out_dir, env.top_dir, env.run_dir):
+		env_dirs = [env.out_dir]
+		if not ctx.options.no_lock_in_top:
+			env_dirs.append(env.top_dir)
+		if not ctx.options.no_lock_in_run:
+			env_dirs.append(env.run_dir)
+		for k in env_dirs:
 			p = os.path.join(k, Options.lockfile)
 			remove_and_log(p, os.remove)
 
diff --git a/third_party/waf/waflib/TaskGen.py b/third_party/waf/waflib/TaskGen.py
index 532b7d5cdb4..f8f92bd57c1 100644
--- a/third_party/waf/waflib/TaskGen.py
+++ b/third_party/waf/waflib/TaskGen.py
@@ -905,7 +905,7 @@ def process_subst(self):
 		# paranoid safety measure for the general case foo.in->foo.h with ambiguous dependencies
 		for xt in HEADER_EXTS:
 			if b.name.endswith(xt):
-				tsk.ext_in = tsk.ext_in + ['.h']
+				tsk.ext_out = tsk.ext_out + ['.h']
 				break
 
 		inst_to = getattr(self, 'install_path', None)
diff --git a/third_party/waf/waflib/Tools/asm.py b/third_party/waf/waflib/Tools/asm.py
index b6f26fb3df3..a57e83bb5ec 100644
--- a/third_party/waf/waflib/Tools/asm.py
+++ b/third_party/waf/waflib/Tools/asm.py
@@ -34,9 +34,22 @@ Support for pure asm programs and libraries should also work::
 			target = 'asmtest')
 """
 
-from waflib import Task
+import re
+from waflib import Errors, Logs, Task
 from waflib.Tools.ccroot import link_task, stlink_task
 from waflib.TaskGen import extension
+from waflib.Tools import c_preproc
+
+re_lines = re.compile(
+	'^[ \t]*(?:%)[ \t]*(ifdef|ifndef|if|else|elif|endif|include|import|define|undef)[ \t]*(.*)\r*$',
+	re.IGNORECASE | re.MULTILINE)
+
+class asm_parser(c_preproc.c_parser):
+	def filter_comments(self, node):
+		code = node.read()
+		code = c_preproc.re_nl.sub('', code)
+		code = c_preproc.re_cpp.sub(c_preproc.repl, code)
+		return re_lines.findall(code)
 
 class asm(Task.Task):
 	"""
@@ -45,6 +58,28 @@ class asm(Task.Task):
 	color = 'BLUE'
 	run_str = '${AS} ${ASFLAGS} ${ASMPATH_ST:INCPATHS} ${DEFINES_ST:DEFINES} ${AS_SRC_F}${SRC} ${AS_TGT_F}${TGT}'
 
+	def scan(self):
+		if self.env.ASM_NAME == 'gas':
+			return c_preproc.scan(self)
+			Logs.warn('There is no dependency scanner for Nasm!')
+			return  [[], []]
+		elif self.env.ASM_NAME == 'nasm':
+			Logs.warn('The Nasm dependency scanner is incomplete!')
+
+		try:
+			incn = self.generator.includes_nodes
+		except AttributeError:
+			raise Errors.WafError('%r is missing the "asm" feature' % self.generator)
+
+		if c_preproc.go_absolute:
+			nodepaths = incn
+		else:
+			nodepaths = [x for x in incn if x.is_child_of(x.ctx.srcnode) or x.is_child_of(x.ctx.bldnode)]
+
+		tmp = asm_parser(nodepaths)
+		tmp.start(self.inputs[0], self.env)
+		return (tmp.nodes, tmp.names)
+
 @extension('.s', '.S', '.asm', '.ASM', '.spp', '.SPP')
 def asm_hook(self, node):
 	"""
diff --git a/third_party/waf/waflib/Tools/c_aliases.py b/third_party/waf/waflib/Tools/c_aliases.py
index c9d53692e8f..985e048bdb7 100644
--- a/third_party/waf/waflib/Tools/c_aliases.py
+++ b/third_party/waf/waflib/Tools/c_aliases.py
@@ -47,10 +47,12 @@ def sniff_features(**kw):
 		if x in exts:
 			feats.append('cxx')
 			break
-
 	if 'c' in exts or 'vala' in exts or 'gs' in exts:
 		feats.append('c')
 
+	if 's' in exts or 'S' in exts:
+		feats.append('asm')
+
 	for x in 'f f90 F F90 for FOR'.split():
 		if x in exts:
 			feats.append('fc')
@@ -66,7 +68,7 @@ def sniff_features(**kw):
 	if typ in ('program', 'shlib', 'stlib'):
 		will_link = False
 		for x in feats:
-			if x in ('cxx', 'd', 'fc', 'c'):
+			if x in ('cxx', 'd', 'fc', 'c', 'asm'):
 				feats.append(x + typ)
 				will_link = True
 		if not will_link and not kw.get('features', []):
diff --git a/third_party/waf/waflib/Tools/c_config.py b/third_party/waf/waflib/Tools/c_config.py
index d546be95614..80580cc9fcb 100644
--- a/third_party/waf/waflib/Tools/c_config.py
+++ b/third_party/waf/waflib/Tools/c_config.py
@@ -659,20 +659,21 @@ class test_exec(Task.Task):
 	"""
 	color = 'PINK'
 	def run(self):
+		cmd = [self.inputs[0].abspath()] + getattr(self.generator, 'test_args', [])
 		if getattr(self.generator, 'rpath', None):
 			if getattr(self.generator, 'define_ret', False):
-				self.generator.bld.retval = self.generator.bld.cmd_and_log([self.inputs[0].abspath()])
+				self.generator.bld.retval = self.generator.bld.cmd_and_log(cmd)
 			else:
-				self.generator.bld.retval = self.generator.bld.exec_command([self.inputs[0].abspath()])
+				self.generator.bld.retval = self.generator.bld.exec_command(cmd)
 		else:
 			env = self.env.env or {}
 			env.update(dict(os.environ))
 			for var in ('LD_LIBRARY_PATH', 'DYLD_LIBRARY_PATH', 'PATH'):
 				env[var] = self.inputs[0].parent.abspath() + os.path.pathsep + env.get(var, '')
 			if getattr(self.generator, 'define_ret', False):
-				self.generator.bld.retval = self.generator.bld.cmd_and_log([self.inputs[0].abspath()], env=env)
+				self.generator.bld.retval = self.generator.bld.cmd_and_log(cmd, env=env)
 			else:
-				self.generator.bld.retval = self.generator.bld.exec_command([self.inputs[0].abspath()], env=env)
+				self.generator.bld.retval = self.generator.bld.exec_command(cmd, env=env)
 
 @feature('test_exec')
 @after_method('apply_link')
diff --git a/third_party/waf/waflib/Tools/c_tests.py b/third_party/waf/waflib/Tools/c_tests.py
index f858df5763c..7a4094f2450 100644
--- a/third_party/waf/waflib/Tools/c_tests.py
+++ b/third_party/waf/waflib/Tools/c_tests.py
@@ -224,6 +224,7 @@ def check_endianness(self):
 	def check_msg(self):
 		return tmp[0]
 	self.check(fragment=ENDIAN_FRAGMENT, features='c grep_for_endianness',
-		msg='Checking for endianness', define='ENDIANNESS', tmp=tmp, okmsg=check_msg)
+		msg='Checking for endianness', define='ENDIANNESS', tmp=tmp,
+		okmsg=check_msg, confcache=None)
 	return tmp[0]
 
diff --git a/third_party/waf/waflib/Tools/gas.py b/third_party/waf/waflib/Tools/gas.py
index 77afed7038f..4a8745afd7e 100644
--- a/third_party/waf/waflib/Tools/gas.py
+++ b/third_party/waf/waflib/Tools/gas.py
@@ -16,3 +16,4 @@ def configure(conf):
 	conf.env.ASLNK_TGT_F = ['-o']
 	conf.find_ar()
 	conf.load('asm')
+	conf.env.ASM_NAME = 'gas'
diff --git a/third_party/waf/waflib/Tools/javaw.py b/third_party/waf/waflib/Tools/javaw.py
index fd1cf469abf..ceb08c28c87 100644
--- a/third_party/waf/waflib/Tools/javaw.py
+++ b/third_party/waf/waflib/Tools/javaw.py
@@ -246,7 +246,7 @@ def use_javac_files(self):
 				self.javac_task.dep_nodes.extend(tg.jar_task.outputs)
 			else:
 				if hasattr(tg, 'outdir'):
-					base_node = tg.outdir.abspath()
+					base_node = tg.outdir
 				else:
 					base_node = tg.path.get_bld()
 
diff --git a/third_party/waf/waflib/Tools/nasm.py b/third_party/waf/waflib/Tools/nasm.py
index 411d5826b5d..9c51c18de18 100644
--- a/third_party/waf/waflib/Tools/nasm.py
+++ b/third_party/waf/waflib/Tools/nasm.py
@@ -24,3 +24,8 @@ def configure(conf):
 	conf.env.ASLNK_TGT_F = ['-o']
 	conf.load('asm')
 	conf.env.ASMPATH_ST = '-I%s' + os.sep
+	txt = conf.cmd_and_log(conf.env.AS + ['--version'])
+	if 'yasm' in txt.lower():
+		conf.env.ASM_NAME = 'yasm'
+	else:
+		conf.env.ASM_NAME = 'nasm'
diff --git a/third_party/waf/waflib/Tools/python.py b/third_party/waf/waflib/Tools/python.py
index 63a8917d7c1..7c45a76ffd2 100644
--- a/third_party/waf/waflib/Tools/python.py
+++ b/third_party/waf/waflib/Tools/python.py
@@ -79,14 +79,19 @@ def process_py(self, node):
 	"""
 	Add signature of .py file, so it will be byte-compiled when necessary
 	"""
-	assert(hasattr(self, 'install_path')), 'add features="py"'
+	assert(hasattr(self, 'install_path')), 'add features="py" for target "%s" in "%s/wscript".' % (self.target, self.path.nice_path())
+	self.install_from = getattr(self, 'install_from', None)
+	relative_trick = getattr(self, 'relative_trick', True)
+	if self.install_from:
+		assert isinstance(self.install_from, Node.Node), \
+		'add features="py" for target "%s" in "%s/wscript" (%s).' % (self.target, self.path.nice_path(), type(self.install_from))
 
 	# where to install the python file
 	if self.install_path:
 		if self.install_from:
-			self.add_install_files(install_to=self.install_path, install_from=node, cwd=self.install_from, relative_trick=True)
+			self.add_install_files(install_to=self.install_path, install_from=node, cwd=self.install_from, relative_trick=relative_trick)
 		else:
-			self.add_install_files(install_to=self.install_path, install_from=node, relative_trick=True)
+			self.add_install_files(install_to=self.install_path, install_from=node, relative_trick=relative_trick)
 
 	lst = []
 	if self.env.PYC:
@@ -96,9 +101,11 @@ def process_py(self, node):
 
 	if self.install_path:
 		if self.install_from:
-			pyd = Utils.subst_vars("%s/%s" % (self.install_path, node.path_from(self.install_from)), self.env)
+			target_dir = node.path_from(self.install_from) if relative_trick else node.name
+			pyd = Utils.subst_vars("%s/%s" % (self.install_path, target_dir), self.env)
 		else:
-			pyd = Utils.subst_vars("%s/%s" % (self.install_path, node.path_from(self.path)), self.env)
+			target_dir = node.path_from(self.path) if relative_trick else node.name
+			pyd = Utils.subst_vars("%s/%s" % (self.install_path, target_dir), self.env)
 	else:
 		pyd = node.abspath()
 
@@ -115,7 +122,7 @@ def process_py(self, node):
 		tsk.pyd = pyd
 
 		if self.install_path:
-			self.add_install_files(install_to=os.path.dirname(pyd), install_from=pyobj, cwd=node.parent.get_bld(), relative_trick=True)
+			self.add_install_files(install_to=os.path.dirname(pyd), install_from=pyobj, cwd=node.parent.get_bld(), relative_trick=relative_trick)
 
 class pyc(Task.Task):
 	"""
@@ -433,11 +440,11 @@ def check_python_headers(conf, features='pyembed pyext'):
 
 	# Code using the Python API needs to be compiled with -fno-strict-aliasing
 	if env.CC_NAME == 'gcc':
-		env.append_value('CFLAGS_PYEMBED', ['-fno-strict-aliasing'])
-		env.append_value('CFLAGS_PYEXT', ['-fno-strict-aliasing'])
+		env.append_unique('CFLAGS_PYEMBED', ['-fno-strict-aliasing'])
+		env.append_unique('CFLAGS_PYEXT', ['-fno-strict-aliasing'])
 	if env.CXX_NAME == 'gcc':
-		env.append_value('CXXFLAGS_PYEMBED', ['-fno-strict-aliasing'])
-		env.append_value('CXXFLAGS_PYEXT', ['-fno-strict-aliasing'])
+		env.append_unique('CXXFLAGS_PYEMBED', ['-fno-strict-aliasing'])
+		env.append_unique('CXXFLAGS_PYEXT', ['-fno-strict-aliasing'])
 
 	if env.CC_NAME == "msvc":
 		from distutils.msvccompiler import MSVCCompiler
diff --git a/third_party/waf/waflib/extras/doxygen.py b/third_party/waf/waflib/extras/doxygen.py
index 423d8455025..20cd9e1a852 100644
--- a/third_party/waf/waflib/extras/doxygen.py
+++ b/third_party/waf/waflib/extras/doxygen.py
@@ -85,6 +85,12 @@ class doxygen(Task.Task):
 		if not getattr(self, 'pars', None):
 			txt = self.inputs[0].read()


-- 
Samba Shared Repository



More information about the samba-cvs mailing list