[pypy-commit] pypy default: Fix, notably for Pillow's setup.py which calls find_library_file() to
arigo
pypy.commits at gmail.com
Thu Jan 19 09:40:27 EST 2017
Author: Armin Rigo <arigo at tunes.org>
Branch:
Changeset: r89672:66ef3eb6a91e
Date: 2017-01-19 15:39 +0100
http://bitbucket.org/pypy/pypy/changeset/66ef3eb6a91e/
Log: Fix, notably for Pillow's setup.py which calls find_library_file()
to locate the system's lib files
diff --git a/lib-python/2.7/distutils/unixccompiler.py b/lib-python/2.7/distutils/unixccompiler.py
--- a/lib-python/2.7/distutils/unixccompiler.py
+++ b/lib-python/2.7/distutils/unixccompiler.py
@@ -310,6 +310,10 @@
static = os.path.join(sysroot, dir[1:], static_f)
xcode_stub = os.path.join(sysroot, dir[1:], xcode_stub_f)
+ # PyPy extension here: 'shared' usually ends in something
+ # like '.pypy-41.so'. Try without the '.pypy-41' part too.
+ shared_no_pypy = re.sub(r'[.]pypy[^.]+([.][^.]+)$', r'\1', shared)
+
# We're second-guessing the linker here, with not much hard
# data to go on: GCC seems to prefer the shared library, so I'm
# assuming that *all* Unix C compilers do. And of course I'm
@@ -320,6 +324,8 @@
return xcode_stub
elif os.path.exists(shared):
return shared
+ elif os.path.exists(shared_no_pypy):
+ return shared_no_pypy
elif os.path.exists(static):
return static
More information about the pypy-commit
mailing list