summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRonald Oussoren <ronaldoussoren@mac.com>2006-10-08 17:51:46 (GMT)
committerRonald Oussoren <ronaldoussoren@mac.com>2006-10-08 17:51:46 (GMT)
commitd6272a3cf6cf791abd25b03a2e418d2b382411a7 (patch)
treed7ba2ebb6456dfe001daf7a70d4311eadc8844d7
parentd610369e8b63930b5a7b1bdafebd3c64af6b4b28 (diff)
downloadcpython-d6272a3cf6cf791abd25b03a2e418d2b382411a7.zip
cpython-d6272a3cf6cf791abd25b03a2e418d2b382411a7.tar.gz
cpython-d6272a3cf6cf791abd25b03a2e418d2b382411a7.tar.bz2
MacOSX: The universal build requires that users have the MacOSX10.4u SDK
installed to build extensions. This patch makes distutils emit a warning when the compiler should use an SDK but that SDK is not installed, hopefully reducing some confusion.
-rw-r--r--Lib/distutils/unixccompiler.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/Lib/distutils/unixccompiler.py b/Lib/distutils/unixccompiler.py
index 6cd14f7..d1fd1d9 100644
--- a/Lib/distutils/unixccompiler.py
+++ b/Lib/distutils/unixccompiler.py
@@ -82,6 +82,22 @@ def _darwin_compiler_fixup(compiler_so, cc_args):
except ValueError:
pass
+ # Check if the SDK that is used during compilation actually exists,
+ # the universal build requires the usage of a universal SDK and not all
+ # users have that installed by default.
+ sysroot = None
+ if '-isysroot' in cc_args:
+ idx = cc_args.index('-isysroot')
+ sysroot = cc_args[idx+1]
+ elif '-isysroot' in compiler_so:
+ idx = compiler_so.index('-isysroot')
+ sysroot = compiler_so[idx+1]
+
+ if sysroot and not os.path.isdir(sysroot):
+ log.warn("Compiling with an SDK that doesn't seem to exist: %s",
+ sysroot)
+ log.warn("Please check your Xcode installation")
+
return compiler_so
class UnixCCompiler(CCompiler):