diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-06-21 07:55:31 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-06-21 07:55:31 +0200 |
commit | 39fa0bace059116d9a45e09fcd18691390b166bd (patch) | |
tree | 77f5abf2964bd92dc9e338654a4ffaaffc24d9ce /src/engine/SCons/Tool/link.py | |
parent | f9b0c331d8b9d03be91b56e324f59424af45302b (diff) | |
parent | f7e5d2b46b03cc4bc09c38f7e0873378bb9c3b78 (diff) |
Merge tag 'upstream/2.3.5'
Upstream version 2.3.5
Diffstat (limited to 'src/engine/SCons/Tool/link.py')
-rw-r--r-- | src/engine/SCons/Tool/link.py | 38 |
1 files changed, 26 insertions, 12 deletions
diff --git a/src/engine/SCons/Tool/link.py b/src/engine/SCons/Tool/link.py index 3871e8d..c936705 100644 --- a/src/engine/SCons/Tool/link.py +++ b/src/engine/SCons/Tool/link.py @@ -9,7 +9,7 @@ selection method. """ # -# 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 @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/link.py 2014/09/27 12:51:43 garyo" +__revision__ = "src/engine/SCons/Tool/link.py pchdll:3325:cd517fae59a4 2015/06/18 06:53:27 bdbaddog" import re @@ -82,13 +82,18 @@ def shlib_emitter(target, source, env): version = env.subst('$SHLIBVERSION') if version: version_names = shlib_emitter_names(target, source, env) - # change the name of the target to include the version number - target[0].name = version_names[0] - for name in version_names: - env.SideEffect(name, target[0]) - env.Clean(target[0], name) + # mark the target with the shared libraries name, including + # the version number + target[0].attributes.shlibname = version_names[0] + shlib = env.File(version_names[0], directory=target[0].get_dir()) + target[0].attributes.shlibpath = shlib.path + for name in version_names[1:]: + env.SideEffect(name, shlib) + env.Clean(shlib, name) if Verbose: print "shlib_emitter: add side effect - ",name + env.Clean(shlib, target[0]) + return ([shlib], source) except KeyError: version = None return (target, source) @@ -105,11 +110,14 @@ def shlib_emitter_names(target, source, env): # We need a version of the form x.y.z to proceed raise ValueError if version: - if platform == 'posix': + if platform == 'posix' or platform == 'sunos': versionparts = version.split('.') - name = target[0].name + if hasattr(target[0].attributes, 'shlibname'): + name = target[0].attributes.shlibname + else: + name = target[0].name # generate library name with the version number - version_name = target[0].name + '.' + version + version_name = name + '.' + version if Verbose: print "shlib_emitter_names: target is ", version_name print "shlib_emitter_names: side effect: ", name @@ -125,7 +133,10 @@ def shlib_emitter_names(target, source, env): version_names.append(name) elif platform == 'darwin': shlib_suffix = env.subst('$SHLIBSUFFIX') - name = target[0].name + if hasattr(target[0].attributes, 'shlibname'): + name = target[0].attributes.shlibname + else: + name = target[0].name # generate library name with the version number suffix_re = re.escape(shlib_suffix) version_name = re.sub(suffix_re, '.' + version + shlib_suffix, name) @@ -136,7 +147,10 @@ def shlib_emitter_names(target, source, env): version_names.append(version_name) elif platform == 'cygwin': shlib_suffix = env.subst('$SHLIBSUFFIX') - name = target[0].name + if hasattr(target[0].attributes, 'shlibname'): + name = target[0].attributes.shlibname + else: + name = target[0].name # generate library name with the version number suffix_re = re.escape(shlib_suffix) version_name = re.sub(suffix_re, '-' + re.sub('\.', '-', version) + shlib_suffix, name) |