diff options
-rw-r--r-- | setup.py | 20 |
1 files changed, 18 insertions, 2 deletions
@@ -29,7 +29,7 @@ import platform import sys from ctypes import * -from ctypes.util import _findLib_gcc +from ctypes.util import * from distutils.command.build import build as _build from distutils.command.clean import clean as _clean from distutils.sysconfig import EXEC_PREFIX as _exec_prefix @@ -52,11 +52,27 @@ default_python_incdir = get_python_inc() default_python_libdir = get_python_lib() default_library_paths = [default_python_libdir] +# +# Prefix directory for ./configure +# +configure_prefix="/usr" +if platform_str.find("Darwin") > -1: + # + # There appears to be a bug with OS 10.9 and later where + # specifying -L/usr/lib to the linker *will not* search + # /usr/lib, but will resolve to a directory in the Xcode + # tree. + # + mac_major = int(platform.mac_ver()[0].split(".")[0]) + mac_minor = int(platform.mac_ver()[0].split(".")[1]) + if mac_major == 10 and mac_minor > 9: + configure_prefix="/usr/local" # utility routines def _find_library(name): target_lib = None if os.name == 'posix' and sys.platform.startswith('linux'): + from ctypes.util import _findLib_gcc target_lib = _findLib_gcc(name) else: target_lib = find_library(name) @@ -156,7 +172,7 @@ class build(_build): if (os.path.isdir(locallibsrcdir)): curdir = os.getcwd() os.chdir(locallibsrcdir) - configure_cmd = ("./configure --prefix=/usr") + configure_cmd = ("./configure --prefix=%s" % configure_prefix) if platform_arch[0].startswith('64'): if os.path.exists('/usr/lib64'): configure_cmd = configure_cmd + " --libdir=/usr/lib64" |