diff options
author | Robert Managan <ramanagan@att.net> | 2012-11-18 00:03:24 (GMT) |
---|---|---|
committer | Robert Managan <ramanagan@att.net> | 2012-11-18 00:03:24 (GMT) |
commit | 118d042d9368075cefd3d74bd951a873816bde12 (patch) | |
tree | 4b4c1fda9661541ba26d03b0ac35db575469bae7 /src | |
parent | 4bd813d80758da1feecbf998d3e497b5fd895cb3 (diff) | |
download | SCons-118d042d9368075cefd3d74bd951a873816bde12.zip SCons-118d042d9368075cefd3d74bd951a873816bde12.tar.gz SCons-118d042d9368075cefd3d74bd951a873816bde12.tar.bz2 |
Change symlinks to match what ldconfig does
Diffstat (limited to 'src')
-rw-r--r-- | src/engine/SCons/Tool/__init__.py | 22 |
1 files changed, 17 insertions, 5 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) |