Merged revisions 82272 via svnmerge from
authorRonald Oussoren <ronaldoussoren@mac.com>
Sun, 27 Jun 2010 12:39:22 +0000 (12:39 +0000)
committerRonald Oussoren <ronaldoussoren@mac.com>
Sun, 27 Jun 2010 12:39:22 +0000 (12:39 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r82272 | ronald.oussoren | 2010-06-27 14:36:16 +0200 (Sun, 27 Jun 2010) | 8 lines

  Two small fixes for the support for SDKs on MacOSX:

  1) The code that checks if an path should be located in the SDK
     explicitly excludes /usr/local. This fixes issue9046

  2) The SDK variant for filtering "db_dirs_to_check" in setup.py
     was not doing anything because of a missing assignment.
........

Lib/distutils/unixccompiler.py
setup.py

index b76f0d41cf64593979ef618a020a1040c8c1514a..c49ac9ba918b03d1a8d95c7407ba0052f441d8f9 100644 (file)
@@ -324,7 +324,9 @@ class UnixCCompiler(CCompiler):
             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)
index 8aa4c09931a8fd35904bfe45884933e869e175c4..3094fdffc51d8954b4958b9ddef0f9bccc0aa1ab 100644 (file)
--- 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 PyBuildExt(build_ext):
                         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