third_party/waf: upgrade to waf 2.0.8
authorAlexander Bokovoy <ab@samba.org>
Fri, 15 Jun 2018 10:29:45 +0000 (13:29 +0300)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 5 Sep 2018 04:37:25 +0000 (06:37 +0200)
Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
176 files changed:
third_party/waf/waflib/Build.py
third_party/waf/waflib/ConfigSet.py
third_party/waf/waflib/Configure.py
third_party/waf/waflib/Context.py
third_party/waf/waflib/Errors.py
third_party/waf/waflib/Logs.py
third_party/waf/waflib/Node.py
third_party/waf/waflib/Options.py
third_party/waf/waflib/Runner.py
third_party/waf/waflib/Scripting.py
third_party/waf/waflib/Task.py
third_party/waf/waflib/TaskGen.py
third_party/waf/waflib/Tools/__init__.py
third_party/waf/waflib/Tools/ar.py
third_party/waf/waflib/Tools/asm.py
third_party/waf/waflib/Tools/bison.py
third_party/waf/waflib/Tools/c.py
third_party/waf/waflib/Tools/c_aliases.py
third_party/waf/waflib/Tools/c_config.py
third_party/waf/waflib/Tools/c_osx.py
third_party/waf/waflib/Tools/c_preproc.py
third_party/waf/waflib/Tools/c_tests.py
third_party/waf/waflib/Tools/ccroot.py
third_party/waf/waflib/Tools/clang.py
third_party/waf/waflib/Tools/clangxx.py
third_party/waf/waflib/Tools/compiler_c.py
third_party/waf/waflib/Tools/compiler_cxx.py
third_party/waf/waflib/Tools/compiler_d.py
third_party/waf/waflib/Tools/compiler_fc.py
third_party/waf/waflib/Tools/cs.py
third_party/waf/waflib/Tools/cxx.py
third_party/waf/waflib/Tools/d.py
third_party/waf/waflib/Tools/d_config.py
third_party/waf/waflib/Tools/d_scan.py
third_party/waf/waflib/Tools/dbus.py
third_party/waf/waflib/Tools/dmd.py
third_party/waf/waflib/Tools/errcheck.py
third_party/waf/waflib/Tools/fc.py
third_party/waf/waflib/Tools/fc_config.py
third_party/waf/waflib/Tools/fc_scan.py
third_party/waf/waflib/Tools/flex.py
third_party/waf/waflib/Tools/g95.py
third_party/waf/waflib/Tools/gas.py
third_party/waf/waflib/Tools/gcc.py
third_party/waf/waflib/Tools/gdc.py
third_party/waf/waflib/Tools/gfortran.py
third_party/waf/waflib/Tools/glib2.py
third_party/waf/waflib/Tools/gnu_dirs.py
third_party/waf/waflib/Tools/gxx.py
third_party/waf/waflib/Tools/icc.py
third_party/waf/waflib/Tools/icpc.py
third_party/waf/waflib/Tools/ifort.py
third_party/waf/waflib/Tools/intltool.py
third_party/waf/waflib/Tools/irixcc.py
third_party/waf/waflib/Tools/javaw.py
third_party/waf/waflib/Tools/ldc2.py
third_party/waf/waflib/Tools/lua.py
third_party/waf/waflib/Tools/md5_tstamp.py
third_party/waf/waflib/Tools/msvc.py
third_party/waf/waflib/Tools/nasm.py
third_party/waf/waflib/Tools/nobuild.py
third_party/waf/waflib/Tools/perl.py
third_party/waf/waflib/Tools/python.py
third_party/waf/waflib/Tools/qt5.py
third_party/waf/waflib/Tools/ruby.py
third_party/waf/waflib/Tools/suncc.py
third_party/waf/waflib/Tools/suncxx.py
third_party/waf/waflib/Tools/tex.py
third_party/waf/waflib/Tools/vala.py
third_party/waf/waflib/Tools/waf_unit_test.py
third_party/waf/waflib/Tools/winres.py
third_party/waf/waflib/Tools/xlc.py
third_party/waf/waflib/Tools/xlcxx.py
third_party/waf/waflib/Utils.py
third_party/waf/waflib/__init__.py
third_party/waf/waflib/ansiterm.py
third_party/waf/waflib/extras/__init__.py
third_party/waf/waflib/extras/batched_cc.py
third_party/waf/waflib/extras/biber.py
third_party/waf/waflib/extras/bjam.py
third_party/waf/waflib/extras/blender.py
third_party/waf/waflib/extras/boo.py
third_party/waf/waflib/extras/boost.py
third_party/waf/waflib/extras/build_file_tracker.py
third_party/waf/waflib/extras/build_logs.py
third_party/waf/waflib/extras/buildcopy.py
third_party/waf/waflib/extras/c_bgxlc.py
third_party/waf/waflib/extras/c_dumbpreproc.py
third_party/waf/waflib/extras/c_emscripten.py
third_party/waf/waflib/extras/c_nec.py
third_party/waf/waflib/extras/cabal.py
third_party/waf/waflib/extras/cfg_altoptions.py
third_party/waf/waflib/extras/clang_compilation_database.py
third_party/waf/waflib/extras/codelite.py
third_party/waf/waflib/extras/color_gcc.py
third_party/waf/waflib/extras/color_rvct.py
third_party/waf/waflib/extras/compat15.py
third_party/waf/waflib/extras/cppcheck.py
third_party/waf/waflib/extras/cpplint.py
third_party/waf/waflib/extras/cross_gnu.py
third_party/waf/waflib/extras/cython.py
third_party/waf/waflib/extras/dcc.py
third_party/waf/waflib/extras/distnet.py
third_party/waf/waflib/extras/doxygen.py
third_party/waf/waflib/extras/dpapi.py
third_party/waf/waflib/extras/eclipse.py
third_party/waf/waflib/extras/erlang.py
third_party/waf/waflib/extras/fast_partial.py
third_party/waf/waflib/extras/fc_bgxlf.py
third_party/waf/waflib/extras/fc_cray.py
third_party/waf/waflib/extras/fc_nag.py
third_party/waf/waflib/extras/fc_nec.py
third_party/waf/waflib/extras/fc_open64.py
third_party/waf/waflib/extras/fc_pgfortran.py
third_party/waf/waflib/extras/fc_solstudio.py
third_party/waf/waflib/extras/fc_xlf.py
third_party/waf/waflib/extras/file_to_object.py
third_party/waf/waflib/extras/fluid.py
third_party/waf/waflib/extras/freeimage.py
third_party/waf/waflib/extras/fsb.py
third_party/waf/waflib/extras/fsc.py
third_party/waf/waflib/extras/gccdeps.py
third_party/waf/waflib/extras/gdbus.py [new file with mode: 0644]
third_party/waf/waflib/extras/gob2.py
third_party/waf/waflib/extras/halide.py
third_party/waf/waflib/extras/javatest.py
third_party/waf/waflib/extras/kde4.py
third_party/waf/waflib/extras/local_rpath.py
third_party/waf/waflib/extras/make.py
third_party/waf/waflib/extras/midl.py
third_party/waf/waflib/extras/msvcdeps.py
third_party/waf/waflib/extras/msvs.py
third_party/waf/waflib/extras/netcache_client.py
third_party/waf/waflib/extras/objcopy.py
third_party/waf/waflib/extras/ocaml.py
third_party/waf/waflib/extras/package.py
third_party/waf/waflib/extras/parallel_debug.py
third_party/waf/waflib/extras/pch.py
third_party/waf/waflib/extras/pep8.py
third_party/waf/waflib/extras/pgicc.py
third_party/waf/waflib/extras/pgicxx.py
third_party/waf/waflib/extras/proc.py
third_party/waf/waflib/extras/protoc.py
third_party/waf/waflib/extras/pyqt5.py
third_party/waf/waflib/extras/pytest.py
third_party/waf/waflib/extras/qnxnto.py
third_party/waf/waflib/extras/qt4.py
third_party/waf/waflib/extras/relocation.py
third_party/waf/waflib/extras/remote.py
third_party/waf/waflib/extras/resx.py
third_party/waf/waflib/extras/review.py
third_party/waf/waflib/extras/rst.py
third_party/waf/waflib/extras/run_do_script.py
third_party/waf/waflib/extras/run_m_script.py
third_party/waf/waflib/extras/run_py_script.py
third_party/waf/waflib/extras/run_r_script.py
third_party/waf/waflib/extras/sas.py
third_party/waf/waflib/extras/satellite_assembly.py
third_party/waf/waflib/extras/scala.py
third_party/waf/waflib/extras/slow_qt4.py
third_party/waf/waflib/extras/softlink_libs.py
third_party/waf/waflib/extras/stale.py
third_party/waf/waflib/extras/stracedeps.py
third_party/waf/waflib/extras/swig.py
third_party/waf/waflib/extras/syms.py
third_party/waf/waflib/extras/ticgt.py
third_party/waf/waflib/extras/unity.py
third_party/waf/waflib/extras/use_config.py
third_party/waf/waflib/extras/valadoc.py
third_party/waf/waflib/extras/waf_xattr.py [new file with mode: 0644]
third_party/waf/waflib/extras/why.py
third_party/waf/waflib/extras/win32_opts.py
third_party/waf/waflib/extras/wix.py
third_party/waf/waflib/extras/xcode6.py
third_party/waf/waflib/fixpy2.py
third_party/waf/waflib/processor.py

index 70ebd697c24d70eb7b1633a6851987ed33e26bbe..8347a287a81b3fc317de43e1a3290cd8d01c6802 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2005-2018 (ita)
index d07f4c304fbdf9d25c54a0c3a5b9a15e09010f9e..b300bb56b7cfee1c2375346304ff3f0bbef36fa9 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2005-2018 (ita)
index 839413e92016a97210b4f137fe86aa65617e82dc..20ca705e696138b30644bf0ce0fe7ea9f951f0bb 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2005-2018 (ita)
@@ -315,11 +311,7 @@ def conf(f):
        :type f: function
        """
        def fun(*k, **kw):
-               mandatory = True
-               if 'mandatory' in kw:
-                       mandatory = kw['mandatory']
-                       del kw['mandatory']
-
+               mandatory = kw.pop('mandatory', True)
                try:
                        return f(*k, **kw)
                except Errors.ConfigurationError:
@@ -426,8 +418,8 @@ def find_program(self, filename, **kw):
        :type var: string
        :param value: obtain the program from the value passed exclusively
        :type value: list or string (list is preferred)
-       :param ext: list of extensions for the binary (do not add an extension for portability)
-       :type ext: list of string
+       :param exts: list of extensions for the binary (do not add an extension for portability)
+       :type exts: list of string
        :param msg: name to display in the log, by default filename is used
        :type msg: string
        :param interpreter: interpreter for the program
index 7eab573e28d922d4b796da1e901601d1d00cfc8b..3222fb1551c73874be7499040b15ab18f71ce9b4 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2010-2018 (ita)
@@ -15,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=0x2000400
+HEXVERSION=0x2000800
 """Constant updated on new releases"""
 
-WAFVERSION="2.0.4"
+WAFVERSION="2.0.8"
 """Constant updated on new releases"""
 
-WAFREVISION="5996879673deb7166b61a299be317a738de6891e"
+WAFREVISION="f78fbc32bb355a3291c9b5f79bbe0c8dfe81282a"
 """Git revision when the waf version is updated"""
 
 ABI = 20
@@ -56,6 +52,9 @@ out_dir = ''
 waf_dir = ''
 """Directory containing the waf modules"""
 
+default_encoding = Utils.console_encoding()
+"""Encoding to use when reading outputs from other processes"""
+
 g_module = None
 """
 Module representing the top-level wscript file (see :py:const:`waflib.Context.run_dir`)
@@ -358,6 +357,8 @@ class Context(ctx):
                        if not isinstance(kw['cwd'], str):
                                kw['cwd'] = kw['cwd'].abspath()
 
+               encoding = kw.pop('decode_as', default_encoding)
+
                try:
                        ret, out, err = Utils.run_process(cmd, kw, cargs)
                except Exception as e:
@@ -365,14 +366,14 @@ class Context(ctx):
 
                if out:
                        if not isinstance(out, str):
-                               out = out.decode(sys.stdout.encoding or 'latin-1', errors='replace')
+                               out = out.decode(encoding, errors='replace')
                        if self.logger:
                                self.logger.debug('out: %s', out)
                        else:
                                Logs.info(out, extra={'stream':sys.stdout, 'c1': ''})
                if err:
                        if not isinstance(err, str):
-                               err = err.decode(sys.stdout.encoding or 'latin-1', errors='replace')
+                               err = err.decode(encoding, errors='replace')
                        if self.logger:
                                self.logger.error('err: %s' % err)
                        else:
@@ -408,17 +409,8 @@ class Context(ctx):
                kw['shell'] = isinstance(cmd, str)
                self.log_command(cmd, kw)
 
-               if 'quiet' in kw:
-                       quiet = kw['quiet']
-                       del kw['quiet']
-               else:
-                       quiet = None
-
-               if 'output' in kw:
-                       to_ret = kw['output']
-                       del kw['output']
-               else:
-                       to_ret = STDOUT
+               quiet = kw.pop('quiet', None)
+               to_ret = kw.pop('output', STDOUT)
 
                if Logs.verbose and not kw['shell'] and not Utils.check_exe(cmd[0]):
                        raise Errors.WafError('Program %r not found!' % cmd[0])
@@ -444,15 +436,17 @@ class Context(ctx):
                        if not isinstance(kw['cwd'], str):
                                kw['cwd'] = kw['cwd'].abspath()
 
+               encoding = kw.pop('decode_as', default_encoding)
+
                try:
                        ret, out, err = Utils.run_process(cmd, kw, cargs)
                except Exception as e:
                        raise Errors.WafError('Execution failure: %s' % str(e), ex=e)
 
                if not isinstance(out, str):
-                       out = out.decode(sys.stdout.encoding or 'latin-1', errors='replace')
+                       out = out.decode(encoding, errors='replace')
                if not isinstance(err, str):
-                       err = err.decode(sys.stdout.encoding or 'latin-1', errors='replace')
+                       err = err.decode(encoding, errors='replace')
 
                if out and quiet != STDOUT and quiet != BOTH:
                        self.to_log('out: %s' % out)
index c38a557128efbaf73b6ffe1f91cc453471f430ed..bf75c1b6611a370f32900ad79f982c0ed3f03843 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2010-2018 (ita)
index 4d4db5ecdd355c845d95c6c19f054fa4f8a55797..2a475169b9b1217c8d09c423654ce15806403bbc 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2005-2018 (ita)
index a61902d00e5608d861f8ad7148ffd917c700d488..4ac1ea8a0b8abf5debd991ccdff70eae0ae93e41 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2005-2018 (ita)
@@ -630,11 +626,10 @@ class Node(object):
                                        if maxdepth:
                                                for k in node.ant_iter(accept=accept, maxdepth=maxdepth - 1, pats=npats, dir=dir, src=src, remove=remove, quiet=quiet):
                                                        yield k
-               raise StopIteration
 
        def ant_glob(self, *k, **kw):
                """
-               Finds files across folders:
+               Finds files across folders and returns Node objects:
 
                * ``**/*`` find all files recursively
                * ``**/*.class`` find all files ending by .class
@@ -643,14 +638,51 @@ class Node(object):
                For example::
 
                        def configure(cfg):
-                               cfg.path.ant_glob('**/*.cpp') # finds all .cpp files
-                               cfg.root.ant_glob('etc/*.txt') # matching from the filesystem root can be slow
-                               cfg.path.ant_glob('*.cpp', excl=['*.c'], src=True, dir=False)
+                               # find all .cpp files
+                               cfg.path.ant_glob('**/*.cpp')
+                               # find particular files from the root filesystem (can be slow)
+                               cfg.root.ant_glob('etc/*.txt')
+                               # simple exclusion rule example
+                               cfg.path.ant_glob('*.c*', excl=['*.c'], src=True, dir=False)
+
+               For more information about the patterns, consult http://ant.apache.org/manual/dirtasks.html
+               Please remember that the '..' sequence does not represent the parent directory::
+
+                       def configure(cfg):
+                               cfg.path.ant_glob('../*.h') # incorrect
+                               cfg.path.parent.ant_glob('*.h') # correct
+
+               The Node structure is itself a filesystem cache, so certain precautions must
+               be taken while matching files in the build or installation phases.
+               Nodes objects that do have a corresponding file or folder are garbage-collected by default.
+               This garbage collection is usually required to prevent returning files that do not
+               exist anymore. Yet, this may also remove Node objects of files that are yet-to-be built.
 
-               For more information see http://ant.apache.org/manual/dirtasks.html
+               This typically happens when trying to match files in the build directory,
+               but there are also cases when files are created in the source directory.
+               Run ``waf -v`` to display any warnings, and try consider passing ``remove=False``
+               when matching files in the build directory.
+
+               Since ant_glob can traverse both source and build folders, it is a best practice
+               to call this method only from the most specific build node::
+
+                       def build(bld):
+                               # traverses the build directory, may need ``remove=False``:
+                               bld.path.ant_glob('project/dir/**/*.h')
+                               # better, no accidental build directory traversal:
+                               bld.path.find_node('project/dir').ant_glob('**/*.h') # best
+
+               In addition, files and folders are listed immediately. When matching files in the
+               build folders, consider passing ``generator=True`` so that the generator object
+               returned can defer computation to a later stage. For example::
+
+                       def build(bld):
+                               bld(rule='tar xvf ${SRC}', source='arch.tar')
+                               bld.add_group()
+                               gen = bld.bldnode.ant_glob("*.h", generator=True, remove=True)
+                               # files will be listed only after the arch.tar is unpacked
+                               bld(rule='ls ${SRC}', source=gen, name='XYZ')
 
-               The nodes that correspond to files and folders that do not exist are garbage-collected.
-               To prevent this behaviour in particular when running over the build directory, pass ``remove=False``
 
                :param incl: ant patterns or list of patterns to include
                :type incl: string or list of strings
@@ -664,13 +696,13 @@ class Node(object):
                :type maxdepth: int
                :param ignorecase: ignore case while matching (False by default)
                :type ignorecase: bool
-               :returns: The corresponding Nodes
+               :param generator: Whether to evaluate the Nodes lazily
                :type generator: bool
                :param remove: remove files/folders that do not exist (True by default)
                :type remove: bool
                :param quiet: disable build directory traversal warnings (verbose mode)
                :type quiet: bool
-               :returns: Whether to evaluate the Nodes lazily, alters the type of the returned value
+               :returns: The corresponding Node objects as a list or as a generator object (generator=True)
                :rtype: by default, list of :py:class:`waflib.Node.Node` instances
                """
                src = kw.get('src', True)
index 39873c629ccef585e6125986b33a48994703fcdf..ad802d4b9056c3b8c204a77b7d673ef60c390b51 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Scott Newton, 2005 (scottn)
index 30e42d3b0998bd31608b1e3cdcccffbb5107d864..7535c83de9e50b152638eb3a8ba8d7a9b22197e3 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2005-2018 (ita)
@@ -12,9 +8,21 @@ Runner.py: Task scheduling and execution
 
 import heapq, traceback
 try:
-       from queue import Queue
+       from queue import Queue, PriorityQueue
 except ImportError:
        from Queue import Queue
+       try:
+               from Queue import PriorityQueue
+       except ImportError:
+               class PriorityQueue(Queue):
+                       def _init(self, maxsize):
+                               self.maxsize = maxsize
+                               self.queue = []
+                       def _put(self, item):
+                               heapq.heappush(self.queue, item)
+                       def _get(self):
+                               return heapq.heappop(self.queue)
+
 from waflib import Utils, Task, Errors, Logs
 
 GAP = 5
@@ -34,6 +42,7 @@ class PriorityTasks(object):
        def append(self, task):
                heapq.heappush(self.lst, task)
        def appendleft(self, task):
+               "Deprecated, do not use"
                heapq.heappush(self.lst, task)
        def pop(self):
                return heapq.heappop(self.lst)
@@ -141,7 +150,7 @@ class Parallel(object):
                self.incomplete = set()
                """List of :py:class:`waflib.Task.Task` waiting for dependent tasks to complete (DAG)"""
 
-               self.ready = Queue(0)
+               self.ready = PriorityQueue(0)
                """List of :py:class:`waflib.Task.Task` ready to be executed by consumers"""
 
                self.out = Queue(0)
@@ -261,7 +270,26 @@ class Parallel(object):
                :type tsk: :py:attr:`waflib.Task.Task`
                """
                if getattr(tsk, 'more_tasks', None):
-                       # TODO recompute priorities globally?
+                       more = set(tsk.more_tasks)
+                       groups_done = set()
+                       def iteri(a, b):
+                               for x in a:
+                                       yield x
+                               for x in b:
+                                       yield x
+
+                       # Update the dependency tree
+                       # this assumes that task.run_after values were updated
+                       for x in iteri(self.outstanding, self.incomplete):
+                               for k in x.run_after:
+                                       if isinstance(k, Task.TaskGroup):
+                                               if k not in groups_done:
+                                                       groups_done.add(k)
+                                                       for j in k.prev & more:
+                                                               self.revdeps[j].add(k)
+                                       elif k in more:
+                                               self.revdeps[k].add(x)
+
                        ready, waiting = self.prio_and_split(tsk.more_tasks)
                        self.outstanding.extend(ready)
                        self.incomplete.update(waiting)
@@ -480,13 +508,12 @@ class Parallel(object):
 
                reverse = self.revdeps
 
+               groups_done = set()
                for x in tasks:
                        for k in x.run_after:
                                if isinstance(k, Task.TaskGroup):
-                                       if k.done:
-                                               pass
-                                       else:
-                                               k.done = True
+                                       if k not in groups_done:
+                                               groups_done.add(k)
                                                for j in k.prev:
                                                        reverse[j].add(k)
                                else:
index 642d6d43e591f342252c25f31a41b029168abced..18203d527016554ae103524d60a6d1f33c099d3a 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2005-2018 (ita)
index 89a73258f924aedb8609cf2cd03f1167cbb49cde..c4642443f550618d2ecf82034cb1c7652286a918 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2005-2018 (ita)
@@ -726,6 +722,32 @@ class Task(evil):
                                                        v = v() # dependency is a function, call it
                                        upd(v)
 
+       def sig_deep_inputs(self):
+               """
+               Enable rebuilds on input files task signatures. Not used by default.
+
+               Example: hashes of output programs can be unchanged after being re-linked,
+               despite the libraries being different. This method can thus prevent stale unit test
+               results (waf_unit_test.py).
+
+               Hashing input file timestamps is another possibility for the implementation.
+               This may cause unnecessary rebuilds when input tasks are frequently executed.
+               Here is an implementation example::
+
+                       lst = []
+                       for node in self.inputs + self.dep_nodes:
+                               st = os.stat(node.abspath())
+                               lst.append(st.st_mtime)
+                               lst.append(st.st_size)
+                       self.m.update(Utils.h_list(lst))
+
+               The downside of the implementation is that it absolutely requires all build directory
+               files to be declared within the current build.
+               """
+               bld = self.generator.bld
+               lst = [bld.task_sigs[bld.node_sigs[node]] for node in (self.inputs + self.dep_nodes) if node.is_bld()]
+               self.m.update(Utils.h_list(lst))
+
        def sig_vars(self):
                """
                Used by :py:meth:`waflib.Task.Task.signature`; it hashes :py:attr:`waflib.Task.Task.env` variables/values
@@ -1244,6 +1266,16 @@ def task_factory(name, func=None, vars=None, color='GREEN', ext_in=[], ext_out=[
 
        return cls
 
+def deep_inputs(cls):
+       """
+       Task class decorator to enable rebuilds on input files task signatures
+       """
+       def sig_explicit_deps(self):
+               Task.sig_explicit_deps(self)
+               Task.sig_deep_inputs(self)
+       cls.sig_explicit_deps = sig_explicit_deps
+       return cls
+
 TaskBase = Task
 "Provided for compatibility reasons, TaskBase should not be used"
 
index 1287058cee216a62ae2f20b3a6a851afa1d1874a..40007b55ca7b6f58926e35b4440a2d536e2a6d8c 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2005-2018 (ita)
@@ -571,6 +567,7 @@ def process_rule(self):
        * stderr: standard error, set to None to prevent waf from capturing the text
        * timeout: timeout for command execution (Python 3)
        * always: whether to always run the command (False by default)
+       * deep_inputs: whether the task must depend on the input file tasks too (False by default)
        """
        if not getattr(self, 'rule', None):
                return
@@ -592,12 +589,13 @@ def process_rule(self):
        cls_str = getattr(self, 'cls_str', None)
        cls_keyword = getattr(self, 'cls_keyword', None)
        use_cache = getattr(self, 'cache_rule', 'True')
+       deep_inputs = getattr(self, 'deep_inputs', False)
 
        scan_val = has_deps = hasattr(self, 'deps')
        if scan:
                scan_val = id(scan)
 
-       key = Utils.h_list((name, self.rule, chmod, shell, color, cls_str, cls_keyword, scan_val, _vars))
+       key = Utils.h_list((name, self.rule, chmod, shell, color, cls_str, cls_keyword, scan_val, _vars, deep_inputs))
 
        cls = None
        if use_cache:
@@ -626,6 +624,9 @@ def process_rule(self):
                if cls_keyword:
                        setattr(cls, 'keyword', self.cls_keyword)
 
+               if deep_inputs:
+                       Task.deep_inputs(cls)
+
                if scan:
                        cls.scan = self.scan
                elif has_deps:
index 94cf66f799ba3713ce50d2a1e12ae25100d1b96b..079df358f58b2433f0b70ed2029a4016ad034e74 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2005-2018 (ita)
index bf5220d41c0f3a6c14f64b232fb47498cc7bdceb..b39b645926bf0b44784355a0ec0d5f0374e73324 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2006-2018 (ita)
index 46fa614d9d357281b88e4f5018ab72c065f19e81..b6f26fb3df3c872bbaaf528a50bfee997e706b01 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2008-2018 (ita)
index 771d39e7abf9f7ff721219b0c7977b9e2405cdf1..eef56dcdd74dd4d9d12b1ee2682d5a33e5cec945 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # John O'Meara, 2006
index 0b998a3b0eefb6feeba0faf90a3867f7819188f7..effd6b6ee8ee5704a52c9bcca5bfe8470374cfda 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2006-2018 (ita)
index d9c050b46f8019945a74fa7aeec8ffaefdaebe55..c9d53692e8fdd39121946da9637a7074611fbe65 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2005-2015 (ita)
index db8197db14b9b3c8238819fcb70a1524d28cb56b..76082152cd9282b59440fd64f1afca2d90ed5bde 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2005-2018 (ita)
index bafcda19684cfbaa4f41cb967bd7aafd8bd3ead1..f70b128b87482b3cee9323205fe94afb471a66f3 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy 2008-2018 (ita)
index 1a8b91376440649dcdd0343938aa4d0ad1b9c49d..c2c239baa260a622ac71fc9306b343a26e61a235 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2006-2018 (ita)
index c362019249813ee39ddbe111510166d6dd4eb085..f858df5763cd42698156a078dda3dc179424ea0c 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2016-2018 (ita)
index 6a425fd8f4dd6bc5e4f3b3f87c8e022593ef1a58..394f36b8e12ef9107b6a662e7a6aea8918b30096 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2005-2018 (ita)
@@ -517,11 +513,11 @@ def apply_implib(self):
                node = self.path.find_resource(self.defs)
                if not node:
                        raise Errors.WafError('invalid def file %r' % self.defs)
-               if 'msvc' in (self.env.CC_NAME, self.env.CXX_NAME):
-                       self.env.append_value('LINKFLAGS', '/def:%s' % node.path_from(self.get_cwd()))
+               if self.env.def_PATTERN:
+                       self.env.append_value('LINKFLAGS', self.env.def_PATTERN % node.path_from(self.get_cwd()))
                        self.link_task.dep_nodes.append(node)
                else:
-                       #gcc for windows takes *.def file a an input without any special flag
+                       # gcc for windows takes *.def file as input without any special flag
                        self.link_task.inputs.append(node)
 
        # where to put the import library
index 882b68ab0f55d14791b6fcb2171679b7ac874f1a..3828e39118841e59f1863f3bea28af50cad5a6f3 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Krzysztof Kosiński 2014
index cec3311e41c0dc9c73f08bae2452fd577c61dfe1..152013ce7a1cda111188719ee6e3e5238ca0f574 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy 2009-2018 (ita)
index 2bc55bf518fddbcfc2062bf2a04a5e3ffd8fb3ae..2dba3f827040d147bcb50a7c6c5fd3dc87403d20 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Matthias Jahn jahn dôt matthias ât freenet dôt de, 2007 (pmarat)
index fb5b874d6798738e9f10d6ae49dffb71f418f9cf..1af65a226dc006f50e7c9527c2e4f31cf9451fab 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Matthias Jahn jahn dôt matthias ât freenet dôt de 2007 (pmarat)
index 6146d7b2cae6b3ecee96d82252f89af50d398d01..43bb1f646ab9b757d5f0fd719c3c5236dcf07119 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Carlos Rafael Giani, 2007 (dv)
index 0def01804447f4156316bbcb0875814f483914e0..96b58e706f6679dcfaf612e1797261da07bb8ee6 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 
index b23b77f91f29311b9c42a82fab65a7d6b4028298..aecca6da13df1d9da58fda7f348b275c640f0043 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2006-2018 (ita)
index e6964e9cdeb4fb59f4a03aa10d33c2aede50f8fa..194fad7437d5328001f84d2e7c86ab1c4f3099f5 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2005-2018 (ita)
index f4337146e0b058763de69dddd2222a0b9a6d982b..e4cf73bb4af039c7f7ce48abdd206e0a97a1a72f 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Carlos Rafael Giani, 2007 (dv)
index 207f3c75b71e2f4fd4befcd663d8de0958792d75..66375565245990061018d3f1ffd1e87e66cf642e 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2016-2018 (ita)
index 4b9b148d381f2fa453ecac259119b27d038b6478..14c6c313e9a16347f382c6237f9318556a38f071 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2016-2018 (ita)
index 801ad1fa5c6446e3b0cff574953783b550be0822..d520f1c0f2dcf233e529f62e2a3e3a49a485747b 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Ali Sabil, 2007
@@ -44,7 +40,7 @@ def add_dbus_file(self, filename, prefix, mode):
                self.meths.append('process_dbus')
        self.dbus_lst.append([filename, prefix, mode])
 
-@before_method('apply_core')
+@before_method('process_source')
 def process_dbus(self):
        """
        Processes the dbus files stored in the attribute *dbus_lst* to create :py:class:`waflib.Tools.dbus.dbus_binding_tool` instances.
index 07d7d59cf2c19f121bd46e8d2bd629b37f027aca..8917ca1b3f9ec367b9ee73a7205288d4a6f9637b 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Carlos Rafael Giani, 2007 (dv)
index e50fe6077611d6f2d29634721a7346259d32f63e..de8d75a42bd5db743ffe3ba1b8bf2e747ca48236 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2011 (ita)
index 92bb2eb60a690d106cc4549e38a234cb58ae9ba4..621eb5029dfd5c451590499dde4cbbadc9799bfd 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 # DC 2008
index 69928abc9409ba1663d16ea1c6eb90287d0028f3..0df460b5d1e74bf9a5b849c16b10a537eff586a6 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 # DC 2008
index e8c6eda962485569f35c60d1854e46fab9e3fd11..12cb0fc041e55259cef2f877607144b9d9c1321d 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 # DC 2008
index 11191af3447c5cb737f2ce04775ae3510d43d71e..2256657b6a90582d6dced730f57afe8b88350075 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # John O'Meara, 2006
index 95db89bbb046964a7bacba266ca6cc78e36e621f..f69ba4f3678280ece65e5453d9b7aac17ab63357 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 # KWS 2010
index c3862b82714072efff26b73d27ee8774fb886943..77afed7038f847c426babb934740ae735951a24b 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2008-2018 (ita)
index 60183ceeae0e214a89860800a6a2535ef1bbe0f9..acdd473ada598bd5ae65e2a876ecf02890163a0e 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2006-2018 (ita)
index 8d378c512c8cf9c3fac55e34a09420016aba8964..d89a66d3066b0079d849218fa7bf04e8ba989131 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Carlos Rafael Giani, 2007 (dv)
index 12cff7106d28a6ac2574b5d0ae1cf8c30c51cd49..1050667315d80367e93c12c0d5f85095bc311728 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 # DC 2008
index 6891ac8cadb47269080ba59478ec7945ef84ba74..949fe37c3b6985beb68a04b2534c540a786314ea 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2006-2018 (ita)
index b9735b8cf3853bc21073c876a4caae850fc1695f..2847071d173d5409001d25d16d869f62800396d5 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Ali Sabil, 2007
index 69c7aa2172a75f9c15f49a2ca052d3af30267e58..22c5d26f2a4d310cdd8f9b130348d1f7822f49a2 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2006-2018 (ita)
index eede603514356d10ee93f0064b9871303d4900c6..b6492c8e1a0cdec7c4837e1b4ed44d007f43f8c3 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Stian Selnes 2008
index 226e82923799fe70c09f91cd126ff19aa5e430cc..8a6cc6c40f9fb0872393f8c8c81b95d42fba18ab 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy 2009-2018 (ita)
index 3d0f83f0732b3588dad71e9bbe94697351118b9f..74934f3f6618a698312fe91434a070902a90a9bb 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 # DC 2008
index 960c3963cb7e5b0f2dd5f69bde16d17827e9ab95..af95ba80eda8841dbfd5dd13137e2efe08230a1e 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2006-2018 (ita)
index ed5c49ff6e0791788b56756423f2d1122260cf35..c3ae1ac915c6e39db8796e7182fef9fc216df7c1 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 # imported from samba
index 3a2f3a7af589916343c2abd275245d401aab3278..f6fd20cc689c85996be5015ea441620cd9afc9d0 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2006-2018 (ita)
index 3d719de781c63d511ad90122967ea60cd42869ce..a51c344b95d87a13ed666fafc31b3d794dbd835f 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Alex Rønne Petersen, 2012 (alexrp/Zor)
index 9c6a234447af99e10ed56b07b29c7f4aef9a8fe5..15a333a995bd87772e10a0a416bdb8dda05a8fa6 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Sebastian Schlingmann, 2008
index f17b1223f4edc3152aab80dc6efa3da0e8634f4b..6428e46024e68618aec00c72d748019cef74129d 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 
index 9ee7eadcdbe4c0ccc6b557a149792cbad720e1c4..17b347d458383031fba8314b9a0ca97683a828b8 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Carlos Rafael Giani, 2006 (dv)
@@ -12,6 +8,12 @@
 """
 Microsoft Visual C++/Intel C++ compiler support
 
+If you get detection problems, first try any of the following::
+
+       chcp 65001
+       set PYTHONIOENCODING=...
+       set PYTHONLEGACYWINDOWSSTDIO=1
+
 Usage::
 
        $ waf configure --msvc_version="msvc 10.0,msvc 9.0" --msvc_target="x64"
@@ -461,10 +463,8 @@ def gather_vswhere_versions(conf, versions):
                return
 
        if sys.version_info[0] < 3:
-               try:
-                       txt = txt.decode(sys.stdout.encoding or 'cp1252')
-               except UnicodeError:
-                       txt = txt.decode('utf-8', 'replace')
+               txt = txt.decode(Utils.console_encoding())
+
        arr = json.loads(txt)
        arr.sort(key=lambda x: x['installationVersion'])
        for entry in arr:
@@ -940,6 +940,8 @@ def msvc_common_flags(conf):
 
        v.cprogram_PATTERN  = v.cxxprogram_PATTERN = '%s.exe'
 
+       v.def_PATTERN       = '/def:%s'
+
 
 #######################################################################################################
 ##### conf above, build below
index eedba82a8df1eba1cbb316a458636bf570fa3a07..411d5826b5da34860e70bb0fd1e2a2247f0cf4a2 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2008-2018 (ita)
index 705c3dd0b0ad1cf9dd29c97c9e485c5f09a8dcd1..2e4b055ec7f12f65428fcaa8b9e557571e2a1107 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2015 (ita)
index 375346ddfdf874fea0b07a4e05fdfc61242668ea..32b03fbaa711cb75c9726a95fd691b5aeecbb7a2 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # andersg at 0x63.nu 2007
index 10e407387d3ee6896ee6061e5ee11be77a36abd4..25841d03cf8ed60e2bfd2ac9ac67bebf9cd79e3c 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2007-2015 (ita)
@@ -450,9 +446,9 @@ def check_python_version(conf, minver=None):
        Check if the python interpreter is found matching a given minimum version.
        minver should be a tuple, eg. to check for python >= 2.4.2 pass (2,4,2) as minver.
 
-       If successful, PYTHON_VERSION is defined as 'MAJOR.MINOR'
-       (eg. '2.4') of the actual python version found, and PYTHONDIR is
-       defined, pointing to the site-packages directory appropriate for
+       If successful, PYTHON_VERSION is defined as 'MAJOR.MINOR' (eg. '2.4')
+       of the actual python version found, and PYTHONDIR and PYTHONARCHDIR
+       are defined, pointing to the site-packages directories appropriate for
        this python version, where modules/packages/extensions should be
        installed.
 
index f4842a9ac5589c3eb7dc8a6fe8188f4f87cd6f77..709dd5161e37ba10dc956cc087c8ac043daed95c 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2006-2018 (ita)
@@ -399,6 +395,19 @@ class rcc(Task.Task):
                                names.append(x)
                return (nodes, names)
 
+       def quote_flag(self, x):
+               """
+               Override Task.quote_flag. QT parses the argument files
+               differently than cl.exe and link.exe
+
+               :param x: flag
+               :type x: string
+               :return: quoted flag
+               :rtype: string
+               """
+               return x
+
+
 class moc(Task.Task):
        """
        Creates ``.moc`` files
@@ -406,6 +415,19 @@ class moc(Task.Task):
        color   = 'BLUE'
        run_str = '${QT_MOC} ${MOC_FLAGS} ${MOCCPPPATH_ST:INCPATHS} ${MOCDEFINES_ST:DEFINES} ${SRC} ${MOC_ST} ${TGT}'
 
+       def quote_flag(self, x):
+               """
+               Override Task.quote_flag. QT parses the argument files
+               differently than cl.exe and link.exe
+
+               :param x: flag
+               :type x: string
+               :return: quoted flag
+               :rtype: string
+               """
+               return x
+
+
 class ui5(Task.Task):
        """
        Processes ``.ui`` files
@@ -629,7 +651,6 @@ def find_single_qt5_lib(self, name, uselib, qtlibs, qtincludes, force_static):
                        for k in ('', '5') if Utils.is_win32 else ['']:
                                for p in ('lib', ''):
                                        yield (p, name, k, x)
-               raise StopIteration
 
        for tup in lib_names():
                k = ''.join(tup)
index f5107aaa141d5d62de69b3324f13d0ea8ebe28d7..8d92a79a16179d3b62d957135b0d73c34e35710d 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # daniel.svensson at purplescout.se 2008
index 5a3318368aa4b9c0423d2bd5ea138ae6106b5423..33d34fc9ea8ddc7bccce47dec956c90c132f00df 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2006-2018 (ita)
index 5b00407edece565f0f6be64d950e06c74fa63efd..3b384f6f99de03dbf0ba030ec2546303bc87db60 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2006-2018 (ita)
index 0d72333889c616d49c9bbe60e3b7c6def63e7621..eaf9fdb58028271e777357fab30d31da5709d3ed 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2006-2018 (ita)
index 699a80082c50359a7062cec0c28858c05e0c3012..822ec502e0f42ff1ca419aae4b3c70f321e86403 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Ali Sabil, 2007
index b1db1704c9ca132cd33e9339a188379556786669..a71ed1c090911922369706bf0968d6ebc0e979a2 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Carlos Rafael Giani, 2006
@@ -156,6 +152,7 @@ def add_test_results(self, tup):
        except AttributeError:
                self.bld.utest_results = [tup]
 
+@Task.deep_inputs
 class utest(Task.Task):
        """
        Execute a unit test
@@ -235,11 +232,6 @@ class utest(Task.Task):
        def get_cwd(self):
                return getattr(self.generator, 'ut_cwd', self.inputs[0].parent)
 
-       def sig_explicit_deps(self):
-               lst = [os.stat(node.abspath()).st_mtime for node in self.inputs]
-               self.m.update(str(lst))
-               return super(utest, self).sig_explicit_deps()
-
 def summary(bld):
        """
        Display an execution summary::
index 23fa27e54e0785cff4ad404b1d4ca08741b8b413..586c596cf93741206960bd992a88e8117fc3d379 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Brant Young, 2007
index 6dfb4b044862931d775242897a815110cf5fb2dd..134dd4152d2efdf338f954fb77d76f1bba361d0a 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2006-2018 (ita)
index a67ef502ba977b5677eeff3b438d5b1d75ccd85c..76aa59bc91cf05bf8c9877a37bea2b008b3aa727 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2006-2018 (ita)
index 0c9158385b40f73844c6059dfa55358f05912be8..b4665c4dc2bbf64fd723206b944a42ab8a5f03da 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2005-2018 (ita)
@@ -204,6 +200,8 @@ class lazy_generator(object):
                        it = self.it = self.fun(*self.params)
                return next(it)
 
+       next = __next__
+
 is_win32 = os.sep == '\\' or sys.platform == 'win32' # msys2
 """
 Whether this system is a Windows series
@@ -436,6 +434,21 @@ def to_list(val):
        else:
                return val
 
+def console_encoding():
+       try:
+               import ctypes
+       except ImportError:
+               pass
+       else:
+               try:
+                       codepage = ctypes.windll.kernel32.GetConsoleCP()
+               except AttributeError:
+                       pass
+               else:
+                       if codepage:
+                               return 'cp%d' % codepage
+       return sys.stdout.encoding or ('cp1252' if is_win32 else 'latin-1')
+
 def split_path_unix(path):
        return path.split('/')
 
index 94cf66f799ba3713ce50d2a1e12ae25100d1b96b..079df358f58b2433f0b70ed2029a4016ad034e74 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2005-2018 (ita)
index 8da47263121f92b6822f4807751bbbb59e8b0314..0d20c6374b731034f772ad4e1e65752dc1a12b60 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 
index 3dfaabd1371bf0d935022e452bfd00038b6463a6..c8a3c349288e347799f88745dafc71d7ee7ccd78 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2005-2010 (ita)
index 935df6cf162353bc6a8032b1a8d8d6644380345c..aad2872298378fc70c1ecbf1f2fba33d855388a6 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2006-2015 (ita)
index b4bb72267e8fe5af68f9b9903d6a63d0af5b1200..fd9db4e04eabfbdda8a58ee267b23f8016273a90 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2011 (ita)
index b8effa543b77af7404531ccf1887d36bd778c5d9..8e04d3a66fcea2a1f466a21b5d71ef2ac0227ec6 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # per rosengren 2011
 
index 2556415a0c8f814a03e882c7d381ebda0fc786f1..e5efc280cf86bd866238ceb928cdba13042a96fc 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Michal Proszek, 2014 (poxip)
index 93bff04c5386959a02934765a8c5e06765f5ca3b..06623d40fd490c1eb917532a818ac8b3e65f39c2 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 # Yannick LM 2011
index 2fe99a40674c4207e9444d679652dcd4c9a7e720..c2aaaa938a20abc63f167d783e0eff28d2314ec8 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 #
@@ -58,8 +54,7 @@ from waflib import Utils, Logs, Errors
 from waflib.Configure import conf
 from waflib.TaskGen import feature, after_method
 
-BOOST_LIBS = ['/usr/lib/x86_64-linux-gnu', '/usr/lib/i386-linux-gnu',
-                         '/usr/lib', '/usr/local/lib', '/opt/local/lib', '/sw/lib', '/lib']
+BOOST_LIBS = ['/usr/lib', '/usr/local/lib', '/opt/local/lib', '/sw/lib', '/lib']
 BOOST_INCLUDES = ['/usr/include', '/usr/local/include', '/opt/local/include', '/sw/include']
 BOOST_VERSION_FILE = 'boost/version.hpp'
 BOOST_VERSION_CODE = '''
@@ -73,6 +68,21 @@ BOOST_ERROR_CODE = '''
 int main() { boost::system::error_code c; }
 '''
 
+PTHREAD_CODE = '''
+#include <pthread.h>
+static void* f(void*) { return 0; }
+int main() {
+       pthread_t th;
+       pthread_attr_t attr;
+       pthread_attr_init(&attr);
+       pthread_create(&th, &attr, &f, 0);
+       pthread_join(th, 0);
+       pthread_cleanup_push(0, 0);
+       pthread_cleanup_pop(0);
+       pthread_attr_destroy(&attr);
+}
+'''
+
 BOOST_THREAD_CODE = '''
 #include <boost/thread.hpp>
 int main() { boost::thread t; }
@@ -309,6 +319,66 @@ def boost_get_libs(self, *k, **kw):
 
        return  path.abspath(), match_libs(kw.get('lib'), False), match_libs(kw.get('stlib'), True)
 
+@conf
+def _check_pthread_flag(self, *k, **kw):
+       '''
+       Computes which flags should be added to CXXFLAGS and LINKFLAGS to compile in multi-threading mode
+
+       Yes, we *need* to put the -pthread thing in CPPFLAGS because with GCC3,
+       boost/thread.hpp will trigger a #error if -pthread isn't used:
+         boost/config/requires_threads.hpp:47:5: #error "Compiler threading support
+         is not turned on. Please set the correct command line options for
+         threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)"
+
+       Based on _BOOST_PTHREAD_FLAG(): https://github.com/tsuna/boost.m4/blob/master/build-aux/boost.m4
+    '''
+
+       var = kw.get('uselib_store', 'BOOST')
+
+       self.start_msg('Checking the flags needed to use pthreads')
+
+       # The ordering *is* (sometimes) important.  Some notes on the
+       # individual items follow:
+       # (none): in case threads are in libc; should be tried before -Kthread and
+       #       other compiler flags to prevent continual compiler warnings
+       # -lpthreads: AIX (must check this before -lpthread)
+       # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
+       # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
+       # -llthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
+       # -pthread: GNU Linux/GCC (kernel threads), BSD/GCC (userland threads)
+       # -pthreads: Solaris/GCC
+       # -mthreads: MinGW32/GCC, Lynx/GCC
+       # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
+       #      doesn't hurt to check since this sometimes defines pthreads too;
+       #      also defines -D_REENTRANT)
+       #      ... -mt is also the pthreads flag for HP/aCC
+       # -lpthread: GNU Linux, etc.
+       # --thread-safe: KAI C++
+       if Utils.unversioned_sys_platform() == "sunos":
+               # On Solaris (at least, for some versions), libc contains stubbed
+               # (non-functional) versions of the pthreads routines, so link-based
+               # tests will erroneously succeed.  (We need to link with -pthreads/-mt/
+               # -lpthread.)  (The stubs are missing pthread_cleanup_push, or rather
+               # a function called by this macro, so we could check for that, but
+               # who knows whether they'll stub that too in a future libc.)  So,
+               # we'll just look for -pthreads and -lpthread first:
+               boost_pthread_flags = ["-pthreads", "-lpthread", "-mt", "-pthread"]
+       else:
+               boost_pthread_flags = ["", "-lpthreads", "-Kthread", "-kthread", "-llthread", "-pthread",
+                                                          "-pthreads", "-mthreads", "-lpthread", "--thread-safe", "-mt"]
+
+       for boost_pthread_flag in boost_pthread_flags:
+               try:
+                       self.env.stash()
+                       self.env.append_value('CXXFLAGS_%s' % var, boost_pthread_flag)
+                       self.env.append_value('LINKFLAGS_%s' % var, boost_pthread_flag)
+                       self.check_cxx(code=PTHREAD_CODE, msg=None, use=var, execute=False)
+
+                       self.end_msg(boost_pthread_flag)
+                       return
+               except self.errors.ConfigurationError:
+                       self.env.revert()
+       self.end_msg('None')
 
 @conf
 def check_boost(self, *k, **kw):
@@ -333,6 +403,11 @@ def check_boost(self, *k, **kw):
 
        var = kw.get('uselib_store', 'BOOST')
 
+       self.find_program('dpkg-architecture', var='DPKG_ARCHITECTURE', mandatory=False)
+       if self.env.DPKG_ARCHITECTURE:
+               deb_host_multiarch = self.cmd_and_log([self.env.DPKG_ARCHITECTURE[0], '-qDEB_HOST_MULTIARCH'])
+               BOOST_LIBS.insert(0, '/usr/lib/%s' % deb_host_multiarch.strip())
+
        self.start_msg('Checking boost includes')
        self.env['INCLUDES_%s' % var] = inc = self.boost_get_includes(**params)
        versions = self.boost_get_version(inc)
@@ -360,32 +435,26 @@ def check_boost(self, *k, **kw):
                Logs.pprint('CYAN', '   shared libs : %s' % libs)
                Logs.pprint('CYAN', '   static libs : %s' % stlibs)
 
+       def has_shlib(lib):
+               return params['lib'] and lib in params['lib']
+       def has_stlib(lib):
+               return params['stlib'] and lib in params['stlib']
+       def has_lib(lib):
+               return has_shlib(lib) or has_stlib(lib)
+       if has_lib('thread'):
+               # not inside try_link to make check visible in the output
+               self._check_pthread_flag(k, kw)
 
        def try_link():
-               if (params['lib'] and 'system' in params['lib']) or \
-                       params['stlib'] and 'system' in params['stlib']:
+               if has_lib('system'):
                        self.check_cxx(fragment=BOOST_ERROR_CODE, use=var, execute=False)
-               if (params['lib'] and 'thread' in params['lib']) or \
-                       params['stlib'] and 'thread' in params['stlib']:
+               if has_lib('thread'):
                        self.check_cxx(fragment=BOOST_THREAD_CODE, use=var, execute=False)
-
-               def is_log_mt():
-                       '''Check if found boost_log library is multithread-safe'''
-                       for lib in libs:
-                               if lib.startswith('boost_log'):
-                                       lib_log = lib
-                                       break
-                       return '-mt' in lib_log
-
-               if params['lib'] and 'log' in params['lib']:
-                       self.env['DEFINES_%s' % var] += ['BOOST_LOG_DYN_LINK']
-                       if not is_log_mt():
-                               self.env['DEFINES_%s' % var] += ['BOOST_LOG_NO_THREADS']
-                       self.check_cxx(fragment=BOOST_LOG_CODE, use=var, execute=False)
-               if params['stlib'] and 'log' in params['stlib']:
-                       # Static linking is assumed by default
-                       if not is_log_mt():
+               if has_lib('log'):
+                       if not has_lib('thread'):
                                self.env['DEFINES_%s' % var] += ['BOOST_LOG_NO_THREADS']
+                       if has_shlib('log'):
+                               self.env['DEFINES_%s' % var] += ['BOOST_LOG_DYN_LINK']
                        self.check_cxx(fragment=BOOST_LOG_CODE, use=var, execute=False)
 
        if params.get('linkage_autodetect', False):
index 28b00e538a3797d925fcc002dd88da2ff7d6cc87..c4f26fd070d9f4725c6d822f694d2adfe99b073f 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2015
index 87a4e2c3b4abc7b678dea071376ede908e8ea806..cdf8ed097e90a21bc5fad699d8846daff25cac4f 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2013 (ita)
index 10625d1e26f01e3075a8d232db5ca95e73eec5b2..a6d9ac83114dfdd9f0409f13daffd53ae287fd26 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 # Calle Rosenquist, 2017 (xbreak)
index 04a3c79cff0fe6a07bdc993837979f79a6f91ec0..6e3eaf7bb64921e45cc829831512bbc672da8560 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 # harald at klimachs.de
index 407bcf5a8939491970a086a8051a1add61b3dc61..ce9e1a400b9409640fcd635a0921adba3ed999c8 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2006-2010 (ita)
index b23d770b43b8d2676817af1e14b831b72bbc1748..e1ac494f4484fa8325107fa79440dc558249214d 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # -*- coding: utf-8 vi:ts=4:noexpandtab
 
index 1ca665c1b0d0fe45df2862f7ff68d7774aa410c8..96bfae4f34599f21b5ecd7c1f20fc9f06af1ee66 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 # harald at klimachs.de
index a26f6342e9e2cd0b40f00cbd6b6b67ccba437d0d..a5acce7737525ad00a726a01560a7828a571e190 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Anton Feldmann, 2012
index d42c5ccfa86f703f5a3a02038e3c4d39f58d0db8..47b1189f476728f73a9f439faa658ab0ecd3827e 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/python
 # -*- coding: utf-8 -*-
 # Tool to extend c_config.check_cfg()
index 756180f8bb62bb448b1e1f841e01c748f23fdb68..4d9b5e275aedc6c46ba9df5d89a7f193c5ae0969 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Christoph Koke, 2013
@@ -23,11 +19,6 @@ from waflib import Logs, TaskGen, Task
 
 Task.Task.keep_last_cmd = True
 
-if sys.hexversion >= 0x3030000:
-       quote = shlex.quote
-else:
-       quote = pipes.quote
-
 @TaskGen.feature('c', 'cxx')
 @TaskGen.after_method('process_use')
 def collect_compilation_db_tasks(self):
@@ -60,10 +51,9 @@ def write_compilation_database(ctx):
                directory = getattr(task, 'cwd', ctx.variant_dir)
                f_node = task.inputs[0]
                filename = os.path.relpath(f_node.abspath(), directory)
-               cmd = " ".join(map(quote, cmd))
                entry = {
                        "directory": directory,
-                       "command": cmd,
+                       "arguments": cmd,
                        "file": filename,
                }
                clang_db[filename] = entry
@@ -93,4 +83,3 @@ for x in ('c', 'cxx'):
 
        setattr(t, 'old_runnable_status', getattr(t, 'runnable_status', None))
        setattr(t, 'runnable_status', runnable_status)
-
index df5949a763f1d9c72f0511ce164a1ae4b67a4d3e..fd04a91d94b601c496c54704620db309a53954b9 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 # CodeLite Project
index 73b001768c5888ccf83e556879eef42bd6ceca59..b68c5ebf2df1cc46daf2ca9d6ee0d44c8ad3d45d 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 
index 8138b39d63abbe7ea2437fa1e7babba68a543f47..f89ccbdb140a94b7ea6bdaa52a93b2a7e546dc98 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 
index ec6a16493a3609732288d46e1a2e75acc6980e2c..0e74df8506c5e7354dea598e42bbadb3937aef16 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2010 (ita)
index 4a4e59da5f43ebb1d9d71574bb54c320f7b98789..43dc544df737f9ce61b7896e7d5498930abf68f5 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # -*- encoding: utf-8 -*-
 # Michel Mooij, michel.mooij7@gmail.com
index eba979b53289f151c9fd761a580a172f2a9059ca..fc914c2450bbe5e6dea44839884a16b93129f98d 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 #
index b6a4036f58ef7c90712da80f1c4be21bd169976b..309f53b034df92be728bda9208b92e9fd1dea9e6 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/python
 # -*- coding: utf-8 vi:ts=4:noexpandtab
 # Tool to provide dedicated variables for cross-compilation
index 20e94d051d8932dd2f46e08d3b8dad1b38178ace..2b2c7ccc265509bf5b28dc2df6d895211f6019c9 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2010-2015
index d1b85bc56e6203d026e94b28956ce83b6d924c32..c1a57c04d934156fa512eab7de11f447bd0b21bf 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Jérôme Carretero, 2011 (zougloub)
index a8dd2d2eb4263946da5f878d578704909ae3d0ec..09a31a6d437ae05c9cbc85fd0a199aaf3f252b7b 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 
@@ -406,7 +402,6 @@ class package_reader(Context.Context):
                        if x.pkgname == self.myproject:
                                continue
                        yield x
-               raise StopIteration
 
        def execute(self):
                self.compute_dependencies()
index f6e951b8f322f35eab7d65beb6247adef23cd310..28f56e9c7d74aff513b06f7c3712c98f8f3a1cde 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: UTF-8
 # Thomas Nagy 2008-2010 (ita)
@@ -194,13 +190,13 @@ class tar(Task.Task):
 @feature('doxygen')
 def process_doxy(self):
        if not getattr(self, 'doxyfile', None):
-               self.generator.bld.fatal('no doxyfile??')
+               self.bld.fatal('no doxyfile variable specified??')
 
        node = self.doxyfile
        if not isinstance(node, Node.Node):
                node = self.path.find_resource(node)
        if not node:
-               raise ValueError('doxygen file not found')
+               self.bld.fatal('doxygen file %s not found' % self.doxyfile)
 
        # the task instance
        dsk = self.create_task('doxygen', node)
index 0e226b1d7761dcea2c8cfda90fe85a3fc46cb989..b94d4823581898597f71e6c86110fc7049d27643 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 # Matt Clarkson, 2012
index 9209a2546b61fe534339b0ac595e75ef14fd7bb0..bb787416e9fbe55feeedcff511a697023b775033 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 # Eclipse CDT 5.0 generator for Waf
@@ -27,6 +23,8 @@ oe_cdt = 'org.eclipse.cdt'
 cdt_mk = oe_cdt + '.make.core'
 cdt_core = oe_cdt + '.core'
 cdt_bld = oe_cdt + '.build.core'
+extbuilder_dir = '.externalToolBuilders'
+extbuilder_name = 'Waf_Builder.launch'
 
 class eclipse(Build.BuildContext):
        cmd = 'eclipse'
@@ -44,6 +42,10 @@ class eclipse(Build.BuildContext):
                appname = getattr(Context.g_module, Context.APPNAME, os.path.basename(self.srcnode.abspath()))
                self.create_cproject(appname, pythonpath=self.env['ECLIPSE_PYTHON_PATH'])
 
+       # Helper to dump the XML document content to XML with UTF-8 encoding
+       def write_conf_to_xml(self, filename, document):
+               self.srcnode.make_node(filename).write(document.toprettyxml(encoding='UTF-8'), flags='wb')
+
        def create_cproject(self, appname, workspace_includes=[], pythonpath=[]):
                """
                Create the Eclipse CDT .project and .cproject files
@@ -57,6 +59,7 @@ class eclipse(Build.BuildContext):
                source_dirs = []
                cpppath = self.env['CPPPATH']
                javasrcpath = []
+               javalibpath = []
                includes = STANDARD_INCLUDES
                if sys.platform != 'win32':
                        cc = self.env.CC or self.env.CXX
@@ -79,36 +82,43 @@ class eclipse(Build.BuildContext):
                                if not isinstance(tg, TaskGen.task_gen):
                                        continue
 
+                               tg.post()
+
                                # Add local Python modules paths to configuration so object resolving will work in IDE
+                               # This may also contain generated files (ie. pyqt5 or protoc) that get picked from build
                                if 'py' in tg.features:
                                        pypath = tg.path.relpath()
                                        py_installfrom = getattr(tg, 'install_from', None)
-                                       if py_installfrom:
-                                               pypath += os.sep + py_installfrom
-                                       pythonpath.append(pypath)
+                                       if isinstance(py_installfrom, Node.Node):
+                                               pypath = py_installfrom.path_from(self.root.make_node(self.top_dir))
+                                       if pypath not in pythonpath:
+                                               pythonpath.append(pypath)
                                        haspython = True
 
-
                                # Add Java source directories so object resolving works in IDE
-                               if 'java' in tg.features:
+                               # This may also contain generated files (ie. protoc) that get picked from build
+                               if 'javac' in tg.features:
                                        java_src = tg.path.relpath()
-                                       java_srcdir = getattr(tg, 'srcdir', None)
+                                       java_srcdir = getattr(tg.javac_task, 'srcdir', None)
                                        if java_srcdir:
                                                if isinstance(java_srcdir, Node.Node):
                                                        java_srcdir = [java_srcdir]
                                                for x in Utils.to_list(java_srcdir):
-                                                       if isinstance(x, Node.Node):
-                                                               x = x.name
-                                                       if java_src == '.':
-                                                               this_src = x
-                                                       else:
-                                                               this_src = java_src + os.sep + x
-                                                       javasrcpath.append(this_src)
+                                                       x = x.path_from(self.root.make_node(self.top_dir))
+                                                       if x not in javasrcpath:
+                                                               javasrcpath.append(x)
                                        else:
-                                               javasrcpath.append(java_src)
+                                               if java_src not in javasrcpath:
+                                                       javasrcpath.append(java_src)
                                        hasjava = True
 
-                               tg.post()
+                                       # Check if there are external dependencies and add them as external jar so they will be resolved by Eclipse
+                                       usedlibs=getattr(tg, 'use', [])
+                                       for x in Utils.to_list(usedlibs):
+                                               for cl in Utils.to_list(tg.env['CLASSPATH_'+x]):
+                                                       if cl not in javalibpath:
+                                                               javalibpath.append(cl)
+
                                if not getattr(tg, 'link_task', None):
                                        continue
 
@@ -130,23 +140,23 @@ class eclipse(Build.BuildContext):
 
                                        hasc = True
 
-               project = self.impl_create_project(sys.executable, appname, hasc, hasjava, haspython)
-               self.srcnode.make_node('.project').write(project.toprettyxml())
+               waf_executable = os.path.abspath(sys.argv[0])
+               project = self.impl_create_project(sys.executable, appname, hasc, hasjava, haspython, waf_executable)
+               self.write_conf_to_xml('.project', project)
 
                if hasc:
-                       waf = os.path.abspath(sys.argv[0])
-                       project = self.impl_create_cproject(sys.executable, waf, appname, workspace_includes, cpppath, source_dirs)
-                       self.srcnode.make_node('.cproject').write(project.toprettyxml())
+                       project = self.impl_create_cproject(sys.executable, waf_executable, appname, workspace_includes, cpppath, source_dirs)
+                       self.write_conf_to_xml('.cproject', project)
 
                if haspython:
                        project = self.impl_create_pydevproject(sys.path, pythonpath)
-                       self.srcnode.make_node('.pydevproject').write(project.toprettyxml())
+                       self.write_conf_to_xml('.pydevproject', project)
 
                if hasjava:
-                       project = self.impl_create_javaproject(javasrcpath)
-                       self.srcnode.make_node('.classpath').write(project.toprettyxml())
+                       project = self.impl_create_javaproject(javasrcpath, javalibpath)
+                       self.write_conf_to_xml('.classpath', project)
 
-       def impl_create_project(self, executable, appname, hasc, hasjava, haspython):
+       def impl_create_project(self, executable, appname, hasc, hasjava, haspython, waf_executable):
                doc = Document()
                projectDescription = doc.createElement('projectDescription')
                self.add(doc, projectDescription, 'name', appname)
@@ -154,16 +164,47 @@ class eclipse(Build.BuildContext):
                self.add(doc, projectDescription, 'projects')
                buildSpec = self.add(doc, projectDescription, 'buildSpec')
                buildCommand = self.add(doc, buildSpec, 'buildCommand')
-               self.add(doc, buildCommand, 'name', oe_cdt + '.managedbuilder.core.genmakebuilder')
                self.add(doc, buildCommand, 'triggers', 'clean,full,incremental,')
                arguments = self.add(doc, buildCommand, 'arguments')
-               # the default make-style targets are overwritten by the .cproject values
-               dictionaries = {
-                               cdt_mk + '.contents': cdt_mk + '.activeConfigSettings',
-                               cdt_mk + '.enableAutoBuild': 'false',
-                               cdt_mk + '.enableCleanBuild': 'true',
-                               cdt_mk + '.enableFullBuild': 'true',
-                               }
+               dictionaries = {}
+
+               # If CDT is present, instruct this one to call waf as it is more flexible (separate build/clean ...)
+               if hasc:
+                       self.add(doc, buildCommand, 'name', oe_cdt + '.managedbuilder.core.genmakebuilder')
+                       # the default make-style targets are overwritten by the .cproject values
+                       dictionaries = {
+                                       cdt_mk + '.contents': cdt_mk + '.activeConfigSettings',
+                                       cdt_mk + '.enableAutoBuild': 'false',
+                                       cdt_mk + '.enableCleanBuild': 'true',
+                                       cdt_mk + '.enableFullBuild': 'true',
+                                       }
+               else:
+                       # Otherwise for Java/Python an external builder tool is created that will call waf build
+                       self.add(doc, buildCommand, 'name', 'org.eclipse.ui.externaltools.ExternalToolBuilder')
+                       dictionaries = {
+                                       'LaunchConfigHandle': '<project>/%s/%s'%(extbuilder_dir, extbuilder_name),
+                                       }
+                       # The definition is in a separate directory XML file
+                       try:
+                               os.mkdir(extbuilder_dir)
+                       except OSError:
+                               pass    # Ignore error if already exists
+
+                       # Populate here the external builder XML calling waf
+                       builder = Document()
+                       launchConfiguration = doc.createElement('launchConfiguration')
+                       launchConfiguration.setAttribute('type', 'org.eclipse.ui.externaltools.ProgramBuilderLaunchConfigurationType')
+                       self.add(doc, launchConfiguration, 'booleanAttribute', {'key': 'org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND', 'value': 'false'})
+                       self.add(doc, launchConfiguration, 'booleanAttribute', {'key': 'org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED', 'value': 'true'})
+                       self.add(doc, launchConfiguration, 'stringAttribute', {'key': 'org.eclipse.ui.externaltools.ATTR_LOCATION', 'value': waf_executable})
+                       self.add(doc, launchConfiguration, 'stringAttribute', {'key': 'org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS', 'value': 'full,incremental,'})
+                       self.add(doc, launchConfiguration, 'stringAttribute', {'key': 'org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS', 'value': 'build'})
+                       self.add(doc, launchConfiguration, 'stringAttribute', {'key': 'org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY', 'value': '${project_loc}'})
+                       builder.appendChild(launchConfiguration)
+                       # And write the XML to the file references before
+                       self.write_conf_to_xml('%s%s%s'%(extbuilder_dir, os.path.sep, extbuilder_name), builder)
+
+
                for k, v in dictionaries.items():
                        self.addDictionary(doc, arguments, k, v)
 
@@ -187,7 +228,7 @@ class eclipse(Build.BuildContext):
                doc.appendChild(projectDescription)
                return doc
 
-       def impl_create_cproject(self, executable, waf, appname, workspace_includes, cpppath, source_dirs=[]):
+       def impl_create_cproject(self, executable, waf_executable, appname, workspace_includes, cpppath, source_dirs=[]):
                doc = Document()
                doc.appendChild(doc.createProcessingInstruction('fileVersion', '4.0.0'))
                cconf_id = cdt_core + '.default.config.1'
@@ -234,8 +275,8 @@ class eclipse(Build.BuildContext):
 
                self.add(doc, toolChain, 'targetPlatform', {'binaryParser': 'org.eclipse.cdt.core.ELF', 'id': cdt_bld + '.prefbase.toolchain.1', 'name': ''})
 
-               waf_build = '"%s" %s'%(waf, eclipse.fun)
-               waf_clean = '"%s" clean'%(waf)
+               waf_build = '"%s" %s'%(waf_executable, eclipse.fun)
+               waf_clean = '"%s" clean'%(waf_executable)
                self.add(doc, toolChain, 'builder',
                                        {'autoBuildTarget': waf_build,
                                         'command': executable,
@@ -295,7 +336,7 @@ class eclipse(Build.BuildContext):
                buildTargets = self.add(doc, storageModule, 'buildTargets')
                def addTargetWrap(name, runAll):
                        return self.addTarget(doc, buildTargets, executable, name,
-                                                               '"%s" %s'%(waf, name), runAll)
+                                                               '"%s" %s'%(waf_executable, name), runAll)
                addTargetWrap('configure', True)
                addTargetWrap('dist', False)
                addTargetWrap('install', False)
@@ -337,7 +378,7 @@ class eclipse(Build.BuildContext):
                doc.appendChild(pydevproject)
                return doc
 
-       def impl_create_javaproject(self, javasrcpath):
+       def impl_create_javaproject(self, javasrcpath, javalibpath):
                # create a .classpath file for java usage
                doc = Document()
                javaproject = doc.createElement('classpath')
@@ -346,6 +387,11 @@ class eclipse(Build.BuildContext):
                                self.add(doc, javaproject, 'classpathentry',
                                        {'kind': 'src', 'path': i})
 
+               if javalibpath:
+                       for i in javalibpath:
+                               self.add(doc, javaproject, 'classpathentry',
+                                       {'kind': 'lib', 'path': i})
+
                self.add(doc, javaproject, 'classpathentry', {'kind': 'con', 'path': 'org.eclipse.jdt.launching.JRE_CONTAINER'})
                self.add(doc, javaproject, 'classpathentry', {'kind': 'output', 'path': self.bldnode.name })
                doc.appendChild(javaproject)
index b2aa5a16579f0c83cbdf2bb311b1d32c44a003b3..49f6d5b475bbb55beec4d942ec967ea618909533 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2010 (ita)
index bd9b2b833dc7bb0be24545b3359c22c9c5ee2894..b3af513b2550f1f014cbb275c20a07a1a4c01185 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2017-2018 (ita)
index c58e7ac0181ef84125316389da538945b3f6d6c3..cca18101eadbce02ce10c3c3fe5a65c7d1542ba7 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 # harald at klimachs.de
index 0ae9f7ec91a7d2c480218b16d0246ad109c39a87..ec2906742b462e5af3f905cd5538eeb51cf09c54 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 # harald at klimachs.de
index 1779e1988f51e2e9803221e2343091cf7d5f0fb7..edcb218bc316068c97dfc33f7a7ab2d815902db6 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 # harald at klimachs.de
index 2d0ca71ab396d3c4972074ca9caec325e67341ab..4b70f3dcccd3cc92966c8f964804e2e8de0e0064 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 # harald at klimachs.de
index 6001b2083a6431d788e54b824884afb979232d5b..413719f43ec7777e0c7dffd670cc3017aa9fb6c2 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 # harald at klimachs.de
index bc62279a3060a146c753f5f25d8fbcdd85d2a4c7..afb2817ba67ac50020cb6886681e697b45b7dc71 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 # harald at klimachs.de
index 8880d31c58ec2dc73b0b848c615b82b64e885cf7..53766df8fc105064a488b48fcedb9f5aec88604f 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 # harald at klimachs.de
index fe8ea4539ce71fda34667b8225b113a39955e6e9..5a3da034187102f74547fe29707df8140bfc4c6d 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 # harald at klimachs.de
index a295998e9e6db9e0184fd4d1a96e244bdfbe8bfb..1393b511d63b7707e9c772ddc69361ade2685173 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/python
 # -*- coding: utf-8 -*-
 # Tool to embed file into objects
index caa8afdfbc03f787197a68fea89878673a778403..4814a35b94d2e0c14c1d3663a46f45aa64c7785a 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/python
 # encoding: utf-8
 # Grygoriy Fuchedzhy 2009
index 59d557a1cf744b83f2be7258d18c34b90031d974..f27e5258dddd75c3df2c3e94cd44cb53ce8f4cf1 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 #
index d31e33a45970717b241f7f6d6a20ca098a8954f2..1b8f398feb6719deaaed70c11d6609b514d2771f 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2011 (ita)
index 6325de4a40b4c6016ef926e703965e1529f98499..c67e70be296ead09583df253e0a05bbb4f2e0840 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2011 (ita)
index 81f60d5aaca3df618ec1a1ecb7460c6db5e08edf..d9758ab34d5a1b07c59933c6d0464dbdde12be46 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2008-2010 (ita)
diff --git a/third_party/waf/waflib/extras/gdbus.py b/third_party/waf/waflib/extras/gdbus.py
new file mode 100644 (file)
index 0000000..0e0476e
--- /dev/null
@@ -0,0 +1,87 @@
+#!/usr/bin/env python
+# encoding: utf-8
+# Copyright Garmin International or its subsidiaries, 2018
+#
+# Heavily based on dbus.py
+
+"""
+Compiles dbus files with **gdbus-codegen**
+Typical usage::
+       def options(opt):
+               opt.load('compiler_c gdbus')
+       def configure(conf):
+               conf.load('compiler_c gdbus')
+       def build(bld):
+               tg = bld.program(
+                       includes = '.',
+                       source = bld.path.ant_glob('*.c'),
+                       target = 'gnome-hello')
+               tg.add_gdbus_file('test.xml', 'com.example.example.', 'Example')
+"""
+
+from waflib import Task, Errors, Utils
+from waflib.TaskGen import taskgen_method, before_method
+
+@taskgen_method
+def add_gdbus_file(self, filename, prefix, namespace, export=False):
+       """
+       Adds a dbus file to the list of dbus files to process. Store them in the attribute *dbus_lst*.
+       :param filename: xml file to compile
+       :type filename: string
+       :param prefix: interface prefix (--interface-prefix=prefix)
+       :type prefix: string
+       :param mode: C namespace (--c-namespace=namespace)
+       :type mode: string
+       :param export: Export Headers?
+       :type export: boolean
+       """
+       if not hasattr(self, 'gdbus_lst'):
+               self.gdbus_lst = []
+       if not 'process_gdbus' in self.meths:
+               self.meths.append('process_gdbus')
+       self.gdbus_lst.append([filename, prefix, namespace, export])
+
+@before_method('process_source')
+def process_gdbus(self):
+       """
+       Processes the dbus files stored in the attribute *gdbus_lst* to create :py:class:`gdbus_binding_tool` instances.
+       """
+       output_node = self.path.get_bld().make_node(['gdbus', self.get_name()])
+       sources = []
+
+       for filename, prefix, namespace, export in getattr(self, 'gdbus_lst', []):
+               node = self.path.find_resource(filename)
+               if not node:
+                       raise Errors.WafError('file not found ' + filename)
+               c_file = output_node.find_or_declare(node.change_ext('.c').name)
+               h_file = output_node.find_or_declare(node.change_ext('.h').name)
+               tsk = self.create_task('gdbus_binding_tool', node, [c_file, h_file])
+               tsk.cwd = output_node.abspath()
+
+               tsk.env.GDBUS_CODEGEN_INTERFACE_PREFIX = prefix
+               tsk.env.GDBUS_CODEGEN_NAMESPACE = namespace
+               tsk.env.GDBUS_CODEGEN_OUTPUT = node.change_ext('').name
+               sources.append(c_file)
+
+       if sources:
+               output_node.mkdir()
+               self.source = Utils.to_list(self.source) + sources
+               self.includes = [output_node] + self.to_incnodes(getattr(self, 'includes', []))
+               if export:
+                       self.export_includes = [output_node] + self.to_incnodes(getattr(self, 'export_includes', []))
+
+class gdbus_binding_tool(Task.Task):
+       """
+       Compiles a dbus file
+       """
+       color   = 'BLUE'
+       ext_out = ['.h', '.c']
+       run_str = '${GDBUS_CODEGEN} --interface-prefix ${GDBUS_CODEGEN_INTERFACE_PREFIX} --generate-c-code ${GDBUS_CODEGEN_OUTPUT} --c-namespace ${GDBUS_CODEGEN_NAMESPACE} --c-generate-object-manager ${SRC[0].abspath()}'
+       shell = True
+
+def configure(conf):
+       """
+       Detects the program gdbus-codegen and sets ``conf.env.GDBUS_CODEGEN``
+       """
+       conf.find_program('gdbus-codegen', var='GDBUS_CODEGEN')
+
index 629ccdca8eddda4065ac20dd4c49870f1324a699..b4fa3b9a72e2f4289227aa71631400533c18d8ca 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Ali Sabil, 2007
index df7509a6d11a4e9dbaf8f4ea57fb7c9e4593a31f..6078e38bde11ee7c91e2065ea693bba75dec227b 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/python
 # -*- coding: utf-8 -*-
 # Halide code generation tool
index 0c315745353fe81a28adb96be0251a6a4825544b..979b8d8242d69a2cf7a2cfe2c79bb578f5e1bd0b 100755 (executable)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 # Federico Pellegrin, 2017 (fedepell)
index 13ac82f4049bedf35b7e27205fee080f5aec915d..e49a9ec00e1af8deadd618c417e3a0b6acfa2eed 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2006-2010 (ita)
index 6020b45f7a92f4003f0ee282caa324115fc0ef7b..b2507e17a105f2acf0ae55072170003a8751899e 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2011 (ita)
index 7b75d5511baaa88f1bb4f6c3a6261d97a1b3fae1..933d9cacb2b1d67cb4ebc0e2e78cf7375d6cb9af 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2011 (ita)
index c81e0e317adb6352e5fe9181b18cf12241b41252..43e6cf911f288d40d1dbd767180e43f67eb73690 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # Issue 1185 ultrix gmail com
 
index a6ea52af76b040cc7c604b4a05d906c4629cdfe7..fc1ecd4d08c20f6b73854b3b36fb34cbfb85e959 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Copyright Garmin International or its subsidiaries, 2012-2013
index b12d9c068e5c636f39aa92414a4e20ac8aa404b2..8aa2db0b751ccb9ea957a1a1011714bd82a477e8 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 # Avalanche Studios 2009-2011
index ffd40d87f42740adb9ffb3e7ba1924e0c66ef92d..dc490485acfc777ef2c20c0c32ae1ef039d81986 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2011-2015 (ita)
index baa54c0bd54abf16178d738cfdd30b2e3cbf9e87..82d8359ecf71c75ba20e9dab9acd83010fb43ca2 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/python
 # Grygoriy Fuchedzhy 2010
 
index 56f851e72cf9ab0bddf257ee743c1b3b77ec3dcc..afe73c0ca3e910d69692c22078ed2ddc9c66870e 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2006-2010 (ita)
index 669aa170bd57ee7161bb8920425d5d8dbf98d696..c06498eba8f567830e4af512da1664fd93922b82 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2011
index d365024e205b13d1ceaf8aca8a96482e13289989..35883a3dd74b9bedb5e5b18cfc12c948573c686b 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2007-2010 (ita)
index 98b23f47fe469cad55cde3e2e18ecc59f5dbaf2f..103e752838c674e0733f742077b2353125086d07 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 # Alexander Afanasyev (UCLA), 2014
@@ -94,8 +90,8 @@ def apply_pch(self):
 
        if getattr(self, 'name', None):
                try:
-                       task = self.bld.pch_tasks[self.name]
-                       self.bld.fatal("Duplicated 'pch' task with name %r" % self.name)
+                       task = self.bld.pch_tasks["%s.%s" % (self.name, self.idx)]
+                       self.bld.fatal("Duplicated 'pch' task with name %r" % "%s.%s" % (self.name, self.idx))
                except KeyError:
                        pass
 
@@ -108,7 +104,7 @@ def apply_pch(self):
 
        self.pch_task = task
        if getattr(self, 'name', None):
-               self.bld.pch_tasks[self.name] = task
+               self.bld.pch_tasks["%s.%s" % (self.name, self.idx)] = task
 
 @TaskGen.feature('cxx')
 @TaskGen.after_method('process_source', 'propagate_uselib_vars')
index 278662f805109136eab5c7639891f02fc9cda709..676beedb25b22cd3e20752dc0b0a4d3cb33700fa 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 #
index ba50e172bc0b219f6ae7ccd0fe7913e76d822289..9790b9cf8ba1f914de3a60836d63f004cbbfc0b9 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Antoine Dechaume 2011
index 7d077d74789a0624ff2a3546de5c37a67bef9034..eae121c403697ea25d84756157c54f9bda911ef5 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Antoine Dechaume 2011
index 2d7e5cedb1f249b8dffc34e19e4a0f560a7fb22a..764abecfc304fd1d250cf7ea134712a5cdc5634a 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # per rosengren 2011
 
index cb16e858182618f14b4c56d40fa248a9ffdec379..f3cb4d86ab84fcdcf87b5ebc672a472f5b65034c 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Philipp Bender, 2012
@@ -128,6 +124,9 @@ class protoc(Task):
                                                        names.append(dep)
 
                parse_node(node)
+               # Add also dependencies path to INCPATHS so protoc will find the included file
+               for deppath in nodes:
+                       self.env.append_value('INCPATHS', deppath.parent.bldpath())
                return (nodes, names)
 
 @extension('.proto')
@@ -195,9 +194,9 @@ def process_protoc(self, node):
                        nodename += javacn + '.java'
                else:
                        if self.env.PROTOC_MAJOR > '2' and node.abspath()[node.abspath().rfind(os.sep)+1:node.abspath().rfind('.')].title() in messages:
-                               nodename += node.abspath()[node.abspath().rfind(os.sep)+1:node.abspath().rfind('.')].title() + 'OuterClass.java'
+                               nodename += node.abspath()[node.abspath().rfind(os.sep)+1:node.abspath().rfind('.')].title().replace('_','') + 'OuterClass.java'
                        else:
-                               nodename += node.abspath()[node.abspath().rfind(os.sep)+1:node.abspath().rfind('.')].title() + '.java'
+                               nodename += node.abspath()[node.abspath().rfind(os.sep)+1:node.abspath().rfind('.')].title().replace('_','') + '.java'
 
                java_node = node.parent.find_or_declare(nodename)
                out_nodes.append(java_node)
@@ -220,9 +219,14 @@ def process_protoc(self, node):
        # For C++ standard include files dirs are used,
        # but this doesn't apply to Python for example
        for incpath in getattr(self, 'protoc_includes', []):
-               incdirs.append(self.bld.path.find_node(incpath).bldpath())
+               incdirs.append(self.path.find_node(incpath).bldpath())
        tsk.env.PROTOC_INCPATHS = incdirs
 
+       # PR2115: protoc generates output of .proto files in nested
+       # directories  by canonicalizing paths. To avoid this we have to pass
+       # as first include the full directory file of the .proto file
+       tsk.env.prepend_value('INCPATHS', node.parent.bldpath())
+
        use = getattr(self, 'use', '')
        if not 'PROTOBUF' in use:
                self.use = self.to_list(use) + ['PROTOBUF']
index 0190f2527d7ca91befe7f59a020601ef2b8e6c4f..c21dfa7204898be5470a38da98d691b4ba96f256 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Federico Pellegrin, 2016-2018 (fedepell) adapted for Python
index c4ed4c574daa86504cdbc59d9fde34a5ffb7f528..7dd5a1a087a31e5d35395f9d3d0977c3901a0a9b 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 # Calle Rosenquist, 2016-2018 (xbreak)
index db4467df3962407a922cb6a984c73504bedd0df6..1158124da96613bb9b0d86051ac78b40cb652fd3 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Jérôme Carretero 2011 (zougloub)
index c310046188f59eba00eaffd57dd7e4f8656a3dc1..90cae7e0ae5550066780750aa6ae803aca912af8 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2006-2010 (ita)
index 50ac5b9d41b9b008c647f6a8c39d9ea4bda366b5..7e821f4166c51e3e43852d3ff9108ae33432d3e2 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 
index 9bf6e2d71c6a9177d6e76e3a12ceb115740d202d..3b038f772b544444c126f3af8151b0431c2f7539 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Remote Builds tool using rsync+ssh
index ead38ef50b52ca6992bda33c959042f47bd1b23e..caf4d318bb074e0b9cc835515368572a79d3e78d 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 
index 8d167c15e13f584abf074c70b6d7a77027f4db1c..561e06219da1d52ca00e7a461e39df02548798d0 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Laurent Birtz, 2011
index 1703eeac3488af5208cdff4f48a43fbb9e713934..f3c3a5eba426a37dc5f4f1275a9d859b7601b579 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Jérôme Carretero, 2013 (zougloub)
index 529cc08ae9e5542afac07d0d887160c08b20a142..f3c58122c9b73cee10a955449ed4a55003ab7c70 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Hans-Martin von Gaudecker, 2012
index bc6db0027ab5afa678a1a0eaaec4455c2d57015c..b5f27ebe0822c8168c9e89f65d89a8846c9e5439 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Hans-Martin von Gaudecker, 2012
index 845a3ced798181b96376d3c85be3c93abf1b6c3b..367038114ca3ea78c8361befeba28e24597bbecc 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Hans-Martin von Gaudecker, 2012
index 8dd81825e9c18cbabd7ad53def15bca7b5472cd9..b0d8f2b2cde9773e83e3368a681bbc27f67dd42b 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Hans-Martin von Gaudecker, 2012
index a7220068b96bf5f6a176422be025f67931bce7b7..754c6148dec4458d4b349277399e6b00afb6ec25 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Mark Coggeshall, 2010
index a9e1ddf6d62e0a9102404a1fc834aea9314902ce..005eb074f9d1efaf3c09f6e238c26c541be2e440 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/python
 # encoding: utf-8
 # vim: tabstop=4 noexpandtab
index bdc2bbbee5954bb4cd629a3677fde5e01cb655c8..a9880f023417dc6fb994be3532712e6b5b5238ae 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2010 (ita)
index e3014cdf07048f81c459dc271d961171213f6895..ec7880bf9d70bf8f0ee2c395539c52af12978720 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # Thomas Nagy, 2011 (ita)
 
@@ -26,7 +22,7 @@ import waflib.Tools.cxx
 
 @extension(*waflib.Tools.qt4.EXT_QT4)
 def cxx_hook(self, node):
-       self.create_compiled_task('cxx_qt', node)
+       return self.create_compiled_task('cxx_qt', node)
 
 class cxx_qt(Task.classes['cxx']):
        def runnable_status(self):
index ed453848786ac50bd917c939797bc41b818adfa7..50c777f28c50be5e6e96bb01adaefba45439d2cd 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # per rosengren 2011
 
index 991af82cd6142eb605a786f658ec235f2ec3b86c..cac3f469c941bbaea2e63341268af8831a7e148b 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: UTF-8
 # Thomas Nagy, 2006-2015 (ita)
index 4be44248cb618ed33fcee2794eee5725ab1c8d2c..37d82cbb724b14f4068415f2d49d3e9f60df20a9 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2015 (ita)
index 18d665e5d4654abba2498404137ab4e645589109..fd3d6d2c99504c3174822ae12fe19e7901e797de 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: UTF-8
 # Petar Forai
@@ -116,9 +112,16 @@ def swig_c(self):
 
        c_tsk.set_run_after(self)
 
-       ge = self.generator.bld.producer
-       ge.outstanding.append(c_tsk)
-       ge.total += 1
+       # transfer weights from swig task to c task
+       if getattr(self, 'weight', None):
+               c_tsk.weight = self.weight
+       if getattr(self, 'tree_weight', None):
+               c_tsk.tree_weight = self.tree_weight
+
+       try:
+               self.more_tasks.append(c_tsk)
+       except AttributeError:
+               self.more_tasks = [c_tsk]
 
        try:
                ltask = self.generator.link_task
@@ -127,10 +130,9 @@ def swig_c(self):
        else:
                ltask.set_run_after(c_tsk)
                # setting input nodes does not declare the build order
-               # because the build already started
+               # because the build already started, but it sets
+               # the dependency to enable rebuilds
                ltask.inputs.append(c_tsk.outputs[0])
-               # set the build order after the build started:
-               ge.revdeps[c_tsk].add(ltask)
 
        self.outputs.append(out_node)
 
index 05fff9f59a2be059c3a25d73b2a28d00f5e7d36d..dfa005930e43f6c96175e6f8c7c6ab129476e45d 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 
index 117585cecaef594c9a6edf1026306d4c8c6e61e0..f43a7ea5cb1c8ecfcc94cbb1677aafac44f04c1b 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 
index cb6a8d54db71a072eba16d1226578208f26f3582..78128ed3859002ae1cb3866d39b90c24ad407b6c 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 
index b5a73d7f3e102bfe518283d2d1862f391b30d426..71df793a2a3c17b790c430779805dcdaee4418b9 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # coding=utf-8
 # Mathieu Courtois - EDF R&D, 2013 - http://www.code-aster.org
index bb2a4d22030c780fa4a308ab9c3086c351336ffb..c50f69e747abd90bbab0f2041db651c6dfb95df0 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: UTF-8
 # Nicolas Joseph 2009
diff --git a/third_party/waf/waflib/extras/waf_xattr.py b/third_party/waf/waflib/extras/waf_xattr.py
new file mode 100644 (file)
index 0000000..351dd63
--- /dev/null
@@ -0,0 +1,150 @@
+#! /usr/bin/env python
+# encoding: utf-8
+
+"""
+Use extended attributes instead of database files
+
+1. Input files will be made writable
+2. This is only for systems providing extended filesystem attributes
+3. By default, hashes are calculated only if timestamp/size change (HASH_CACHE below)
+4. The module enables "deep_inputs" on all tasks by propagating task signatures
+5. This module also skips task signature comparisons for task code changes due to point 4.
+6. This module is for Python3/Linux only, but it could be extended to Python2/other systems
+   using the xattr library
+7. For projects in which tasks always declare output files, it should be possible to
+   store the rest of build context attributes on output files (imp_sigs, raw_deps and node_deps)
+   but this is not done here
+
+On a simple C++ project benchmark, the variations before and after adding waf_xattr.py were observed:
+total build time: 20s -> 22s
+no-op build time: 2.4s -> 1.8s
+pickle file size: 2.9MB -> 2.6MB
+"""
+
+import os
+from waflib import Logs, Node, Task, Utils, Errors
+from waflib.Task import SKIP_ME, RUN_ME, CANCEL_ME, ASK_LATER, SKIPPED, MISSING
+
+HASH_CACHE = True
+SIG_VAR = 'user.waf.sig'
+SEP = ','.encode()
+TEMPLATE = '%b%d,%d'.encode()
+
+try:
+       PermissionError
+except NameError:
+       PermissionError = IOError
+
+def getxattr(self):
+       return os.getxattr(self.abspath(), SIG_VAR)
+
+def setxattr(self, val):
+       os.setxattr(self.abspath(), SIG_VAR, val)
+
+def h_file(self):
+       try:
+               ret = getxattr(self)
+       except OSError:
+               if HASH_CACHE:
+                       st = os.stat(self.abspath())
+                       mtime = st.st_mtime
+                       size = st.st_size
+       else:
+               if len(ret) == 16:
+                       # for build directory files
+                       return ret
+
+               if HASH_CACHE:
+                       # check if timestamp and mtime match to avoid re-hashing
+                       st = os.stat(self.abspath())
+                       mtime, size = ret[16:].split(SEP)
+                       if int(1000 * st.st_mtime) == int(mtime) and st.st_size == int(size):
+                               return ret[:16]
+
+       ret = Utils.h_file(self.abspath())
+       if HASH_CACHE:
+               val = TEMPLATE % (ret, int(1000 * st.st_mtime), int(st.st_size))
+               try:
+                       setxattr(self, val)
+               except PermissionError:
+                       os.chmod(self.abspath(), st.st_mode | 128)
+                       setxattr(self, val)
+       return ret
+
+def runnable_status(self):
+       bld = self.generator.bld
+       if bld.is_install < 0:
+               return SKIP_ME
+
+       for t in self.run_after:
+               if not t.hasrun:
+                       return ASK_LATER
+               elif t.hasrun < SKIPPED:
+                       # a dependency has an error
+                       return CANCEL_ME
+
+       # first compute the signature
+       try:
+               new_sig = self.signature()
+       except Errors.TaskNotReady:
+               return ASK_LATER
+
+       if not self.outputs:
+               # compare the signature to a signature computed previously
+               # this part is only for tasks with no output files
+               key = self.uid()
+               try:
+                       prev_sig = bld.task_sigs[key]
+               except KeyError:
+                       Logs.debug('task: task %r must run: it was never run before or the task code changed', self)
+                       return RUN_ME
+               if new_sig != prev_sig:
+                       Logs.debug('task: task %r must run: the task signature changed', self)
+                       return RUN_ME
+
+       # compare the signatures of the outputs to make a decision
+       for node in self.outputs:
+               try:
+                       sig = node.h_file()
+               except EnvironmentError:
+                       Logs.debug('task: task %r must run: an output node does not exist', self)
+                       return RUN_ME
+               if sig != new_sig:
+                       Logs.debug('task: task %r must run: an output node is stale', self)
+                       return RUN_ME
+
+       return (self.always_run and RUN_ME) or SKIP_ME
+
+def post_run(self):
+       bld = self.generator.bld
+       sig = self.signature()
+       for node in self.outputs:
+               if not node.exists():
+                       self.hasrun = MISSING
+                       self.err_msg = '-> missing file: %r' % node.abspath()
+                       raise Errors.WafError(self.err_msg)
+               os.setxattr(node.abspath(), 'user.waf.sig', sig)
+       if not self.outputs:
+               # only for task with no outputs
+               bld.task_sigs[self.uid()] = sig
+       if not self.keep_last_cmd:
+               try:
+                       del self.last_cmd
+               except AttributeError:
+                       pass
+
+try:
+       os.getxattr
+except AttributeError:
+       pass
+else:
+       h_file.__doc__ = Node.Node.h_file.__doc__
+
+       # keep file hashes as file attributes
+       Node.Node.h_file = h_file
+
+       # enable "deep_inputs" on all tasks
+       Task.Task.runnable_status = runnable_status
+       Task.Task.post_run = post_run
+       Task.Task.sig_deep_inputs = Utils.nada
+
index 8404e213888b1200ee74ff49641dcee248255c53..1bb941f6c98d33c0c4d636cf52398bb36431d2cb 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2010 (ita)
index f8f41870567062758b2b5d97b6dcda109fe37b93..9f7443c39b43c8eca29fd8f0238a64960f6da523 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 
index c9daae6ead3f91835198550e26f9b03a97d5c272..d87bfbb1ec892a245e3aae674e3a699647ae44b4 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/python
 # encoding: utf-8
 # vim: tabstop=4 noexpandtab
index 15cddf2b056ae6e4e99018d884409091f26a7304..c062a74e4fca49c9127075ab5b9b10d81039e128 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 # XCode 3/XCode 4/XCode 6/Xcode 7 generator for Waf
@@ -129,7 +125,7 @@ def configure(self):
        # Some build settings are required to be present by XCode. We will supply default values
        # if user hasn't defined any.
        defaults_required = [('PRODUCT_NAME', '$(TARGET_NAME)')]
-       for cfgname,settings in self.env.PROJ_CONFIGURATION.iteritems():
+       for cfgname,settings in self.env.PROJ_CONFIGURATION.items():
                for default_var, default_val in defaults_required:
                        if default_var not in settings:
                                settings[default_var] = default_val
index 83df79cbeda5be34f3ea7cb103fc043b91bd589d..24176e066455dda44ce77cac802182bdca4aa8b7 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2010-2018 (ita)
index 2c62228f521cfc2ad6f835ec93e67a55a9c8d3b2..2eecf3bd93f43431a13163b75f814d220beed120 100755 (executable)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #! /usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2016-2018 (ita)