diff --git a/Lib/distutils/unixccompiler.py b/Lib/distutils/unixccompiler.py index b76f0d41cf6..c49ac9ba918 100644 --- a/Lib/distutils/unixccompiler.py +++ b/Lib/distutils/unixccompiler.py @@ -324,7 +324,9 @@ def find_library_file(self, dirs, lib, debug=0): static = os.path.join(dir, static_f) if sys.platform == 'darwin' and ( - dir.startswith('/System/') or dir.startswith('/usr/')): + dir.startswith('/System/') or ( + dir.startswith('/usr/') and not dir.startswith('/usr/local/'))): + shared = os.path.join(sysroot, dir[1:], shared_f) dylib = os.path.join(sysroot, dir[1:], dylib_f) static = os.path.join(sysroot, dir[1:], static_f) diff --git a/setup.py b/setup.py index 8aa4c09931a..3094fdffc51 100644 --- a/setup.py +++ b/setup.py @@ -44,7 +44,7 @@ def is_macosx_sdk_path(path): """ Returns True if 'path' can be located in an OSX SDK """ - return path.startswith('/usr/') or path.startswith('/System/') + return (path.startswith('/usr/') and not path.startswith('/usr/local')) or path.startswith('/System/') def find_file(filename, std_dirs, paths): """Searches for the directory where a given file is located, @@ -937,6 +937,7 @@ class db_found(Exception): pass else: if os.path.isdir(dn): tmp.append(dn) + db_dirs_to_check = tmp # Look for a version specific db-X.Y before an ambiguoius dbX # XXX should we -ever- look for a dbX name? Do any