summaryrefslogtreecommitdiff
path: root/engine/SCons/Tool/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'engine/SCons/Tool/__init__.py')
-rw-r--r--engine/SCons/Tool/__init__.py21
1 files changed, 15 insertions, 6 deletions
diff --git a/engine/SCons/Tool/__init__.py b/engine/SCons/Tool/__init__.py
index 56a7d80..fbd482d 100644
--- a/engine/SCons/Tool/__init__.py
+++ b/engine/SCons/Tool/__init__.py
@@ -14,7 +14,7 @@ tool definition.
"""
#
-# 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
@@ -35,7 +35,7 @@ tool definition.
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-__revision__ = "src/engine/SCons/Tool/__init__.py 2014/09/27 12:51:43 garyo"
+__revision__ = "src/engine/SCons/Tool/__init__.py pchdll:3325:cd517fae59a4 2015/06/18 06:53:27 bdbaddog"
import imp
import sys
@@ -256,7 +256,7 @@ def VersionShLibLinkNames(version, libname, env):
if Verbose:
print "VersionShLibLinkNames: linkname = ",linkname
linknames.append(linkname)
- elif platform == 'posix':
+ elif platform == 'posix' or platform == 'sunos':
if sys.platform.startswith('openbsd'):
# OpenBSD uses x.y shared library versioning numbering convention
# and doesn't use symlinks to backwards-compatible libraries
@@ -293,7 +293,7 @@ symlinks for the platform we are on"""
version = None
# libname includes the version number if one was given
- libname = target[0].name
+ libname = getattr(target[0].attributes, 'shlibname', target[0].name)
platform = env.subst('$PLATFORM')
shlib_suffix = env.subst('$SHLIBSUFFIX')
shlink_flags = SCons.Util.CLVar(env.subst('$SHLINKFLAGS'))
@@ -317,6 +317,11 @@ symlinks for the platform we are on"""
shlink_flags += [ '-Wl,-soname=%s' % soname ]
if Verbose:
print " soname ",soname,", shlink_flags ",shlink_flags
+ elif platform == 'sunos':
+ suffix_re = re.escape(shlib_suffix + '.' + version)
+ (major, age, revision) = version.split(".")
+ soname = re.sub(suffix_re, shlib_suffix, libname) + '.' + major
+ shlink_flags += [ '-h', soname ]
elif platform == 'cygwin':
shlink_flags += [ '-Wl,-Bsymbolic',
'-Wl,--out-implib,${TARGET.base}.a' ]
@@ -335,12 +340,16 @@ symlinks for the platform we are on"""
if version:
# here we need the full pathname so the links end up in the right directory
- libname = target[0].path
+ libname = getattr(target[0].attributes, 'shlibpath', target[0].path)
+ if Verbose:
+ print "VerShLib: target lib is = ", libname
+ print "VerShLib: name is = ", target[0].name
+ print "VerShLib: dir is = ", target[0].dir.path
linknames = VersionShLibLinkNames(version, libname, env)
if Verbose:
print "VerShLib: linknames ",linknames
# Here we just need the file name w/o path as the target of the link
- lib_ver = target[0].name
+ lib_ver = getattr(target[0].attributes, 'shlibname', target[0].name)
# make symlink of adjacent names in linknames
for count in range(len(linknames)):
linkname = linknames[count]