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)

    if version != None:
        # libname includes the version number if one was given
        linknames = SCons.Tool.VersionShLibLinkNames(version,libname,env)
        if Verbose:
            print "versionedLibLinks: linknames ",linknames
        # Here we just need the file name w/o path as the target of the link
        lib_ver = libname
        # make symlink of adjacent names in linknames
        for count in range(len(linknames)):
            linkname = linknames[count]
            fulllinkname = os.path.join(install_dir, linkname)
            if Verbose:
                print "full link name ",fulllinkname
            if count > 0:
                try:
                    os.remove(lastlinkname)
                except:
                    pass
                os.symlink(os.path.basename(fulllinkname),lastlinkname)
                if Verbose:
                    print "versionedLibLinks: made sym link of %s -> %s" % (lastlinkname,os.path.basename(fulllinkname))
            lastlinkname = fulllinkname
        # finish chain of sym links with link to the actual library
        if len(linknames)>0:
            try:
                os.remove(lastlinkname)
            except:
                pass
            os.symlink(lib_ver,lastlinkname)
            if Verbose:
                print "versionedLibLinks: made sym link of %s -> %s" % (lib_ver,lastlinkname)
    return
dataset/ETHPy150Open kayhayen/Nuitka/nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/install.py/versionedLibLinks/original