From 315503e9d53c5b525d455f58fd1ad9d6c8150897 Mon Sep 17 00:00:00 2001 From: wiredfool Date: Tue, 23 Apr 2013 21:09:32 -0700 Subject: [PATCH] Workaround for python issue: http://bugs.python.org/16754 in 3.2.x < 3.2.4 and 3.3.0 --- setup.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 65b8b1e42..1113c32a6 100644 --- a/setup.py +++ b/setup.py @@ -45,8 +45,18 @@ def _find_include_file(self, include): def _find_library_file(self, library): - return self.compiler.find_library_file(self.compiler.library_dirs, library) - + # Fix for 3.2.x <3.2.4, 3.3.0, shared lib extension is the python shared lib + # extension, not the system shared lib extension: e.g. .cpython-33.so vs .so + # See Python bug http://bugs.python.org/16754 + if 'cpython' in self.compiler.shared_lib_extension: + existing = self.compiler.shared_lib_extension + self.compiler.shared_lib_extension = "." + existing.split('.')[-1] + ret = self.compiler.find_library_file(self.compiler.library_dirs, library) + self.compiler.shared_lib_extension = existing + return ret + else: + return self.compiler.find_library_file(self.compiler.library_dirs, library) + def _find_version(filename): for line in open(filename).readlines():