Index: configure =================================================================== --- configure (revision 74672) +++ configure (working copy) @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 74667 . +# From configure.in Revision: 74672 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for python 2.7. # @@ -1336,7 +1336,7 @@ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-universal-archs=ARCH select architectures for universal build ("32-bit", - "64-bit" or "all") + "64-bit", "3-way", "intel" or "all") --with-framework-name=FRAMEWORK specify an alternate name of the framework built with --enable-framework @@ -4694,6 +4694,14 @@ UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch ppc64 -arch x86_64" ARCH_RUN_32BIT="arch -i386 -ppc" + elif test "$UNIVERSAL_ARCHS" = "intel" ; then + UNIVERSAL_ARCH_FLAGS="-arch i386 -arch x86_64" + ARCH_RUN_32BIT="arch -i386" + + elif test "$UNIVERSAL_ARCHS" = "3-way" ; then + UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch x86_64" + ARCH_RUN_32BIT="arch -i386 -ppc" + else { { echo "$as_me:$LINENO: error: proper usage is --with-universalarch=32-bit|64-bit|all" >&5 echo "$as_me: error: proper usage is --with-universalarch=32-bit|64-bit|all" >&2;} @@ -4721,6 +4729,15 @@ # that's the first OS release where # 4-way builds make sense. cur_target='10.5' + + elif test "${UNIVERSAL_ARCHS}" = "3-way"; then + cur_target='10.5' + + elif test "${UNIVERSAL_ARCHS}" = "intel"; then + cur_target='10.5' + + elif test "${UNIVERSAL_ARCHS}" = "64-bit"; then + cur_target='10.5' fi else if test `arch` = "i386"; then Index: configure.in =================================================================== --- configure.in (revision 74672) +++ configure.in (working copy) @@ -114,7 +114,7 @@ UNIVERSAL_ARCHS="32-bit" AC_MSG_CHECKING(for --with-universal-archs) AC_ARG_WITH(universal-archs, - AC_HELP_STRING(--with-universal-archs=ARCH, select architectures for universal build ("32-bit", "64-bit" or "all")), + AC_HELP_STRING(--with-universal-archs=ARCH, select architectures for universal build ("32-bit", "64-bit", "3-way", "intel" or "all")), [ AC_MSG_RESULT($withval) UNIVERSAL_ARCHS="$withval" @@ -952,6 +952,14 @@ UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch ppc64 -arch x86_64" ARCH_RUN_32BIT="arch -i386 -ppc" + elif test "$UNIVERSAL_ARCHS" = "intel" ; then + UNIVERSAL_ARCH_FLAGS="-arch i386 -arch x86_64" + ARCH_RUN_32BIT="arch -i386" + + elif test "$UNIVERSAL_ARCHS" = "3-way" ; then + UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch x86_64" + ARCH_RUN_32BIT="arch -i386 -ppc" + else AC_MSG_ERROR([proper usage is --with-universalarch=32-bit|64-bit|all]) @@ -977,6 +985,15 @@ # that's the first OS release where # 4-way builds make sense. cur_target='10.5' + + elif test "${UNIVERSAL_ARCHS}" = "3-way"; then + cur_target='10.5' + + elif test "${UNIVERSAL_ARCHS}" = "intel"; then + cur_target='10.5' + + elif test "${UNIVERSAL_ARCHS}" = "64-bit"; then + cur_target='10.5' fi else if test `arch` = "i386"; then Index: Misc/NEWS =================================================================== --- Misc/NEWS (revision 74672) +++ Misc/NEWS (working copy) @@ -1189,6 +1189,11 @@ Build ----- +- Add 2 new options to ``--with-universal-archs`` on MacOSX: + ``intel`` builds a distribution with ``i386`` and ``x86_64`` architectures, + while ``3-way`` builds a distribution with the ``ppc``, ``i386`` + and ``x86_64`` architectures. + - Issue #6802: Fix build issues on MacOSX 10.6 - Issue #6244: Allow detect_tkinter to look for Tcl/Tk 8.6. Index: Doc/distutils/apiref.rst =================================================================== --- Doc/distutils/apiref.rst (revision 74671) +++ Doc/distutils/apiref.rst (working copy) @@ -1095,7 +1095,10 @@ the univeral binary status instead of the architecture of the current processor. For 32-bit universal binaries the architecture is ``fat``, for 64-bit universal binaries the architecture is ``fat64``, and - for 4-way universal binaries the architecture is ``universal``. + for 4-way universal binaries the architecture is ``universal``. Starting + from Python 2.7 and Python 3.2 the architecture ``fat3`` is used for + a 3-way universal build (ppc, i386, x86_64) and ``intel`` is used for + a univeral build with the i386 and x86_64 architectures Examples of returned values on Mac OS X: @@ -1105,6 +1108,8 @@ * ``macosx-10.5-universal`` + * ``macosx-10.6-intel`` + .. % XXX isn't this also provided by some other non-distutils module? Index: Lib/distutils/util.py =================================================================== --- Lib/distutils/util.py (revision 74671) +++ Lib/distutils/util.py (working copy) @@ -144,12 +144,27 @@ machine = 'fat' cflags = get_config_vars().get('CFLAGS') - if '-arch x86_64' in cflags: - if '-arch i386' in cflags: - machine = 'universal' - else: - machine = 'fat64' + archs = re.findall('-arch\s+(\S+)', cflags) + archs.sort() + archs = tuple(archs) + if len(archs) == 1: + machine = archs[0] + elif archs == ('i386', 'ppc'): + machine = 'fat' + elif archs == ('i386', 'x86_64'): + machine = 'intel' + elif archs == ('i386', 'ppc', 'x86_64'): + machine = 'fat3' + elif archs == ('ppc64', 'x86_64'): + machine = 'fat64' + elif archs == ('i386', 'ppc', 'ppc64', 'x86_64'): + machine = 'universal' + else: + raise ValueError( + "Don't know machine value for archs=%r"%(archs,)) + + elif machine in ('PowerPC', 'Power_Macintosh'): # Pick a sane name for the PPC architecture. machine = 'ppc'