Author: Wouter van Heyst <wouter.p...@richtlijn.be> Branch: osx-shared Changeset: r75181:ae514a359f3e Date: 2014-12-29 21:19 +0200 http://bitbucket.org/pypy/pypy/changeset/ae514a359f3e/
Log: Eliminate platform dependence in BasePosix.gen_makefile by moving rpath_flags onto BasePosix and overriding in Darwin. diff --git a/rpython/translator/platform/darwin.py b/rpython/translator/platform/darwin.py --- a/rpython/translator/platform/darwin.py +++ b/rpython/translator/platform/darwin.py @@ -11,6 +11,10 @@ so_ext = 'dylib' DEFAULT_CC = 'clang' + def __init__(self, cc=None): + super(Darwin, self).__init__(cc) + self.rpath_flags = ['-Wl,-rpath', '-Wl,@executable_path'] + def _args_for_shared(self, args): return (list(self.shared_only) + ['-dynamiclib', '-install_name', '@rpath/$(TARGET)', '-undefined', 'dynamic_lookup'] diff --git a/rpython/translator/platform/posix.py b/rpython/translator/platform/posix.py --- a/rpython/translator/platform/posix.py +++ b/rpython/translator/platform/posix.py @@ -17,6 +17,7 @@ def __init__(self, cc=None): self.cc = cc or os.environ.get('CC', self.DEFAULT_CC) + self.rpath_flags = ['-Wl,-rpath=\'$$ORIGIN/\''] def _libs(self, libraries): return ['-l%s' % lib for lib in libraries] @@ -140,11 +141,6 @@ rel_libdirs = [rpyrel(libdir) for libdir in self.preprocess_library_dirs(eci.library_dirs)] - if sys.platform == 'darwin': - rpath_flags = ['-Wl,-rpath', '-Wl,@executable_path'] - else: - rpath_flags = ['-Wl,-rpath=\'$$ORIGIN/\''] - m.comment('automatically generated makefile') definitions = [ ('RPYDIR', '"%s"' % rpydir), @@ -163,7 +159,7 @@ ('CC', self.cc), ('CC_LINK', eci.use_cpp_linker and 'g++' or '$(CC)'), ('LINKFILES', eci.link_files), - ('RPATH_FLAGS', rpath_flags), + ('RPATH_FLAGS', self.rpath_flags), ] for args in definitions: m.definition(*args) _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit