summaryrefslogtreecommitdiffstats
path: root/waflib/extras/softlink_libs.py
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-03-17 17:31:05 +0100
committerDavid Robillard <d@drobilla.net>2019-03-17 17:31:05 +0100
commit406f89271452fdb573c7e28113b1ed08ff2b4eda (patch)
treed2dcbaf61f3749f73dc7a5e10d3fc6cd5e6e129a /waflib/extras/softlink_libs.py
parent7983a5aae615290d04fd43cbc2752f8cf4a46d10 (diff)
downloadsuil-406f89271452fdb573c7e28113b1ed08ff2b4eda.tar.gz
suil-406f89271452fdb573c7e28113b1ed08ff2b4eda.tar.bz2
suil-406f89271452fdb573c7e28113b1ed08ff2b4eda.zip
Squashed 'waflib/' changes from 915dcb1..e7a29b6
e7a29b6 Upgrade to waf 2.0.15 8280f9d Add command for running executables from the build directory 8073c1a Make make_simple_dox() safe in case of exception 70d03b8 Avoid use of global counter hacks for configuration display b7d689a Rewrite test framework 94deadf Automatically add options and move add_flags() to options context f4259ee Reduce system include path noise 927b608 Automatically display configuration header c44b8f3 Set line justification from a constant in the wscript a48e26f Automatically detect if wscript has a test hook ef66724 Save runtime variables in the environment 63bcbcd Clean up TestContext b1d9505 Add ExecutionContext for setting runtime environment 387c1df Add show_diff() and test_file_equals() utilities 29d4d29 Fix in-tree library paths 9fde01f Add custom configuration context 6d3612f Add lib_path_name constant git-subtree-dir: waflib git-subtree-split: e7a29b6b9b2f842314244c23c14d8f8f560904e1
Diffstat (limited to 'waflib/extras/softlink_libs.py')
-rw-r--r--waflib/extras/softlink_libs.py76
1 files changed, 0 insertions, 76 deletions
diff --git a/waflib/extras/softlink_libs.py b/waflib/extras/softlink_libs.py
deleted file mode 100644
index 50c777f..0000000
--- a/waflib/extras/softlink_libs.py
+++ /dev/null
@@ -1,76 +0,0 @@
-#! /usr/bin/env python
-# per rosengren 2011
-
-from waflib.TaskGen import feature, after_method
-from waflib.Task import Task, always_run
-from os.path import basename, isabs
-from os import tmpfile, linesep
-
-def options(opt):
- grp = opt.add_option_group('Softlink Libraries Options')
- grp.add_option('--exclude', default='/usr/lib,/lib', help='No symbolic links are created for libs within [%default]')
-
-def configure(cnf):
- cnf.find_program('ldd')
- if not cnf.env.SOFTLINK_EXCLUDE:
- cnf.env.SOFTLINK_EXCLUDE = cnf.options.exclude.split(',')
-
-@feature('softlink_libs')
-@after_method('process_rule')
-def add_finder(self):
- tgt = self.path.find_or_declare(self.target)
- self.create_task('sll_finder', tgt=tgt)
- self.create_task('sll_installer', tgt=tgt)
- always_run(sll_installer)
-
-class sll_finder(Task):
- ext_out = 'softlink_libs'
- def run(self):
- bld = self.generator.bld
- linked=[]
- target_paths = []
- for g in bld.groups:
- for tgen in g:
- # FIXME it might be better to check if there is a link_task (getattr?)
- target_paths += [tgen.path.get_bld().bldpath()]
- linked += [t.outputs[0].bldpath()
- for t in getattr(tgen, 'tasks', [])
- if t.__class__.__name__ in
- ['cprogram', 'cshlib', 'cxxprogram', 'cxxshlib']]
- lib_list = []
- if len(linked):
- cmd = [self.env.LDD] + linked
- # FIXME add DYLD_LIBRARY_PATH+PATH for osx+win32
- ldd_env = {'LD_LIBRARY_PATH': ':'.join(target_paths + self.env.LIBPATH)}
- # FIXME the with syntax will not work in python 2
- with tmpfile() as result:
- self.exec_command(cmd, env=ldd_env, stdout=result)
- result.seek(0)
- for line in result.readlines():
- words = line.split()
- if len(words) < 3 or words[1] != '=>':
- continue
- lib = words[2]
- if lib == 'not':
- continue
- if any([lib.startswith(p) for p in
- [bld.bldnode.abspath(), '('] +
- self.env.SOFTLINK_EXCLUDE]):
- continue
- if not isabs(lib):
- continue
- lib_list.append(lib)
- lib_list = sorted(set(lib_list))
- self.outputs[0].write(linesep.join(lib_list + self.env.DYNAMIC_LIBS))
- return 0
-
-class sll_installer(Task):
- ext_in = 'softlink_libs'
- def run(self):
- tgt = self.outputs[0]
- self.generator.bld.install_files('${LIBDIR}', tgt, postpone=False)
- lib_list=tgt.read().split()
- for lib in lib_list:
- self.generator.bld.symlink_as('${LIBDIR}/'+basename(lib), lib, postpone=False)
- return 0
-