diff options
| author | Ned Deily <nad@acm.org> | 2012-06-23 16:02:19 -0700 |
|---|---|---|
| committer | Ned Deily <nad@acm.org> | 2012-06-23 16:02:19 -0700 |
| commit | e562c287d7ac8c6e0f1d3642db817f049a7a6dd6 (patch) | |
| tree | dac5d873a5438b2e9d2e13970e128f55cc9f89b6 /unixccompiler.py | |
| parent | 844216fd4e4c528b8064a750ee0ab99f5e987894 (diff) | |
| download | python-setuptools-git-e562c287d7ac8c6e0f1d3642db817f049a7a6dd6.tar.gz | |
Issue #13590: Improve support for OS X Xcode 4:
- Try to avoid building Python or extension modules with problematic
llvm-gcc compiler.
- Since Xcode 4 removes ppc support, extension module builds now
check for ppc compiler support and automatically remove ppc and
ppc64 archs when not available.
- Since Xcode 4 no longer install SDKs in default locations,
extension module builds now revert to using installed headers
and libs if the SDK used to build the interpreter is not
available.
- Update ./configure to use better defaults for universal builds;
in particular, --enable-universalsdk=yes uses the Xcode default
SDK and --with-universal-archs now defaults to "intel" if ppc
not available.
Diffstat (limited to 'unixccompiler.py')
| -rw-r--r-- | unixccompiler.py | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/unixccompiler.py b/unixccompiler.py index c70a3cc5..5d45faa7 100644 --- a/unixccompiler.py +++ b/unixccompiler.py @@ -83,9 +83,8 @@ 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. + # Check if the SDK that is used during compilation actually exists. + # If not, revert to using the installed headers and hope for the best. sysroot = None if '-isysroot' in cc_args: idx = cc_args.index('-isysroot') @@ -97,7 +96,21 @@ def _darwin_compiler_fixup(compiler_so, cc_args): 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") + log.warn("Attempting to compile without the SDK") + while True: + try: + index = cc_args.index('-isysroot') + # Strip this argument and the next one: + del cc_args[index:index+2] + except ValueError: + break + while True: + try: + index = compiler_so.index('-isysroot') + # Strip this argument and the next one: + del compiler_so[index:index+2] + except ValueError: + break return compiler_so |
