summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
Diffstat (limited to 'Tools')
-rw-r--r--Tools/asm.py5
-rw-r--r--Tools/c_config.py6
-rw-r--r--Tools/compiler_c.py2
-rw-r--r--Tools/compiler_cxx.py2
-rw-r--r--Tools/irixcc.py14
-rw-r--r--Tools/javaw.py2
-rw-r--r--Tools/msvc.py16
-rw-r--r--Tools/qt5.py26
-rw-r--r--Tools/waf_unit_test.py10
9 files changed, 48 insertions, 35 deletions
diff --git a/Tools/asm.py b/Tools/asm.py
index a57e83b..1d34dda 100644
--- a/Tools/asm.py
+++ b/Tools/asm.py
@@ -56,13 +56,11 @@ class asm(Task.Task):
Compiles asm files by gas/nasm/yasm/...
"""
color = 'BLUE'
- run_str = '${AS} ${ASFLAGS} ${ASMPATH_ST:INCPATHS} ${DEFINES_ST:DEFINES} ${AS_SRC_F}${SRC} ${AS_TGT_F}${TGT}'
+ run_str = '${AS} ${ASFLAGS} ${ASMPATH_ST:INCPATHS} ${ASMDEFINES_ST:DEFINES} ${AS_SRC_F}${SRC} ${AS_TGT_F}${TGT}'
def scan(self):
if self.env.ASM_NAME == 'gas':
return c_preproc.scan(self)
- Logs.warn('There is no dependency scanner for Nasm!')
- return [[], []]
elif self.env.ASM_NAME == 'nasm':
Logs.warn('The Nasm dependency scanner is incomplete!')
@@ -106,3 +104,4 @@ class asmstlib(stlink_task):
def configure(conf):
conf.env.ASMPATH_ST = '-I%s'
+ conf.env.ASMDEFINES_ST = '-D%s'
diff --git a/Tools/c_config.py b/Tools/c_config.py
index 537af03..03b6bf6 100644
--- a/Tools/c_config.py
+++ b/Tools/c_config.py
@@ -68,6 +68,7 @@ MACRO_TO_DEST_CPU = {
'__s390__' : 's390',
'__sh__' : 'sh',
'__xtensa__' : 'xtensa',
+'__e2k__' : 'e2k',
}
@conf
@@ -150,7 +151,7 @@ def parse_flags(self, line, uselib_store, env=None, force_static=False, posix=No
elif x.startswith('-std='):
prefix = 'CXXFLAGS' if '++' in x else 'CFLAGS'
app(prefix, x)
- elif x.startswith('+') or x in ('-pthread', '-fPIC', '-fpic', '-fPIE', '-fpie'):
+ elif x.startswith('+') or x in ('-pthread', '-fPIC', '-fpic', '-fPIE', '-fpie', '-flto', '-fno-lto'):
app('CFLAGS', x)
app('CXXFLAGS', x)
app('LINKFLAGS', x)
@@ -1282,10 +1283,11 @@ def multicheck(self, *k, **kw):
tasks = []
id_to_task = {}
- for dct in k:
+ for counter, dct in enumerate(k):
x = Task.classes['cfgtask'](bld=bld, env=None)
tasks.append(x)
x.args = dct
+ x.args['multicheck_counter'] = counter
x.bld = bld
x.conf = self
x.args = dct
diff --git a/Tools/compiler_c.py b/Tools/compiler_c.py
index 2dba3f8..931dc57 100644
--- a/Tools/compiler_c.py
+++ b/Tools/compiler_c.py
@@ -37,7 +37,7 @@ from waflib.Logs import debug
c_compiler = {
'win32': ['msvc', 'gcc', 'clang'],
-'cygwin': ['gcc'],
+'cygwin': ['gcc', 'clang'],
'darwin': ['clang', 'gcc'],
'aix': ['xlc', 'gcc', 'clang'],
'linux': ['gcc', 'clang', 'icc'],
diff --git a/Tools/compiler_cxx.py b/Tools/compiler_cxx.py
index 1af65a2..09fca7e 100644
--- a/Tools/compiler_cxx.py
+++ b/Tools/compiler_cxx.py
@@ -38,7 +38,7 @@ from waflib.Logs import debug
cxx_compiler = {
'win32': ['msvc', 'g++', 'clang++'],
-'cygwin': ['g++'],
+'cygwin': ['g++', 'clang++'],
'darwin': ['clang++', 'g++'],
'aix': ['xlc++', 'g++', 'clang++'],
'linux': ['g++', 'clang++', 'icpc'],
diff --git a/Tools/irixcc.py b/Tools/irixcc.py
index c3ae1ac..0335c13 100644
--- a/Tools/irixcc.py
+++ b/Tools/irixcc.py
@@ -13,22 +13,11 @@ from waflib.Configure import conf
@conf
def find_irixcc(conf):
v = conf.env
- cc = None
- if v.CC:
- cc = v.CC
- elif 'CC' in conf.environ:
- cc = conf.environ['CC']
- if not cc:
- cc = conf.find_program('cc', var='CC')
- if not cc:
- conf.fatal('irixcc was not found')
-
+ cc = conf.find_program('cc', var='CC')
try:
conf.cmd_and_log(cc + ['-version'])
except Errors.WafError:
conf.fatal('%r -version could not be executed' % cc)
-
- v.CC = cc
v.CC_NAME = 'irix'
@conf
@@ -57,7 +46,6 @@ def irixcc_common_flags(conf):
def configure(conf):
conf.find_irixcc()
- conf.find_cpp()
conf.find_ar()
conf.irixcc_common_flags()
conf.cc_load_tools()
diff --git a/Tools/javaw.py b/Tools/javaw.py
index ceb08c2..b7f5dd1 100644
--- a/Tools/javaw.py
+++ b/Tools/javaw.py
@@ -251,7 +251,7 @@ def use_javac_files(self):
base_node = tg.path.get_bld()
self.use_lst.append(base_node.abspath())
- self.javac_task.dep_nodes.extend([x for x in base_node.ant_glob(JAR_RE, remove=False, quiet=True)])
+ self.javac_task.dep_nodes.extend([dx for dx in base_node.ant_glob(JAR_RE, remove=False, quiet=True)])
for tsk in tg.tasks:
self.javac_task.set_run_after(tsk)
diff --git a/Tools/msvc.py b/Tools/msvc.py
index 26ca7b2..37233be 100644
--- a/Tools/msvc.py
+++ b/Tools/msvc.py
@@ -99,7 +99,13 @@ all_icl_platforms = [ ('intel64', 'amd64'), ('em64t', 'amd64'), ('ia32', 'x86'),
"""List of icl platforms"""
def options(opt):
- opt.add_option('--msvc_version', type='string', help = 'msvc version, eg: "msvc 10.0,msvc 9.0"', default='')
+ default_ver = ''
+ vsver = os.getenv('VSCMD_VER')
+ if vsver:
+ m = re.match(r'(^\d+\.\d+).*', vsver)
+ if m:
+ default_ver = 'msvc %s' % m.group(1)
+ opt.add_option('--msvc_version', type='string', help = 'msvc version, eg: "msvc 10.0,msvc 9.0"', default=default_ver)
opt.add_option('--msvc_targets', type='string', help = 'msvc targets, eg: "x64,arm"', default='')
opt.add_option('--no-msvc-lazy', action='store_false', help = 'lazily check msvc target environments', default=True, dest='msvc_lazy')
@@ -723,10 +729,6 @@ def libname_msvc(self, libname, is_static=False):
_libpaths = self.env.LIBPATH
static_libs=[
- 'lib%ss.a' % lib,
- 'lib%s.a' % lib,
- '%ss.a' % lib,
- '%s.a' %lib,
'lib%ss.lib' % lib,
'lib%s.lib' % lib,
'%ss.lib' % lib,
@@ -926,7 +928,7 @@ def msvc_common_flags(conf):
v.LIB_ST = '%s.lib'
v.LIBPATH_ST = '/LIBPATH:%s'
- v.STLIB_ST = '%s.a'
+ v.STLIB_ST = '%s.lib'
v.STLIBPATH_ST = '/LIBPATH:%s'
if v.MSVC_MANIFEST:
@@ -940,7 +942,7 @@ def msvc_common_flags(conf):
v.IMPLIB_ST = '/IMPLIB:%s'
v.LINKFLAGS_cstlib = []
- v.cstlib_PATTERN = v.cxxstlib_PATTERN = '%s.a'
+ v.cstlib_PATTERN = v.cxxstlib_PATTERN = '%s.lib'
v.cprogram_PATTERN = v.cxxprogram_PATTERN = '%s.exe'
diff --git a/Tools/qt5.py b/Tools/qt5.py
index 99e021b..cff2028 100644
--- a/Tools/qt5.py
+++ b/Tools/qt5.py
@@ -57,7 +57,23 @@ A few options (--qt{dir,bin,...}) and environment variables
(QT5_{ROOT,DIR,MOC,UIC,XCOMPILE}) allow finer tuning of the tool,
tool path selection, etc; please read the source for more info.
-The detection uses pkg-config on Linux by default. To force static library detection use:
+The detection uses pkg-config on Linux by default. The list of
+libraries to be requested to pkg-config is formulated by scanning
+in the QTLIBS directory (that can be passed via --qtlibs or by
+setting the environment variable QT5_LIBDIR otherwise is derived
+by querying qmake for QT_INSTALL_LIBS directory) for shared/static
+libraries present.
+Alternatively the list of libraries to be requested via pkg-config
+can be set using the qt5_vars attribute, ie:
+
+ conf.qt5_vars = ['Qt5Core', 'Qt5Gui', 'Qt5Widgets', 'Qt5Test'];
+
+This can speed up configuration phase if needed libraries are
+known beforehand, can improve detection on systems with a
+sparse QT5 libraries installation (ie. NIX) and can improve
+detection of some header-only Qt modules (ie. Qt5UiPlugin).
+
+To force static library detection use:
QT5_XCOMPILE=1 QT5_FORCE_STATIC=1 waf configure
"""
@@ -466,6 +482,9 @@ def configure(self):
The detection uses the program ``pkg-config`` through :py:func:`waflib.Tools.config_c.check_cfg`
"""
+ if 'COMPILER_CXX' not in self.env:
+ self.fatal('No CXX compiler defined: did you forget to configure compiler_cxx first?')
+
self.find_qt5_binaries()
self.set_qt5_libs_dir()
self.set_qt5_libs_to_check()
@@ -478,9 +497,6 @@ def configure(self):
if not has_xml:
Logs.error('No xml.sax support was found, rcc dependencies will be incomplete!')
- if 'COMPILER_CXX' not in self.env:
- self.fatal('No CXX compiler defined: did you forget to configure compiler_cxx first?')
-
# Qt5 may be compiled with '-reduce-relocations' which requires dependent programs to have -fPIE or -fPIC?
frag = '#include <QMap>\nint main(int argc, char **argv) {QMap<int,int> m;return m.keys().size();}\n'
uses = 'QT5CORE'
@@ -637,7 +653,7 @@ def set_qt5_libs_dir(self):
except Errors.WafError:
qtdir = self.cmd_and_log(env.QMAKE + ['-query', 'QT_INSTALL_PREFIX']).strip()
qtlibs = os.path.join(qtdir, 'lib')
- self.msg('Found the Qt5 libraries in', qtlibs)
+ self.msg('Found the Qt5 library path', qtlibs)
env.QTLIBS = qtlibs
@conf
diff --git a/Tools/waf_unit_test.py b/Tools/waf_unit_test.py
index 6ff6f72..dc66fe9 100644
--- a/Tools/waf_unit_test.py
+++ b/Tools/waf_unit_test.py
@@ -97,6 +97,7 @@ def make_interpreted_test(self):
if isinstance(v, str):
v = v.split(os.pathsep)
self.ut_env[k] = os.pathsep.join(p + v)
+ self.env.append_value('UT_DEPS', ['%r%r' % (key, self.ut_env[key]) for key in self.ut_env])
@feature('test')
@after_method('apply_link', 'process_use')
@@ -108,7 +109,8 @@ def make_test(self):
tsk = self.create_task('utest', self.link_task.outputs)
if getattr(self, 'ut_str', None):
self.ut_run, lst = Task.compile_fun(self.ut_str, shell=getattr(self, 'ut_shell', False))
- tsk.vars = lst + tsk.vars
+ tsk.vars = tsk.vars + lst
+ self.env.append_value('UT_DEPS', self.ut_str)
self.handle_ut_cwd('ut_cwd')
@@ -139,6 +141,10 @@ def make_test(self):
if not hasattr(self, 'ut_cmd'):
self.ut_cmd = getattr(Options.options, 'testcmd', False)
+ self.env.append_value('UT_DEPS', str(self.ut_cmd))
+ self.env.append_value('UT_DEPS', self.ut_paths)
+ self.env.append_value('UT_DEPS', ['%r%r' % (key, self.ut_env[key]) for key in self.ut_env])
+
@taskgen_method
def add_test_results(self, tup):
"""Override and return tup[1] to interrupt the build immediately if a test does not run"""
@@ -159,7 +165,7 @@ class utest(Task.Task):
"""
color = 'PINK'
after = ['vnum', 'inst']
- vars = []
+ vars = ['UT_DEPS']
def runnable_status(self):
"""