Author: Wouter van Heyst <[email protected]>
Branch: osx-shared
Changeset: r75177:3fa7727c46a3
Date: 2014-12-21 19:44 +0200
http://bitbucket.org/pypy/pypy/changeset/3fa7727c46a3/
Log: Use @rpath on OSX to find libpypy-c.dylib
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
@@ -13,7 +13,7 @@
def _args_for_shared(self, args):
return (list(self.shared_only)
- + ['-dynamiclib', '-undefined', 'dynamic_lookup']
+ + ['-dynamiclib', '-install_name', '@rpath/$(TARGET)',
'-undefined', 'dynamic_lookup']
+ args)
def _include_dirs_for_libffi(self):
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
@@ -180,7 +180,12 @@
'int $(PYPY_MAIN_FUNCTION)(int, char*[]); '
'int main(int argc, char* argv[]) '
'{ return $(PYPY_MAIN_FUNCTION)(argc, argv); }" > $@')
- m.rule('$(DEFAULT_TARGET)', ['$(TARGET)', 'main.o'],
+ if sys.platform == 'darwin':
+ m.rule('$(DEFAULT_TARGET)', ['$(TARGET)', 'main.o'],
+ ['$(CC_LINK) $(LDFLAGS_LINK) main.o -L.
-l$(SHARED_IMPORT_LIB) -o $@',
+ 'install_name_tool -add_rpath @executable_path $@'])
+ else:
+ m.rule('$(DEFAULT_TARGET)', ['$(TARGET)', 'main.o'],
'$(CC_LINK) $(LDFLAGS_LINK) main.o -L.
-l$(SHARED_IMPORT_LIB) -o $@ -Wl,-rpath=\'$$ORIGIN/\'')
return m
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit