summaryrefslogtreecommitdiff
path: root/third_party/waf/waflib/extras
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/waf/waflib/extras')
-rw-r--r--third_party/waf/waflib/extras/__init__.py4
-rw-r--r--third_party/waf/waflib/extras/batched_cc.py4
-rw-r--r--third_party/waf/waflib/extras/biber.py4
-rw-r--r--third_party/waf/waflib/extras/bjam.py4
-rw-r--r--third_party/waf/waflib/extras/blender.py4
-rw-r--r--third_party/waf/waflib/extras/boo.py4
-rw-r--r--third_party/waf/waflib/extras/boost.py123
-rw-r--r--third_party/waf/waflib/extras/build_file_tracker.py4
-rw-r--r--third_party/waf/waflib/extras/build_logs.py4
-rw-r--r--third_party/waf/waflib/extras/buildcopy.py4
-rw-r--r--third_party/waf/waflib/extras/c_bgxlc.py4
-rw-r--r--third_party/waf/waflib/extras/c_dumbpreproc.py4
-rw-r--r--third_party/waf/waflib/extras/c_emscripten.py4
-rw-r--r--third_party/waf/waflib/extras/c_nec.py4
-rw-r--r--third_party/waf/waflib/extras/cabal.py4
-rw-r--r--third_party/waf/waflib/extras/cfg_altoptions.py4
-rw-r--r--third_party/waf/waflib/extras/clang_compilation_database.py13
-rw-r--r--third_party/waf/waflib/extras/codelite.py4
-rw-r--r--third_party/waf/waflib/extras/color_gcc.py4
-rw-r--r--third_party/waf/waflib/extras/color_rvct.py4
-rw-r--r--third_party/waf/waflib/extras/compat15.py4
-rw-r--r--third_party/waf/waflib/extras/cppcheck.py4
-rw-r--r--third_party/waf/waflib/extras/cpplint.py4
-rw-r--r--third_party/waf/waflib/extras/cross_gnu.py4
-rw-r--r--third_party/waf/waflib/extras/cython.py4
-rw-r--r--third_party/waf/waflib/extras/dcc.py4
-rw-r--r--third_party/waf/waflib/extras/distnet.py5
-rw-r--r--third_party/waf/waflib/extras/doxygen.py8
-rw-r--r--third_party/waf/waflib/extras/dpapi.py4
-rw-r--r--third_party/waf/waflib/extras/eclipse.py128
-rw-r--r--third_party/waf/waflib/extras/erlang.py4
-rw-r--r--third_party/waf/waflib/extras/fast_partial.py4
-rw-r--r--third_party/waf/waflib/extras/fc_bgxlf.py4
-rw-r--r--third_party/waf/waflib/extras/fc_cray.py4
-rw-r--r--third_party/waf/waflib/extras/fc_nag.py4
-rw-r--r--third_party/waf/waflib/extras/fc_nec.py4
-rw-r--r--third_party/waf/waflib/extras/fc_open64.py4
-rw-r--r--third_party/waf/waflib/extras/fc_pgfortran.py4
-rw-r--r--third_party/waf/waflib/extras/fc_solstudio.py4
-rw-r--r--third_party/waf/waflib/extras/fc_xlf.py4
-rw-r--r--third_party/waf/waflib/extras/file_to_object.py4
-rw-r--r--third_party/waf/waflib/extras/fluid.py4
-rw-r--r--third_party/waf/waflib/extras/freeimage.py4
-rw-r--r--third_party/waf/waflib/extras/fsb.py4
-rw-r--r--third_party/waf/waflib/extras/fsc.py4
-rw-r--r--third_party/waf/waflib/extras/gccdeps.py4
-rw-r--r--third_party/waf/waflib/extras/gdbus.py87
-rw-r--r--third_party/waf/waflib/extras/gob2.py4
-rw-r--r--third_party/waf/waflib/extras/halide.py4
-rwxr-xr-xthird_party/waf/waflib/extras/javatest.py4
-rw-r--r--third_party/waf/waflib/extras/kde4.py4
-rw-r--r--third_party/waf/waflib/extras/local_rpath.py4
-rw-r--r--third_party/waf/waflib/extras/make.py4
-rw-r--r--third_party/waf/waflib/extras/midl.py4
-rw-r--r--third_party/waf/waflib/extras/msvcdeps.py4
-rw-r--r--third_party/waf/waflib/extras/msvs.py4
-rw-r--r--third_party/waf/waflib/extras/netcache_client.py4
-rw-r--r--third_party/waf/waflib/extras/objcopy.py4
-rw-r--r--third_party/waf/waflib/extras/ocaml.py4
-rw-r--r--third_party/waf/waflib/extras/package.py4
-rw-r--r--third_party/waf/waflib/extras/parallel_debug.py4
-rw-r--r--third_party/waf/waflib/extras/pch.py10
-rw-r--r--third_party/waf/waflib/extras/pep8.py4
-rw-r--r--third_party/waf/waflib/extras/pgicc.py4
-rw-r--r--third_party/waf/waflib/extras/pgicxx.py4
-rw-r--r--third_party/waf/waflib/extras/proc.py4
-rw-r--r--third_party/waf/waflib/extras/protoc.py18
-rw-r--r--third_party/waf/waflib/extras/pyqt5.py4
-rw-r--r--third_party/waf/waflib/extras/pytest.py4
-rw-r--r--third_party/waf/waflib/extras/qnxnto.py4
-rw-r--r--third_party/waf/waflib/extras/qt4.py4
-rw-r--r--third_party/waf/waflib/extras/relocation.py4
-rw-r--r--third_party/waf/waflib/extras/remote.py4
-rw-r--r--third_party/waf/waflib/extras/resx.py4
-rw-r--r--third_party/waf/waflib/extras/review.py4
-rw-r--r--third_party/waf/waflib/extras/rst.py4
-rw-r--r--third_party/waf/waflib/extras/run_do_script.py4
-rw-r--r--third_party/waf/waflib/extras/run_m_script.py4
-rw-r--r--third_party/waf/waflib/extras/run_py_script.py4
-rw-r--r--third_party/waf/waflib/extras/run_r_script.py4
-rw-r--r--third_party/waf/waflib/extras/sas.py4
-rw-r--r--third_party/waf/waflib/extras/satellite_assembly.py4
-rw-r--r--third_party/waf/waflib/extras/scala.py4
-rw-r--r--third_party/waf/waflib/extras/slow_qt4.py6
-rw-r--r--third_party/waf/waflib/extras/softlink_libs.py4
-rw-r--r--third_party/waf/waflib/extras/stale.py4
-rw-r--r--third_party/waf/waflib/extras/stracedeps.py4
-rw-r--r--third_party/waf/waflib/extras/swig.py22
-rw-r--r--third_party/waf/waflib/extras/syms.py4
-rw-r--r--third_party/waf/waflib/extras/ticgt.py4
-rw-r--r--third_party/waf/waflib/extras/unity.py4
-rw-r--r--third_party/waf/waflib/extras/use_config.py4
-rw-r--r--third_party/waf/waflib/extras/valadoc.py4
-rw-r--r--third_party/waf/waflib/extras/waf_xattr.py150
-rw-r--r--third_party/waf/waflib/extras/why.py4
-rw-r--r--third_party/waf/waflib/extras/win32_opts.py4
-rw-r--r--third_party/waf/waflib/extras/wix.py4
-rw-r--r--third_party/waf/waflib/extras/xcode6.py6
98 files changed, 451 insertions, 469 deletions
diff --git a/third_party/waf/waflib/extras/__init__.py b/third_party/waf/waflib/extras/__init__.py
index 3dfaabd1371..c8a3c349288 100644
--- a/third_party/waf/waflib/extras/__init__.py
+++ b/third_party/waf/waflib/extras/__init__.py
@@ -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)
diff --git a/third_party/waf/waflib/extras/batched_cc.py b/third_party/waf/waflib/extras/batched_cc.py
index 935df6cf162..aad28722983 100644
--- a/third_party/waf/waflib/extras/batched_cc.py
+++ b/third_party/waf/waflib/extras/batched_cc.py
@@ -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)
diff --git a/third_party/waf/waflib/extras/biber.py b/third_party/waf/waflib/extras/biber.py
index b4bb72267e8..fd9db4e04ea 100644
--- a/third_party/waf/waflib/extras/biber.py
+++ b/third_party/waf/waflib/extras/biber.py
@@ -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)
diff --git a/third_party/waf/waflib/extras/bjam.py b/third_party/waf/waflib/extras/bjam.py
index b8effa543b7..8e04d3a66fc 100644
--- a/third_party/waf/waflib/extras/bjam.py
+++ b/third_party/waf/waflib/extras/bjam.py
@@ -1,8 +1,4 @@
#! /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
from os import sep, readlink
diff --git a/third_party/waf/waflib/extras/blender.py b/third_party/waf/waflib/extras/blender.py
index 2556415a0c8..e5efc280cf8 100644
--- a/third_party/waf/waflib/extras/blender.py
+++ b/third_party/waf/waflib/extras/blender.py
@@ -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)
diff --git a/third_party/waf/waflib/extras/boo.py b/third_party/waf/waflib/extras/boo.py
index 93bff04c538..06623d40fd4 100644
--- a/third_party/waf/waflib/extras/boo.py
+++ b/third_party/waf/waflib/extras/boo.py
@@ -1,9 +1,5 @@
#! /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
"""
diff --git a/third_party/waf/waflib/extras/boost.py b/third_party/waf/waflib/extras/boost.py
index 2fe99a40674..c2aaaa938a2 100644
--- a/third_party/waf/waflib/extras/boost.py
+++ b/third_party/waf/waflib/extras/boost.py
@@ -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):
diff --git a/third_party/waf/waflib/extras/build_file_tracker.py b/third_party/waf/waflib/extras/build_file_tracker.py
index 28b00e538a3..c4f26fd070d 100644
--- a/third_party/waf/waflib/extras/build_file_tracker.py
+++ b/third_party/waf/waflib/extras/build_file_tracker.py
@@ -1,9 +1,5 @@
#! /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
"""
diff --git a/third_party/waf/waflib/extras/build_logs.py b/third_party/waf/waflib/extras/build_logs.py
index 87a4e2c3b4a..cdf8ed097e9 100644
--- a/third_party/waf/waflib/extras/build_logs.py
+++ b/third_party/waf/waflib/extras/build_logs.py
@@ -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)
diff --git a/third_party/waf/waflib/extras/buildcopy.py b/third_party/waf/waflib/extras/buildcopy.py
index 10625d1e26f..a6d9ac83114 100644
--- a/third_party/waf/waflib/extras/buildcopy.py
+++ b/third_party/waf/waflib/extras/buildcopy.py
@@ -1,9 +1,5 @@
#! /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)
"""
Create task that copies source files to the associated build node.
diff --git a/third_party/waf/waflib/extras/c_bgxlc.py b/third_party/waf/waflib/extras/c_bgxlc.py
index 04a3c79cff0..6e3eaf7bb64 100644
--- a/third_party/waf/waflib/extras/c_bgxlc.py
+++ b/third_party/waf/waflib/extras/c_bgxlc.py
@@ -1,9 +1,5 @@
#! /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
"""
diff --git a/third_party/waf/waflib/extras/c_dumbpreproc.py b/third_party/waf/waflib/extras/c_dumbpreproc.py
index 407bcf5a893..ce9e1a400b9 100644
--- a/third_party/waf/waflib/extras/c_dumbpreproc.py
+++ b/third_party/waf/waflib/extras/c_dumbpreproc.py
@@ -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)
diff --git a/third_party/waf/waflib/extras/c_emscripten.py b/third_party/waf/waflib/extras/c_emscripten.py
index b23d770b43b..e1ac494f448 100644
--- a/third_party/waf/waflib/extras/c_emscripten.py
+++ b/third_party/waf/waflib/extras/c_emscripten.py
@@ -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
diff --git a/third_party/waf/waflib/extras/c_nec.py b/third_party/waf/waflib/extras/c_nec.py
index 1ca665c1b0d..96bfae4f345 100644
--- a/third_party/waf/waflib/extras/c_nec.py
+++ b/third_party/waf/waflib/extras/c_nec.py
@@ -1,9 +1,5 @@
#! /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
"""
diff --git a/third_party/waf/waflib/extras/cabal.py b/third_party/waf/waflib/extras/cabal.py
index a26f6342e9e..a5acce77375 100644
--- a/third_party/waf/waflib/extras/cabal.py
+++ b/third_party/waf/waflib/extras/cabal.py
@@ -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
diff --git a/third_party/waf/waflib/extras/cfg_altoptions.py b/third_party/waf/waflib/extras/cfg_altoptions.py
index d42c5ccfa86..47b1189f476 100644
--- a/third_party/waf/waflib/extras/cfg_altoptions.py
+++ b/third_party/waf/waflib/extras/cfg_altoptions.py
@@ -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()
diff --git a/third_party/waf/waflib/extras/clang_compilation_database.py b/third_party/waf/waflib/extras/clang_compilation_database.py
index 756180f8bb6..4d9b5e275ae 100644
--- a/third_party/waf/waflib/extras/clang_compilation_database.py
+++ b/third_party/waf/waflib/extras/clang_compilation_database.py
@@ -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)
-
diff --git a/third_party/waf/waflib/extras/codelite.py b/third_party/waf/waflib/extras/codelite.py
index df5949a763f..fd04a91d94b 100644
--- a/third_party/waf/waflib/extras/codelite.py
+++ b/third_party/waf/waflib/extras/codelite.py
@@ -1,9 +1,5 @@
#! /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
# Christian Klein (chrikle@berlios.de)
# Created: Jan 2012
diff --git a/third_party/waf/waflib/extras/color_gcc.py b/third_party/waf/waflib/extras/color_gcc.py
index 73b001768c5..b68c5ebf2df 100644
--- a/third_party/waf/waflib/extras/color_gcc.py
+++ b/third_party/waf/waflib/extras/color_gcc.py
@@ -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
diff --git a/third_party/waf/waflib/extras/color_rvct.py b/third_party/waf/waflib/extras/color_rvct.py
index 8138b39d63a..f89ccbdb140 100644
--- a/third_party/waf/waflib/extras/color_rvct.py
+++ b/third_party/waf/waflib/extras/color_rvct.py
@@ -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
diff --git a/third_party/waf/waflib/extras/compat15.py b/third_party/waf/waflib/extras/compat15.py
index ec6a16493a3..0e74df8506c 100644
--- a/third_party/waf/waflib/extras/compat15.py
+++ b/third_party/waf/waflib/extras/compat15.py
@@ -1,9 +1,5 @@
#! /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)
"""
diff --git a/third_party/waf/waflib/extras/cppcheck.py b/third_party/waf/waflib/extras/cppcheck.py
index 4a4e59da5f4..43dc544df73 100644
--- a/third_party/waf/waflib/extras/cppcheck.py
+++ b/third_party/waf/waflib/extras/cppcheck.py
@@ -1,8 +1,4 @@
#! /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
diff --git a/third_party/waf/waflib/extras/cpplint.py b/third_party/waf/waflib/extras/cpplint.py
index eba979b5328..fc914c2450b 100644
--- a/third_party/waf/waflib/extras/cpplint.py
+++ b/third_party/waf/waflib/extras/cpplint.py
@@ -1,9 +1,5 @@
#! /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
#
# written by Sylvain Rouquette, 2014
diff --git a/third_party/waf/waflib/extras/cross_gnu.py b/third_party/waf/waflib/extras/cross_gnu.py
index b6a4036f58e..309f53b034d 100644
--- a/third_party/waf/waflib/extras/cross_gnu.py
+++ b/third_party/waf/waflib/extras/cross_gnu.py
@@ -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
diff --git a/third_party/waf/waflib/extras/cython.py b/third_party/waf/waflib/extras/cython.py
index 20e94d051d8..2b2c7ccc265 100644
--- a/third_party/waf/waflib/extras/cython.py
+++ b/third_party/waf/waflib/extras/cython.py
@@ -1,9 +1,5 @@
#! /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
import re
diff --git a/third_party/waf/waflib/extras/dcc.py b/third_party/waf/waflib/extras/dcc.py
index d1b85bc56e6..c1a57c04d93 100644
--- a/third_party/waf/waflib/extras/dcc.py
+++ b/third_party/waf/waflib/extras/dcc.py
@@ -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)
diff --git a/third_party/waf/waflib/extras/distnet.py b/third_party/waf/waflib/extras/distnet.py
index a8dd2d2eb42..09a31a6d437 100644
--- a/third_party/waf/waflib/extras/distnet.py
+++ b/third_party/waf/waflib/extras/distnet.py
@@ -1,9 +1,5 @@
#! /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
"""
waf-powered distributed network builds, with a network cache.
@@ -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()
diff --git a/third_party/waf/waflib/extras/doxygen.py b/third_party/waf/waflib/extras/doxygen.py
index f6e951b8f32..28f56e9c7d7 100644
--- a/third_party/waf/waflib/extras/doxygen.py
+++ b/third_party/waf/waflib/extras/doxygen.py
@@ -1,8 +1,4 @@
#! /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)
diff --git a/third_party/waf/waflib/extras/dpapi.py b/third_party/waf/waflib/extras/dpapi.py
index 0e226b1d776..b94d4823581 100644
--- a/third_party/waf/waflib/extras/dpapi.py
+++ b/third_party/waf/waflib/extras/dpapi.py
@@ -1,9 +1,5 @@
#! /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
'''
diff --git a/third_party/waf/waflib/extras/eclipse.py b/third_party/waf/waflib/extras/eclipse.py
index 9209a2546b6..bb787416e9f 100644
--- a/third_party/waf/waflib/extras/eclipse.py
+++ b/third_party/waf/waflib/extras/eclipse.py
@@ -1,9 +1,5 @@
#! /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
# Richard Quirk 2009-1011 (New BSD License)
# Thomas Nagy 2011 (ported to Waf 1.6)
@@ -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)
diff --git a/third_party/waf/waflib/extras/erlang.py b/third_party/waf/waflib/extras/erlang.py
index b2aa5a16579..49f6d5b475b 100644
--- a/third_party/waf/waflib/extras/erlang.py
+++ b/third_party/waf/waflib/extras/erlang.py
@@ -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)
diff --git a/third_party/waf/waflib/extras/fast_partial.py b/third_party/waf/waflib/extras/fast_partial.py
index bd9b2b833dc..b3af513b255 100644
--- a/third_party/waf/waflib/extras/fast_partial.py
+++ b/third_party/waf/waflib/extras/fast_partial.py
@@ -1,9 +1,5 @@
#! /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)
"""
diff --git a/third_party/waf/waflib/extras/fc_bgxlf.py b/third_party/waf/waflib/extras/fc_bgxlf.py
index c58e7ac0181..cca18101ead 100644
--- a/third_party/waf/waflib/extras/fc_bgxlf.py
+++ b/third_party/waf/waflib/extras/fc_bgxlf.py
@@ -1,9 +1,5 @@
#! /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
from waflib.Tools import fc, fc_config, fc_scan
diff --git a/third_party/waf/waflib/extras/fc_cray.py b/third_party/waf/waflib/extras/fc_cray.py
index 0ae9f7ec91a..ec2906742b4 100644
--- a/third_party/waf/waflib/extras/fc_cray.py
+++ b/third_party/waf/waflib/extras/fc_cray.py
@@ -1,9 +1,5 @@
#! /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
import re
diff --git a/third_party/waf/waflib/extras/fc_nag.py b/third_party/waf/waflib/extras/fc_nag.py
index 1779e1988f5..edcb218bc31 100644
--- a/third_party/waf/waflib/extras/fc_nag.py
+++ b/third_party/waf/waflib/extras/fc_nag.py
@@ -1,9 +1,5 @@
#! /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
import re
diff --git a/third_party/waf/waflib/extras/fc_nec.py b/third_party/waf/waflib/extras/fc_nec.py
index 2d0ca71ab39..4b70f3dcccd 100644
--- a/third_party/waf/waflib/extras/fc_nec.py
+++ b/third_party/waf/waflib/extras/fc_nec.py
@@ -1,9 +1,5 @@
#! /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
import re
diff --git a/third_party/waf/waflib/extras/fc_open64.py b/third_party/waf/waflib/extras/fc_open64.py
index 6001b2083a6..413719f43ec 100644
--- a/third_party/waf/waflib/extras/fc_open64.py
+++ b/third_party/waf/waflib/extras/fc_open64.py
@@ -1,9 +1,5 @@
#! /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
import re
diff --git a/third_party/waf/waflib/extras/fc_pgfortran.py b/third_party/waf/waflib/extras/fc_pgfortran.py
index bc62279a306..afb2817ba67 100644
--- a/third_party/waf/waflib/extras/fc_pgfortran.py
+++ b/third_party/waf/waflib/extras/fc_pgfortran.py
@@ -1,9 +1,5 @@
#! /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
import re
diff --git a/third_party/waf/waflib/extras/fc_solstudio.py b/third_party/waf/waflib/extras/fc_solstudio.py
index 8880d31c58e..53766df8fc1 100644
--- a/third_party/waf/waflib/extras/fc_solstudio.py
+++ b/third_party/waf/waflib/extras/fc_solstudio.py
@@ -1,9 +1,5 @@
#! /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
import re
diff --git a/third_party/waf/waflib/extras/fc_xlf.py b/third_party/waf/waflib/extras/fc_xlf.py
index fe8ea4539ce..5a3da034187 100644
--- a/third_party/waf/waflib/extras/fc_xlf.py
+++ b/third_party/waf/waflib/extras/fc_xlf.py
@@ -1,9 +1,5 @@
#! /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
import re
diff --git a/third_party/waf/waflib/extras/file_to_object.py b/third_party/waf/waflib/extras/file_to_object.py
index a295998e9e6..1393b511d63 100644
--- a/third_party/waf/waflib/extras/file_to_object.py
+++ b/third_party/waf/waflib/extras/file_to_object.py
@@ -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
diff --git a/third_party/waf/waflib/extras/fluid.py b/third_party/waf/waflib/extras/fluid.py
index caa8afdfbc0..4814a35b94d 100644
--- a/third_party/waf/waflib/extras/fluid.py
+++ b/third_party/waf/waflib/extras/fluid.py
@@ -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
diff --git a/third_party/waf/waflib/extras/freeimage.py b/third_party/waf/waflib/extras/freeimage.py
index 59d557a1cf7..f27e5258ddd 100644
--- a/third_party/waf/waflib/extras/freeimage.py
+++ b/third_party/waf/waflib/extras/freeimage.py
@@ -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
#
diff --git a/third_party/waf/waflib/extras/fsb.py b/third_party/waf/waflib/extras/fsb.py
index d31e33a4597..1b8f398feb6 100644
--- a/third_party/waf/waflib/extras/fsb.py
+++ b/third_party/waf/waflib/extras/fsb.py
@@ -1,9 +1,5 @@
#! /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)
"""
diff --git a/third_party/waf/waflib/extras/fsc.py b/third_party/waf/waflib/extras/fsc.py
index 6325de4a40b..c67e70be296 100644
--- a/third_party/waf/waflib/extras/fsc.py
+++ b/third_party/waf/waflib/extras/fsc.py
@@ -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)
diff --git a/third_party/waf/waflib/extras/gccdeps.py b/third_party/waf/waflib/extras/gccdeps.py
index 81f60d5aaca..d9758ab34d5 100644
--- a/third_party/waf/waflib/extras/gccdeps.py
+++ b/third_party/waf/waflib/extras/gccdeps.py
@@ -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
index 00000000000..0e0476e301a
--- /dev/null
+++ b/third_party/waf/waflib/extras/gdbus.py
@@ -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')
+
diff --git a/third_party/waf/waflib/extras/gob2.py b/third_party/waf/waflib/extras/gob2.py
index 629ccdca8ed..b4fa3b9a72e 100644
--- a/third_party/waf/waflib/extras/gob2.py
+++ b/third_party/waf/waflib/extras/gob2.py
@@ -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
diff --git a/third_party/waf/waflib/extras/halide.py b/third_party/waf/waflib/extras/halide.py
index df7509a6d11..6078e38bde1 100644
--- a/third_party/waf/waflib/extras/halide.py
+++ b/third_party/waf/waflib/extras/halide.py
@@ -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
diff --git a/third_party/waf/waflib/extras/javatest.py b/third_party/waf/waflib/extras/javatest.py
index 0c315745353..979b8d8242d 100755
--- a/third_party/waf/waflib/extras/javatest.py
+++ b/third_party/waf/waflib/extras/javatest.py
@@ -1,9 +1,5 @@
#! /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)
"""
diff --git a/third_party/waf/waflib/extras/kde4.py b/third_party/waf/waflib/extras/kde4.py
index 13ac82f4049..e49a9ec00e1 100644
--- a/third_party/waf/waflib/extras/kde4.py
+++ b/third_party/waf/waflib/extras/kde4.py
@@ -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)
diff --git a/third_party/waf/waflib/extras/local_rpath.py b/third_party/waf/waflib/extras/local_rpath.py
index 6020b45f7a9..b2507e17a10 100644
--- a/third_party/waf/waflib/extras/local_rpath.py
+++ b/third_party/waf/waflib/extras/local_rpath.py
@@ -1,9 +1,5 @@
#! /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)
from waflib.TaskGen import after_method, feature
diff --git a/third_party/waf/waflib/extras/make.py b/third_party/waf/waflib/extras/make.py
index 7b75d5511ba..933d9cacb2b 100644
--- a/third_party/waf/waflib/extras/make.py
+++ b/third_party/waf/waflib/extras/make.py
@@ -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)
diff --git a/third_party/waf/waflib/extras/midl.py b/third_party/waf/waflib/extras/midl.py
index c81e0e317ad..43e6cf911f2 100644
--- a/third_party/waf/waflib/extras/midl.py
+++ b/third_party/waf/waflib/extras/midl.py
@@ -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
diff --git a/third_party/waf/waflib/extras/msvcdeps.py b/third_party/waf/waflib/extras/msvcdeps.py
index a6ea52af76b..fc1ecd4d08c 100644
--- a/third_party/waf/waflib/extras/msvcdeps.py
+++ b/third_party/waf/waflib/extras/msvcdeps.py
@@ -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
diff --git a/third_party/waf/waflib/extras/msvs.py b/third_party/waf/waflib/extras/msvs.py
index b12d9c068e5..8aa2db0b751 100644
--- a/third_party/waf/waflib/extras/msvs.py
+++ b/third_party/waf/waflib/extras/msvs.py
@@ -1,9 +1,5 @@
#! /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
# Thomas Nagy 2011
diff --git a/third_party/waf/waflib/extras/netcache_client.py b/third_party/waf/waflib/extras/netcache_client.py
index ffd40d87f42..dc490485acf 100644
--- a/third_party/waf/waflib/extras/netcache_client.py
+++ b/third_party/waf/waflib/extras/netcache_client.py
@@ -1,9 +1,5 @@
#! /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)
"""
diff --git a/third_party/waf/waflib/extras/objcopy.py b/third_party/waf/waflib/extras/objcopy.py
index baa54c0bd54..82d8359ecf7 100644
--- a/third_party/waf/waflib/extras/objcopy.py
+++ b/third_party/waf/waflib/extras/objcopy.py
@@ -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
diff --git a/third_party/waf/waflib/extras/ocaml.py b/third_party/waf/waflib/extras/ocaml.py
index 56f851e72cf..afe73c0ca3e 100644
--- a/third_party/waf/waflib/extras/ocaml.py
+++ b/third_party/waf/waflib/extras/ocaml.py
@@ -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)
diff --git a/third_party/waf/waflib/extras/package.py b/third_party/waf/waflib/extras/package.py
index 669aa170bd5..c06498eba8f 100644
--- a/third_party/waf/waflib/extras/package.py
+++ b/third_party/waf/waflib/extras/package.py
@@ -1,9 +1,5 @@
#! /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
"""
diff --git a/third_party/waf/waflib/extras/parallel_debug.py b/third_party/waf/waflib/extras/parallel_debug.py
index d365024e205..35883a3dd74 100644
--- a/third_party/waf/waflib/extras/parallel_debug.py
+++ b/third_party/waf/waflib/extras/parallel_debug.py
@@ -1,9 +1,5 @@
#! /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)
"""
diff --git a/third_party/waf/waflib/extras/pch.py b/third_party/waf/waflib/extras/pch.py
index 98b23f47fe4..103e752838c 100644
--- a/third_party/waf/waflib/extras/pch.py
+++ b/third_party/waf/waflib/extras/pch.py
@@ -1,9 +1,5 @@
#! /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')
diff --git a/third_party/waf/waflib/extras/pep8.py b/third_party/waf/waflib/extras/pep8.py
index 278662f8051..676beedb25b 100644
--- a/third_party/waf/waflib/extras/pep8.py
+++ b/third_party/waf/waflib/extras/pep8.py
@@ -1,9 +1,5 @@
#! /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
#
# written by Sylvain Rouquette, 2011
diff --git a/third_party/waf/waflib/extras/pgicc.py b/third_party/waf/waflib/extras/pgicc.py
index ba50e172bc0..9790b9cf8ba 100644
--- a/third_party/waf/waflib/extras/pgicc.py
+++ b/third_party/waf/waflib/extras/pgicc.py
@@ -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
diff --git a/third_party/waf/waflib/extras/pgicxx.py b/third_party/waf/waflib/extras/pgicxx.py
index 7d077d74789..eae121c4036 100644
--- a/third_party/waf/waflib/extras/pgicxx.py
+++ b/third_party/waf/waflib/extras/pgicxx.py
@@ -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
diff --git a/third_party/waf/waflib/extras/proc.py b/third_party/waf/waflib/extras/proc.py
index 2d7e5cedb1f..764abecfc30 100644
--- a/third_party/waf/waflib/extras/proc.py
+++ b/third_party/waf/waflib/extras/proc.py
@@ -1,8 +1,4 @@
#! /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
from os import environ, path
diff --git a/third_party/waf/waflib/extras/protoc.py b/third_party/waf/waflib/extras/protoc.py
index cb16e858182..f3cb4d86ab8 100644
--- a/third_party/waf/waflib/extras/protoc.py
+++ b/third_party/waf/waflib/extras/protoc.py
@@ -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']
diff --git a/third_party/waf/waflib/extras/pyqt5.py b/third_party/waf/waflib/extras/pyqt5.py
index 0190f2527d7..c21dfa72048 100644
--- a/third_party/waf/waflib/extras/pyqt5.py
+++ b/third_party/waf/waflib/extras/pyqt5.py
@@ -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
diff --git a/third_party/waf/waflib/extras/pytest.py b/third_party/waf/waflib/extras/pytest.py
index c4ed4c574da..7dd5a1a087a 100644
--- a/third_party/waf/waflib/extras/pytest.py
+++ b/third_party/waf/waflib/extras/pytest.py
@@ -1,9 +1,5 @@
#! /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)
"""
diff --git a/third_party/waf/waflib/extras/qnxnto.py b/third_party/waf/waflib/extras/qnxnto.py
index db4467df396..1158124da96 100644
--- a/third_party/waf/waflib/extras/qnxnto.py
+++ b/third_party/waf/waflib/extras/qnxnto.py
@@ -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)
diff --git a/third_party/waf/waflib/extras/qt4.py b/third_party/waf/waflib/extras/qt4.py
index c310046188f..90cae7e0ae5 100644
--- a/third_party/waf/waflib/extras/qt4.py
+++ b/third_party/waf/waflib/extras/qt4.py
@@ -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)
diff --git a/third_party/waf/waflib/extras/relocation.py b/third_party/waf/waflib/extras/relocation.py
index 50ac5b9d41b..7e821f4166c 100644
--- a/third_party/waf/waflib/extras/relocation.py
+++ b/third_party/waf/waflib/extras/relocation.py
@@ -1,9 +1,5 @@
#! /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
"""
Waf 1.6
diff --git a/third_party/waf/waflib/extras/remote.py b/third_party/waf/waflib/extras/remote.py
index 9bf6e2d71c6..3b038f772b5 100644
--- a/third_party/waf/waflib/extras/remote.py
+++ b/third_party/waf/waflib/extras/remote.py
@@ -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
diff --git a/third_party/waf/waflib/extras/resx.py b/third_party/waf/waflib/extras/resx.py
index ead38ef50b5..caf4d318bb0 100644
--- a/third_party/waf/waflib/extras/resx.py
+++ b/third_party/waf/waflib/extras/resx.py
@@ -1,9 +1,5 @@
#! /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
import os
from waflib import Task
diff --git a/third_party/waf/waflib/extras/review.py b/third_party/waf/waflib/extras/review.py
index 8d167c15e13..561e06219da 100644
--- a/third_party/waf/waflib/extras/review.py
+++ b/third_party/waf/waflib/extras/review.py
@@ -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
diff --git a/third_party/waf/waflib/extras/rst.py b/third_party/waf/waflib/extras/rst.py
index 1703eeac348..f3c3a5eba42 100644
--- a/third_party/waf/waflib/extras/rst.py
+++ b/third_party/waf/waflib/extras/rst.py
@@ -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)
diff --git a/third_party/waf/waflib/extras/run_do_script.py b/third_party/waf/waflib/extras/run_do_script.py
index 529cc08ae9e..f3c58122c9b 100644
--- a/third_party/waf/waflib/extras/run_do_script.py
+++ b/third_party/waf/waflib/extras/run_do_script.py
@@ -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
diff --git a/third_party/waf/waflib/extras/run_m_script.py b/third_party/waf/waflib/extras/run_m_script.py
index bc6db0027ab..b5f27ebe082 100644
--- a/third_party/waf/waflib/extras/run_m_script.py
+++ b/third_party/waf/waflib/extras/run_m_script.py
@@ -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
diff --git a/third_party/waf/waflib/extras/run_py_script.py b/third_party/waf/waflib/extras/run_py_script.py
index 845a3ced798..367038114ca 100644
--- a/third_party/waf/waflib/extras/run_py_script.py
+++ b/third_party/waf/waflib/extras/run_py_script.py
@@ -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
diff --git a/third_party/waf/waflib/extras/run_r_script.py b/third_party/waf/waflib/extras/run_r_script.py
index 8dd81825e9c..b0d8f2b2cde 100644
--- a/third_party/waf/waflib/extras/run_r_script.py
+++ b/third_party/waf/waflib/extras/run_r_script.py
@@ -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
diff --git a/third_party/waf/waflib/extras/sas.py b/third_party/waf/waflib/extras/sas.py
index a7220068b96..754c6148dec 100644
--- a/third_party/waf/waflib/extras/sas.py
+++ b/third_party/waf/waflib/extras/sas.py
@@ -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
diff --git a/third_party/waf/waflib/extras/satellite_assembly.py b/third_party/waf/waflib/extras/satellite_assembly.py
index a9e1ddf6d62..005eb074f9d 100644
--- a/third_party/waf/waflib/extras/satellite_assembly.py
+++ b/third_party/waf/waflib/extras/satellite_assembly.py
@@ -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
diff --git a/third_party/waf/waflib/extras/scala.py b/third_party/waf/waflib/extras/scala.py
index bdc2bbbee59..a9880f02341 100644
--- a/third_party/waf/waflib/extras/scala.py
+++ b/third_party/waf/waflib/extras/scala.py
@@ -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)
diff --git a/third_party/waf/waflib/extras/slow_qt4.py b/third_party/waf/waflib/extras/slow_qt4.py
index e3014cdf070..ec7880bf9d7 100644
--- a/third_party/waf/waflib/extras/slow_qt4.py
+++ b/third_party/waf/waflib/extras/slow_qt4.py
@@ -1,8 +1,4 @@
#! /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):
diff --git a/third_party/waf/waflib/extras/softlink_libs.py b/third_party/waf/waflib/extras/softlink_libs.py
index ed453848786..50c777f28c5 100644
--- a/third_party/waf/waflib/extras/softlink_libs.py
+++ b/third_party/waf/waflib/extras/softlink_libs.py
@@ -1,8 +1,4 @@
#! /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
from waflib.TaskGen import feature, after_method
diff --git a/third_party/waf/waflib/extras/stale.py b/third_party/waf/waflib/extras/stale.py
index 991af82cd61..cac3f469c94 100644
--- a/third_party/waf/waflib/extras/stale.py
+++ b/third_party/waf/waflib/extras/stale.py
@@ -1,8 +1,4 @@
#! /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)
diff --git a/third_party/waf/waflib/extras/stracedeps.py b/third_party/waf/waflib/extras/stracedeps.py
index 4be44248cb6..37d82cbb724 100644
--- a/third_party/waf/waflib/extras/stracedeps.py
+++ b/third_party/waf/waflib/extras/stracedeps.py
@@ -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)
diff --git a/third_party/waf/waflib/extras/swig.py b/third_party/waf/waflib/extras/swig.py
index 18d665e5d46..fd3d6d2c995 100644
--- a/third_party/waf/waflib/extras/swig.py
+++ b/third_party/waf/waflib/extras/swig.py
@@ -1,8 +1,4 @@
#! /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
# Thomas Nagy 2008-2010 (ita)
@@ -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)
diff --git a/third_party/waf/waflib/extras/syms.py b/third_party/waf/waflib/extras/syms.py
index 05fff9f59a2..dfa005930e4 100644
--- a/third_party/waf/waflib/extras/syms.py
+++ b/third_party/waf/waflib/extras/syms.py
@@ -1,9 +1,5 @@
#! /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
"""
This tool supports the export_symbols_regex to export the symbols in a shared library.
diff --git a/third_party/waf/waflib/extras/ticgt.py b/third_party/waf/waflib/extras/ticgt.py
index 117585cecae..f43a7ea5cb1 100644
--- a/third_party/waf/waflib/extras/ticgt.py
+++ b/third_party/waf/waflib/extras/ticgt.py
@@ -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
diff --git a/third_party/waf/waflib/extras/unity.py b/third_party/waf/waflib/extras/unity.py
index cb6a8d54db7..78128ed3859 100644
--- a/third_party/waf/waflib/extras/unity.py
+++ b/third_party/waf/waflib/extras/unity.py
@@ -1,9 +1,5 @@
#! /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
"""
Compile whole groups of C/C++ files at once
diff --git a/third_party/waf/waflib/extras/use_config.py b/third_party/waf/waflib/extras/use_config.py
index b5a73d7f3e1..71df793a2a3 100644
--- a/third_party/waf/waflib/extras/use_config.py
+++ b/third_party/waf/waflib/extras/use_config.py
@@ -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
diff --git a/third_party/waf/waflib/extras/valadoc.py b/third_party/waf/waflib/extras/valadoc.py
index bb2a4d22030..c50f69e747a 100644
--- a/third_party/waf/waflib/extras/valadoc.py
+++ b/third_party/waf/waflib/extras/valadoc.py
@@ -1,8 +1,4 @@
#! /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
index 00000000000..351dd63a784
--- /dev/null
+++ b/third_party/waf/waflib/extras/waf_xattr.py
@@ -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
+
diff --git a/third_party/waf/waflib/extras/why.py b/third_party/waf/waflib/extras/why.py
index 8404e213888..1bb941f6c98 100644
--- a/third_party/waf/waflib/extras/why.py
+++ b/third_party/waf/waflib/extras/why.py
@@ -1,9 +1,5 @@
#! /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)
"""
diff --git a/third_party/waf/waflib/extras/win32_opts.py b/third_party/waf/waflib/extras/win32_opts.py
index f8f41870567..9f7443c39b4 100644
--- a/third_party/waf/waflib/extras/win32_opts.py
+++ b/third_party/waf/waflib/extras/win32_opts.py
@@ -1,9 +1,5 @@
#! /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
"""
Windows-specific optimizations
diff --git a/third_party/waf/waflib/extras/wix.py b/third_party/waf/waflib/extras/wix.py
index c9daae6ead3..d87bfbb1ec8 100644
--- a/third_party/waf/waflib/extras/wix.py
+++ b/third_party/waf/waflib/extras/wix.py
@@ -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
diff --git a/third_party/waf/waflib/extras/xcode6.py b/third_party/waf/waflib/extras/xcode6.py
index 15cddf2b056..c062a74e4fc 100644
--- a/third_party/waf/waflib/extras/xcode6.py
+++ b/third_party/waf/waflib/extras/xcode6.py
@@ -1,9 +1,5 @@
#! /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
# Based on work by Nicolas Mercier 2011
# Extended by Simon Warg 2015, https://github.com/mimon
@@ -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