Commit 455c8e6a authored by Michael Davidsaver's avatar Michael Davidsaver

cleanup

parent adb9721b
......@@ -2,10 +2,18 @@
from setuptools import setup as _setup
from .dsocmd import DSO, Extension, build_dso, build_ext
__all__ = (
'DSO',
'Extension',
'build_dso',
'build_ext',
'setup',
)
def setup(**kws):
cmdclass = kws.get('cmdclass', {})
cmdclass['build_dso'] = build_dso
cmdclass['build_ext'] = build_ext
kws['cmdclass'] = cmdclass
kws['zip_safe'] = kws.get('zip_safe', False) and len(kws.get('x_dsos', []))==0
kws['zip_safe'] = kws.get('zip_safe', False) and len(kws.get('ext_modules', []))==0 and len(kws.get('x_dsos', []))==0
_setup(**kws)
......@@ -276,13 +276,9 @@ class build_ext(_build_ext):
osx_changes.append(('@loader_path/'+fullname, '@loader_path/%s/%s'%(os.path.relpath(dsopath, mypath), fullname)))
# -dylib_file A:B asks the linker to do the equivlaent of:
# In theory -dylib_file A:B asks the linker to do the equivlaent of:
# install_name_tool -change A B
ext.extra_link_args.extend([
'-v',
'-dylib_file',
'@loader_path/%s:@loader_path/%s/%s'%(fullname, os.path.relpath(dsopath, mypath), fullname),
])
# But this seems not to work. So we call install_name_tool below
found = True
break
......@@ -295,11 +291,6 @@ class build_ext(_build_ext):
if platform.system() == 'Linux':
ext.extra_link_args.extend(['-Wl,-rpath,$ORIGIN/%s'%os.path.relpath(dsopath, mypath)])
elif sys.platform == 'darwin':
pass # TODO: avoid otool games with: -dylib_file <install_name>:@loader_path/<my_rel_path>
else:
pass # PE has nothing like rpath or install_name, so will have to set PATH when loading
# the Darwin linker errors if given non-existant directories :(
[self.mkpath(D) for D in ext.library_dirs]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment