Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 87adb6e

Browse files
committed
Issue #14499: Fix several problems with OS X universal build support:
1. ppc arch detection for extension module builds broke with Xcode 5 2. ppc arch detection in configure did not work on OS X 10.4 3. -sysroot and -arch flags were unnecessarily duplicated 4. there was no obvious way to configure an intel-32 only build.
1 parent ea41d5f commit 87adb6e

5 files changed

Lines changed: 272 additions & 248 deletions

File tree

Lib/_osx_support.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -235,13 +235,19 @@ def _remove_unsupported_archs(_config_vars):
235235
if re.search('-arch\s+ppc', _config_vars['CFLAGS']) is not None:
236236
# NOTE: Cannot use subprocess here because of bootstrap
237237
# issues when building Python itself
238-
status = os.system("'%s' -arch ppc -x c /dev/null 2>/dev/null"%(
239-
_config_vars['CC'].replace("'", "'\"'\"'"),))
240-
# The Apple compiler drivers return status 255 if no PPC
241-
if (status >> 8) == 255:
242-
# Compiler doesn't support PPC, remove the related
243-
# '-arch' flags if not explicitly overridden by an
244-
# environment variable
238+
status = os.system(
239+
"""echo 'int main{};' | """
240+
"""'%s' -c -arch ppc -x c -o /dev/null /dev/null 2>/dev/null"""
241+
%(_config_vars['CC'].replace("'", "'\"'\"'"),))
242+
if status:
243+
# The compile failed for some reason. Because of differences
244+
# across Xcode and compiler versions, there is no reliable way
245+
# to be sure why it failed. Assume here it was due to lack of
246+
# PPC support and remove the related '-arch' flags from each
247+
# config variables not explicitly overriden by an environment
248+
# variable. If the error was for some other reason, we hope the
249+
# failure will show up again when trying to compile an extension
250+
# module.
245251
for cv in _UNIVERSAL_CONFIG_VARS:
246252
if cv in _config_vars and cv not in os.environ:
247253
flags = _config_vars[cv]

Mac/README

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Python on Mac OS X README
77
Ronald Oussoren (2010-04),
88
Ned Deily (2012-06)
99

10-
:Version: 3.3.0
10+
:Version: 3.4.0
1111

1212
This document provides a quick overview of some Mac OS X specific features in
1313
the Python distribution.
@@ -99,6 +99,8 @@ values are available:
9999

100100
* ``intel``: ``i386``, ``x86_64``
101101

102+
* ``intel-32``: ``i386``
103+
102104
* ``32-bit``: ``ppc``, ``i386``
103105

104106
* ``3-way``: ``i386``, ``x86_64``, ``ppc``
@@ -125,7 +127,7 @@ following combinations of SDKs and universal-archs flavors are available:
125127

126128
* 10.7 and 10.8 SDKs with Xcode 4 support ``intel`` only
127129

128-
The makefile for a framework build will also install ``python3.3-32``
130+
The makefile for a framework build will also install ``python3.4-32``
129131
binaries when the universal architecture includes at least one 32-bit
130132
architecture (that is, for all flavors but ``64-bit``).
131133

@@ -149,7 +151,7 @@ Using ``arch`` is not a perfect solution as the selected architecture will
149151
not automatically carry through to subprocesses launched by programs and tests
150152
under that Python. If you want to ensure that Python interpreters launched in
151153
subprocesses also run in 32-bit-mode if the main interpreter does, use
152-
a ``python3.3-32`` binary and use the value of ``sys.executable`` as the
154+
a ``python3.4-32`` binary and use the value of ``sys.executable`` as the
153155
``subprocess`` ``Popen`` executable value.
154156

155157

@@ -169,7 +171,7 @@ will have to do the work yourself if you really want this.
169171

170172
A second reason for using frameworks is that they put Python-related items in
171173
only two places: "/Library/Framework/Python.framework" and
172-
"/Applications/Python <VERSION>" where ``<VERSION>`` can be e.g. "3.3",
174+
"/Applications/Python <VERSION>" where ``<VERSION>`` can be e.g. "3.4",
173175
"2.7", etc. This simplifies matters for users installing
174176
Python from a binary distribution if they want to get rid of it again. Moreover,
175177
due to the way frameworks work, a user without admin privileges can install a

Misc/NEWS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,12 @@ Build
190190

191191
- Issue #15663: Update OS X 10.6+ installer to use Tcl/Tk 8.5.15.
192192

193+
- Issue #14499: Fix several problems with OS X universal build support:
194+
1. ppc arch detection for extension module builds broke with Xcode 5
195+
2. ppc arch detection in configure did not work on OS X 10.4
196+
3. -sysroot and -arch flags were unnecessarily duplicated
197+
4. there was no obvious way to configure an intel-32 only build.
198+
193199
What's New in Python 3.4.0 Alpha 3?
194200
===================================
195201

0 commit comments

Comments
 (0)