Esempio n. 1
0
def osx_ch_link(path, link):
    assert path.startswith(build_prefix + '/')
    reldir = utils.rel_lib(path[len(build_prefix) + 1:])

    if link.startswith((build_prefix + '/lib', 'lib', '@executable_path/')):
        return '@loader_path/%s/%s' % (reldir, basename(link))

    if link == '/usr/local/lib/libgcc_s.1.dylib':
        return '/usr/lib/libgcc_s.1.dylib'
Esempio n. 2
0
def mk_relative(f):
    assert sys.platform != 'win32'
    if f.startswith('bin/'):
        fix_shebang(f)

    path = join(build_prefix, f)
    if sys.platform == 'linux2' and is_obj(path):
        runpath = '$ORIGIN/' + utils.rel_lib(f)
        call(['chrpath', '-c', '-r', runpath, path])

    if sys.platform == 'darwin' and is_obj(path):
        mk_relative_osx(path)