diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-06-21 07:06:07 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-06-21 07:06:07 +0200 |
commit | b0f56d74df2a6904ddceb963833d4ea357251853 (patch) | |
tree | cad0dca521f39475abf774e513b7883ee96ea13d /engine/SCons/Tool/install.py | |
parent | 665e78e013bc207a5ec35e4bc41daf2e464f6ed3 (diff) |
Imported Upstream version 2.3.5upstream/2.3.5
Diffstat (limited to 'engine/SCons/Tool/install.py')
-rw-r--r-- | engine/SCons/Tool/install.py | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/engine/SCons/Tool/install.py b/engine/SCons/Tool/install.py index 5aff9a8..51e451f 100644 --- a/engine/SCons/Tool/install.py +++ b/engine/SCons/Tool/install.py @@ -8,7 +8,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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/install.py 2014/09/27 12:51:43 garyo" +__revision__ = "src/engine/SCons/Tool/install.py pchdll:3325:cd517fae59a4 2015/06/18 06:53:27 bdbaddog" import os import re @@ -145,22 +145,26 @@ def copyFuncVersionedLib(dest, source, env): return 0 -def versionedLibVersion(dest, env): +def versionedLibVersion(dest, source, env): """Check if dest is a version shared library name. Return version, libname, & install_dir if it is.""" Verbose = False platform = env.subst('$PLATFORM') - if not (platform == 'posix' or platform == 'darwin'): + if not (platform == 'posix' or platform == 'darwin' or platform == 'sunos'): return (None, None, None) - libname = os.path.basename(dest) - install_dir = os.path.dirname(dest) + if (hasattr(source[0], 'attributes') and + hasattr(source[0].attributes, 'shlibname')): + libname = source[0].attributes.shlibname + else: + libname = os.path.basename(str(dest)) + install_dir = os.path.dirname(str(dest)) shlib_suffix = env.subst('$SHLIBSUFFIX') # See if the source name is a versioned shared library, get the version number result = False version_re = re.compile("[0-9]+\\.[0-9]+\\.[0-9a-zA-Z]+") version_File = None - if platform == 'posix': + if platform == 'posix' or platform == 'sunos': # handle unix names versioned_re = re.compile(re.escape(shlib_suffix + '.') + "[0-9]+\\.[0-9]+\\.[0-9a-zA-Z]+") result = versioned_re.findall(libname) @@ -196,7 +200,7 @@ def versionedLibLinks(dest, source, env): """If we are installing a versioned shared library create the required links.""" Verbose = False linknames = [] - version, libname, install_dir = versionedLibVersion(dest, env) + version, libname, install_dir = versionedLibVersion(dest, source, env) if version != None: # libname includes the version number if one was given @@ -258,7 +262,11 @@ def installFuncVersionedLib(target, source, env): assert len(target)==len(source), \ "Installing source %s into target %s: target and source lists must have same length."%(list(map(str, source)), list(map(str, target))) for t,s in zip(target,source): - if install(t.get_path(),s.get_path(),env): + if hasattr(t.attributes, 'shlibname'): + tpath = os.path.join(t.get_dir(), t.attributes.shlibname) + else: + tpath = t.get_path() + if install(tpath,s.get_path(),env): return 1 return 0 @@ -301,7 +309,7 @@ def add_versioned_targets_to_INSTALLED_FILES(target, source, env): print "ver lib emitter ",repr(target) # see if we have a versioned shared library, if so generate side effects - version, libname, install_dir = versionedLibVersion(target[0].path, env) + version, libname, install_dir = versionedLibVersion(target[0], source, env) if version != None: # generate list of link names linknames = SCons.Tool.VersionShLibLinkNames(version,libname,env) |