diff setup.py @ 78445:6af33673e955

Issue #15560: Fix building _sqlite3 extension on OS X with an SDK.
author Ned Deily <nad@acm.org>
date Sun, 05 Aug 2012 15:13:33 -0700
parents d706a6f4724c
children 5966c206654b
line wrap: on
line diff
--- a/setup.py	Sun Aug 05 15:12:20 2012 -0700
+++ b/setup.py	Sun Aug 05 15:13:33 2012 -0700
@@ -1041,12 +1041,12 @@
         if host_platform == 'darwin':
             sysroot = macosx_sdk_root()
 
-        for d in inc_dirs + sqlite_inc_paths:
-            f = os.path.join(d, "sqlite3.h")
+        for d_ in inc_dirs + sqlite_inc_paths:
+            d = d_
+            if host_platform == 'darwin' and is_macosx_sdk_path(d):
+                d = os.path.join(sysroot, d[1:])
 
-            if host_platform == 'darwin' and is_macosx_sdk_path(d):
-                f = os.path.join(sysroot, d[1:], "sqlite3.h")
-
+            f = os.path.join(d, "sqlite3.h")
             if os.path.exists(f):
                 if sqlite_setup_debug: print("sqlite: found %s"%f)
                 with open(f) as file: