diff options
author | David Robillard <d@drobilla.net> | 2018-11-24 13:44:02 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2018-11-24 13:44:02 +0100 |
commit | d74de7f575a9ec49f96138c3c5251f28946c0c0e (patch) | |
tree | d9b620bfba1e7462df4ddb3f6225cc5216c0ca81 /waflib/extras/bjam.py | |
parent | c6e874c2cc1c5c99a3859112e1bba0f07bcdb8ba (diff) | |
download | ganv-d74de7f575a9ec49f96138c3c5251f28946c0c0e.tar.gz ganv-d74de7f575a9ec49f96138c3c5251f28946c0c0e.tar.bz2 ganv-d74de7f575a9ec49f96138c3c5251f28946c0c0e.zip |
Squashed 'waflib/' changes from 6e726eb..5ea8f99
5ea8f99 Improve test output spacing
0e23b29 Raise exception when test suite fails to ensure non-zero exit status
d6de073 Show run time of unit tests
5b65554 Add short configure option for ultra-strict flags
4687ba6 Use gtest-like test output
258903d Fix failure count in test group summaries
da07e73 Fix verbose tests with Python 3
git-subtree-dir: waflib
git-subtree-split: 5ea8f99f6e1246079c1fe6bb590c38a53aadd40d
Diffstat (limited to 'waflib/extras/bjam.py')
-rw-r--r-- | waflib/extras/bjam.py | 128 |
1 files changed, 0 insertions, 128 deletions
diff --git a/waflib/extras/bjam.py b/waflib/extras/bjam.py deleted file mode 100644 index 8e04d3a..0000000 --- a/waflib/extras/bjam.py +++ /dev/null @@ -1,128 +0,0 @@ -#! /usr/bin/env python -# per rosengren 2011 - -from os import sep, readlink -from waflib import Logs -from waflib.TaskGen import feature, after_method -from waflib.Task import Task, always_run - -def options(opt): - grp = opt.add_option_group('Bjam Options') - grp.add_option('--bjam_src', default=None, help='You can find it in <boost root>/tools/jam/src') - grp.add_option('--bjam_uname', default='linuxx86_64', help='bjam is built in <src>/bin.<uname>/bjam') - grp.add_option('--bjam_config', default=None) - grp.add_option('--bjam_toolset', default=None) - -def configure(cnf): - if not cnf.env.BJAM_SRC: - cnf.env.BJAM_SRC = cnf.options.bjam_src - if not cnf.env.BJAM_UNAME: - cnf.env.BJAM_UNAME = cnf.options.bjam_uname - try: - cnf.find_program('bjam', path_list=[ - cnf.env.BJAM_SRC + sep + 'bin.' + cnf.env.BJAM_UNAME - ]) - except Exception: - cnf.env.BJAM = None - if not cnf.env.BJAM_CONFIG: - cnf.env.BJAM_CONFIG = cnf.options.bjam_config - if not cnf.env.BJAM_TOOLSET: - cnf.env.BJAM_TOOLSET = cnf.options.bjam_toolset - -@feature('bjam') -@after_method('process_rule') -def process_bjam(self): - if not self.bld.env.BJAM: - self.create_task('bjam_creator') - self.create_task('bjam_build') - self.create_task('bjam_installer') - if getattr(self, 'always', False): - always_run(bjam_creator) - always_run(bjam_build) - always_run(bjam_installer) - -class bjam_creator(Task): - ext_out = 'bjam_exe' - vars=['BJAM_SRC', 'BJAM_UNAME'] - def run(self): - env = self.env - gen = self.generator - bjam = gen.bld.root.find_dir(env.BJAM_SRC) - if not bjam: - Logs.error('Can not find bjam source') - return -1 - bjam_exe_relpath = 'bin.' + env.BJAM_UNAME + '/bjam' - bjam_exe = bjam.find_resource(bjam_exe_relpath) - if bjam_exe: - env.BJAM = bjam_exe.srcpath() - return 0 - bjam_cmd = ['./build.sh'] - Logs.debug('runner: ' + bjam.srcpath() + '> ' + str(bjam_cmd)) - result = self.exec_command(bjam_cmd, cwd=bjam.srcpath()) - if not result == 0: - Logs.error('bjam failed') - return -1 - bjam_exe = bjam.find_resource(bjam_exe_relpath) - if bjam_exe: - env.BJAM = bjam_exe.srcpath() - return 0 - Logs.error('bjam failed') - return -1 - -class bjam_build(Task): - ext_in = 'bjam_exe' - ext_out = 'install' - vars = ['BJAM_TOOLSET'] - def run(self): - env = self.env - gen = self.generator - path = gen.path - bld = gen.bld - if hasattr(gen, 'root'): - build_root = path.find_node(gen.root) - else: - build_root = path - jam = bld.srcnode.find_resource(env.BJAM_CONFIG) - if jam: - Logs.debug('bjam: Using jam configuration from ' + jam.srcpath()) - jam_rel = jam.relpath_gen(build_root) - else: - Logs.warn('No build configuration in build_config/user-config.jam. Using default') - jam_rel = None - bjam_exe = bld.srcnode.find_node(env.BJAM) - if not bjam_exe: - Logs.error('env.BJAM is not set') - return -1 - bjam_exe_rel = bjam_exe.relpath_gen(build_root) - cmd = ([bjam_exe_rel] + - (['--user-config=' + jam_rel] if jam_rel else []) + - ['--stagedir=' + path.get_bld().path_from(build_root)] + - ['--debug-configuration'] + - ['--with-' + lib for lib in self.generator.target] + - (['toolset=' + env.BJAM_TOOLSET] if env.BJAM_TOOLSET else []) + - ['link=' + 'shared'] + - ['variant=' + 'release'] - ) - Logs.debug('runner: ' + build_root.srcpath() + '> ' + str(cmd)) - ret = self.exec_command(cmd, cwd=build_root.srcpath()) - if ret != 0: - return ret - self.set_outputs(path.get_bld().ant_glob('lib/*') + path.get_bld().ant_glob('bin/*')) - return 0 - -class bjam_installer(Task): - ext_in = 'install' - def run(self): - gen = self.generator - path = gen.path - for idir, pat in (('${LIBDIR}', 'lib/*'), ('${BINDIR}', 'bin/*')): - files = [] - for n in path.get_bld().ant_glob(pat): - try: - t = readlink(n.srcpath()) - gen.bld.symlink_as(sep.join([idir, n.name]), t, postpone=False) - except OSError: - files.append(n) - gen.bld.install_files(idir, files, postpone=False) - return 0 - |