diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-06-21 07:06:09 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-06-21 07:06:09 +0200 |
commit | 71c19b5c2d38022afb2a5767a3f8da11d0f06444 (patch) | |
tree | 1f2a79dfe0ebe98c6b95d5a0a4f5615d9e4afaab /engine/SCons/Scanner/Prog.py | |
parent | 3f6052c28746cf9f29443a610ab60f5b02d3b658 (diff) | |
parent | b0f56d74df2a6904ddceb963833d4ea357251853 (diff) |
Merge tag 'upstream/2.3.5'
Upstream version 2.3.5
Diffstat (limited to 'engine/SCons/Scanner/Prog.py')
-rw-r--r-- | engine/SCons/Scanner/Prog.py | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/engine/SCons/Scanner/Prog.py b/engine/SCons/Scanner/Prog.py index 3bbc0f4..756f67d 100644 --- a/engine/SCons/Scanner/Prog.py +++ b/engine/SCons/Scanner/Prog.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2001 - 2014 The SCons Foundation +# Copyright (c) 2001 - 2015 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Scanner/Prog.py 2014/09/27 12:51:43 garyo" +__revision__ = "src/engine/SCons/Scanner/Prog.py pchdll:3325:cd517fae59a4 2015/06/18 06:53:27 bdbaddog" import SCons.Node import SCons.Node.FS @@ -38,6 +38,24 @@ def ProgramScanner(**kw): ps = SCons.Scanner.Base(scan, "ProgramScanner", **kw) return ps +def _subst_libs(env, libs): + """ + Substitute environment variables and split into list. + """ + if SCons.Util.is_String(libs): + libs = env.subst(libs) + if SCons.Util.is_String(libs): + libs = libs.split() + elif SCons.Util.is_Sequence(libs): + _libs = [] + for l in libs: + _libs += _subst_libs(env, l) + libs = _libs + else: + # libs is an object (Node, for example) + libs = [libs] + return libs + def scan(node, env, libpath = ()): """ This scanner scans program files for static-library @@ -50,10 +68,8 @@ def scan(node, env, libpath = ()): except KeyError: # There are no LIBS in this environment, so just return a null list: return [] - if SCons.Util.is_String(libs): - libs = libs.split() - else: - libs = SCons.Util.flatten(libs) + + libs = _subst_libs(env, libs) try: prefix = env['LIBPREFIXES'] @@ -83,7 +99,6 @@ def scan(node, env, libpath = ()): adjustixes = SCons.Util.adjustixes for lib in libs: if SCons.Util.is_String(lib): - lib = env.subst(lib) for pref, suf in pairs: l = adjustixes(lib, pref, suf) l = find_file(l, libpath, verbose=print_find_libs) |