diff options
author | Armin Rigo <arigo@tunes.org> | 2016-02-19 10:37:26 +0100 |
---|---|---|
committer | Armin Rigo <arigo@tunes.org> | 2016-02-19 10:37:26 +0100 |
commit | 11e551048da4dd36c488646acb77431a269a496a (patch) | |
tree | 06089d83bd6c2bf034e819679cb3e39856759ba0 /cffi | |
parent | 6bdddc4134898be19c1117d8b63be49446269ce5 (diff) | |
download | cffi-11e551048da4dd36c488646acb77431a269a496a.tar.gz |
more pypy tweaks
Diffstat (limited to 'cffi')
-rw-r--r-- | cffi/api.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/cffi/api.py b/cffi/api.py index 70ef93a..289bac3 100644 --- a/cffi/api.py +++ b/cffi/api.py @@ -550,6 +550,7 @@ class FFI(object): lst.append(value) # if '__pypy__' in sys.builtin_module_names: + import os if sys.platform == "win32": # we need 'libpypy-c.lib'. Current distributions of # pypy (>= 4.1) contain it as 'libs/python27.lib'. @@ -558,11 +559,15 @@ class FFI(object): ensure('library_dirs', os.path.join(sys.prefix, 'libs')) else: # we need 'libpypy-c.{so,dylib}', which should be by - # default located in 'sys.prefix/bin' + # default located in 'sys.prefix/bin' for installed + # systems. pythonlib = "pypy-c" if hasattr(sys, 'prefix'): - import os ensure('library_dirs', os.path.join(sys.prefix, 'bin')) + # On uninstalled pypy's, the libpypy-c is typically found in + # .../pypy/goal/. + if hasattr(sys, 'prefix'): + ensure('library_dirs', os.path.join(sys.prefix, 'pypy', 'goal')) else: if sys.platform == "win32": template = "python%d%d" |