From 118d042d9368075cefd3d74bd951a873816bde12 Mon Sep 17 00:00:00 2001 From: Robert Managan Date: Sat, 17 Nov 2012 16:03:24 -0800 Subject: Change symlinks to match what ldconfig does --- src/engine/SCons/Tool/__init__.py | 22 +++++++++++++++++----- test/LINK/VersionedLib.py | 2 -- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/engine/SCons/Tool/__init__.py b/src/engine/SCons/Tool/__init__.py index 35a05f0..4f46cd8 100644 --- a/src/engine/SCons/Tool/__init__.py +++ b/src/engine/SCons/Tool/__init__.py @@ -266,7 +266,9 @@ def VersionShLibLinkNames(version, libname, env): versionparts = version.split('.') major_name = linkname + "." + versionparts[0] minor_name = major_name + "." + versionparts[1] - for linkname in [major_name, minor_name]: + #Only add link for major_name + #for linkname in [major_name, minor_name]: + for linkname in [major_name, ]: if Verbose: print "VersionShLibLinkNames: linkname ",linkname, ", target ",libname linknames.append(linkname) @@ -323,12 +325,22 @@ symlinks for the platform we are on""" # here we need the full pathname so the links end up in the right directory libname = target[0].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 - for linkname in linknames: - os.symlink(lib_ver,linkname) - if Verbose: - print "VerShLib: made sym link of %s -> %s" % (linkname, lib_ver) + # make symlink of adjacent names in linknames + for count in range(len(linknames)): + linkname = linknames[count] + if count > 0: + os.symlink(os.path.basename(linkname),lastname) + if Verbose: + print "VerShLib: made sym link of %s -> %s" % (lastname,linkname) + lastname = linkname + # finish chain of sym links with link to the actual library + os.symlink(lib_ver,lastname) + if Verbose: + print "VerShLib: made sym link of %s -> %s" % (lib_ver,linkname) return result ShLibAction = SCons.Action.Action(VersionedSharedLibrary, None) diff --git a/test/LINK/VersionedLib.py b/test/LINK/VersionedLib.py index 0460444..5b6ba77 100644 --- a/test/LINK/VersionedLib.py +++ b/test/LINK/VersionedLib.py @@ -102,7 +102,6 @@ if platform == 'posix': files = [ 'libtest.so', 'libtest.so.2', - 'libtest.so.2.5', 'libtest.so.2.5.4', 'test.os', ] @@ -110,7 +109,6 @@ if platform == 'posix': instfiles = [ 'libtest.so', 'libtest.so.2', - 'libtest.so.2.5', 'libtest.so.2.5.4', ] elif platform == 'darwin': -- cgit v0.12