Issue #6834: replace the implementation for the 'python' and 'pythonw' executables on OSX.
The previous implementation used execv(2) to run the real interpreter, which means that
you cannot use the arch(1) tool to select the architecture you want to use for a
universal build because that only affects the python/pythonw wrapper and not the actual
interpreter.
The new version uses posix_spawnv with a number of OSX-specific options that ensure that
the real interpreter is started using the same CPU architecture as the wrapper, and that
means that 'arch -ppc python' now actually works.
I've also changed the way that the wrapper looks for the framework: it is now linked to
the framework rather than hardcoding the framework path. This should make it easier to
provide pythonw support in tools like virtualenv.
diff --git a/Mac/README b/Mac/README
index c4f6b65..988e624 100644
--- a/Mac/README
+++ b/Mac/README
@@ -25,7 +25,7 @@
Create a universal binary build of of Python. This can be used with both
regular and framework builds.
- The optional argument specifies with OSX SDK should be used to perform the
+ The optional argument specifies which OSX SDK should be used to perform the
build. This defaults to ``/Developer/SDKs/MacOSX.10.4u.sdk``, specify
``/`` when building on a 10.5 system, especially when building 64-bit code.
@@ -88,10 +88,29 @@
* ``intel``: ``i386``, ``x86_64``
-To build a universal binary that includes a 64-bit architecture you must build
-on a system running OSX 10.5 or later. The ``all`` flavour can only be build on
+To build a universal binary that includes a 64-bit architecture, you must build
+on a system running OSX 10.5 or later. The ``all`` flavour can only be built on
OSX 10.5.
+The makefile for a framework build will install ``python32`` and ``pythonw32``
+binaries when the universal architecures includes at least one 32-bit architecture
+(that is, for all flavours but ``64-bit``).
+
+Running a specific archicture
+.............................
+
+You can run code using a specific architecture using the ``arch`` command::
+
+ $ arch -i386 python
+
+Or to explicitly run in 32-bit mode, regardless of the machine hardware::
+
+ $ arch -i386 -ppc python
+
+NOTE: When you're using a framework install of Python this requires at least
+Python 2.7 or 3.2, in earlier versions the python (and pythonw) commands are
+wrapper tools that execute the real interpreter without ensuring that the
+real interpreter runs with the same architecture.
Building and using a framework-based Python on Mac OS X.
========================================================