diff --git a/Mac/Makefile.in b/Mac/Makefile.in index 3981a96f007..673a15f872b 100644 --- a/Mac/Makefile.in +++ b/Mac/Makefile.in @@ -150,11 +150,11 @@ pythonw: $(srcdir)/Tools/pythonw.c Makefile -DPYTHONWEXECUTABLE='"$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)"' pythonw-32: $(srcdir)/Tools/pythonw.c Makefile - $(CC) $(LDFLAGS) -o $@ -arch i386 -arch ppc $(srcdir)/Tools/pythonw.c \ + $(CC) $(subst -arch x86_64,,$(subst -arch ppc64,,$(LDFLAGS))) -o $@ @UNIVERSAL_ARCH32_FLAGS@ $(srcdir)/Tools/pythonw.c \ -DPYTHONWEXECUTABLE='"$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)-32"' pythonw-64: $(srcdir)/Tools/pythonw.c Makefile - $(CC) $(LDFLAGS) -o $@ -arch x86_64 -arch ppc64 $(srcdir)/Tools/pythonw.c \ + $(CC) $(subst -arch i386,,$(subst -arch ppc,,$(LDFLAGS))) -o $@ @UNIVERSAL_ARCH64_FLAGS@ $(srcdir)/Tools/pythonw.c \ -DPYTHONWEXECUTABLE='"$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)-64"' install_PythonLauncher: @@ -215,8 +215,8 @@ install_Python: rm "$(DESTDIR)$(APPINSTALLDIR)/Contents/Info.plist.in" install_Python4way: install_Python - lipo -extract i386 -extract ppc7400 -output "$(DESTDIR)$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)-32" "$(DESTDIR)$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)" - lipo -extract x86_64 -extract ppc64 -output "$(DESTDIR)$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)-64" "$(DESTDIR)$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)" + lipo @LIPO_32BIT_FLAGS@ -output "$(DESTDIR)$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)-32" "$(DESTDIR)$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)" + lipo @LIPO_64BIT_FLAGS@ -output "$(DESTDIR)$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)-64" "$(DESTDIR)$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)" diff --git a/Mac/README b/Mac/README index c4f6b655fbe..3225af97c5e 100644 --- a/Mac/README +++ b/Mac/README @@ -32,7 +32,7 @@ Mac-specific arguments to configure See the section _`Building and using a universal binary of Python on Mac OS X` for more information. -* ``--with-univeral-archs=VALUE`` +* ``--with-universal-archs=VALUE`` Specify the kind of universal binary that should be created. This option is only valid when ``--enable-universalsdk`` is specified. diff --git a/configure b/configure index 713c1abf500..25d3cba3cee 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 78781 . +# From configure.in Revision: 78805 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for python 2.6. # @@ -658,6 +658,10 @@ SOVERSION CONFIG_ARGS UNIVERSALSDK ARCH_RUN_32BIT +LIPO_32BIT_FLAGS +LIPO_64BIT_FLAGS +UNIVERSAL_ARCH32_FLAGS +UNIVERSAL_ARCH64_FLAGS PYTHONFRAMEWORK PYTHONFRAMEWORKIDENTIFIER PYTHONFRAMEWORKDIR @@ -1922,6 +1926,10 @@ fi UNIVERSAL_ARCHS="32-bit" + + + + { echo "$as_me:$LINENO: checking for --with-universal-archs" >&5 echo $ECHO_N "checking for --with-universal-archs... $ECHO_C" >&6; } @@ -2001,14 +2009,16 @@ if test "${enable_framework+set}" = set; then PYTHONFRAMEWORKINSTALLDIR=$PYTHONFRAMEWORKPREFIX/$PYTHONFRAMEWORKDIR FRAMEWORKINSTALLFIRST="frameworkinstallstructure" FRAMEWORKALTINSTALLFIRST="frameworkinstallstructure bininstall maninstall" - if test "$UNIVERSAL_ARCHS" = "all" - then + case "${UNIVERSAL_ARCHS}" in + all|3-way|intel) FRAMEWORKINSTALLLAST="frameworkinstallmaclib frameworkinstallapps4way frameworkinstallunixtools4way" FRAMEWORKALTINSTALLLAST="frameworkinstallmaclib frameworkinstallapps4way frameworkaltinstallunixtools4way" - else + ;; + *) FRAMEWORKINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools" FRAMEWORKALTINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkaltinstallunixtools" - fi + ;; + esac if test "x${prefix}" = "xNONE" ; then FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}" @@ -4700,28 +4710,39 @@ echo "${ECHO_T}$ac_cv_no_strict_aliasing_ok" >&6; } # -Wno-long-double, -no-cpp-precomp, and -mno-fused-madd # used to be here, but non-Apple gcc doesn't accept them. - if test "${enable_universalsdk}"; then UNIVERSAL_ARCH_FLAGS="" if test "$UNIVERSAL_ARCHS" = "32-bit" ; then - UNIVERSAL_ARCH_FLAGS="-arch ppc -arch i386" ARCH_RUN_32BIT="" + UNIVERSAL_ARCH_FLAGS="-arch ppc -arch i386" elif test "$UNIVERSAL_ARCHS" = "64-bit" ; then - UNIVERSAL_ARCH_FLAGS="-arch ppc64 -arch x86_64" ARCH_RUN_32BIT="true" + UNIVERSAL_ARCH_FLAGS="-arch ppc64 -arch x86_64" elif test "$UNIVERSAL_ARCHS" = "all" ; then - UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch ppc64 -arch x86_64" ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc" + UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch ppc64 -arch x86_64" + UNIVERSAL_ARCH32_FLAGS="-arch i386 -arch ppc" + UNIVERSAL_ARCH64_FLAGS="-arch x86_64 -arch x86_64" + LIPO_32BIT_FLAGS="-extract i386 -extract ppc7400" + LIPO_64BIT_FLAGS="-extract x86_64 -extract ppc64" elif test "$UNIVERSAL_ARCHS" = "intel" ; then - UNIVERSAL_ARCH_FLAGS="-arch i386 -arch x86_64" ARCH_RUN_32BIT="/usr/bin/arch -i386" + UNIVERSAL_ARCH_FLAGS="-arch i386 -arch x86_64" + UNIVERSAL_ARCH32_FLAGS="-arch i386" + UNIVERSAL_ARCH64_FLAGS="-arch x86_64" + LIPO_32BIT_FLAGS="-extract i386" + LIPO_64BIT_FLAGS="-extract x86_64" elif test "$UNIVERSAL_ARCHS" = "3-way" ; then - UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch x86_64" ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc" + UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch x86_64" + UNIVERSAL_ARCH32_FLAGS="-arch i386 -arch ppc" + UNIVERSAL_ARCH64_FLAGS="-arch x86_64" + LIPO_32BIT_FLAGS="-extract i386 -extract ppc7400" + LIPO_64BIT_FLAGS="-extract x86_64" else { { echo "$as_me:$LINENO: error: proper usage is --with-universal-arch=32-bit|64-bit|all|intel|3-way" >&5 @@ -25849,6 +25870,10 @@ SOVERSION!$SOVERSION$ac_delim CONFIG_ARGS!$CONFIG_ARGS$ac_delim UNIVERSALSDK!$UNIVERSALSDK$ac_delim ARCH_RUN_32BIT!$ARCH_RUN_32BIT$ac_delim +LIPO_32BIT_FLAGS!$LIPO_32BIT_FLAGS$ac_delim +LIPO_64BIT_FLAGS!$LIPO_64BIT_FLAGS$ac_delim +UNIVERSAL_ARCH32_FLAGS!$UNIVERSAL_ARCH32_FLAGS$ac_delim +UNIVERSAL_ARCH64_FLAGS!$UNIVERSAL_ARCH64_FLAGS$ac_delim PYTHONFRAMEWORK!$PYTHONFRAMEWORK$ac_delim PYTHONFRAMEWORKIDENTIFIER!$PYTHONFRAMEWORKIDENTIFIER$ac_delim PYTHONFRAMEWORKDIR!$PYTHONFRAMEWORKDIR$ac_delim @@ -25900,10 +25925,6 @@ OTHER_LIBTOOL_OPT!$OTHER_LIBTOOL_OPT$ac_delim LIBTOOL_CRUFT!$LIBTOOL_CRUFT$ac_delim SO!$SO$ac_delim LDSHARED!$LDSHARED$ac_delim -BLDSHARED!$BLDSHARED$ac_delim -CCSHARED!$CCSHARED$ac_delim -LINKFORSHARED!$LINKFORSHARED$ac_delim -CFLAGSFORSHARED!$CFLAGSFORSHARED$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then @@ -25945,6 +25966,10 @@ _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF +BLDSHARED!$BLDSHARED$ac_delim +CCSHARED!$CCSHARED$ac_delim +LINKFORSHARED!$LINKFORSHARED$ac_delim +CFLAGSFORSHARED!$CFLAGSFORSHARED$ac_delim SHLIBS!$SHLIBS$ac_delim USE_SIGNAL_MODULE!$USE_SIGNAL_MODULE$ac_delim SIGNAL_OBJS!$SIGNAL_OBJS$ac_delim @@ -25969,7 +25994,7 @@ SRCDIRS!$SRCDIRS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 22; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 26; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 diff --git a/configure.in b/configure.in index 84035de4b4e..e7cbd67fcaa 100644 --- a/configure.in +++ b/configure.in @@ -111,6 +111,10 @@ AC_SUBST(UNIVERSALSDK) AC_SUBST(ARCH_RUN_32BIT) UNIVERSAL_ARCHS="32-bit" +AC_SUBST(LIPO_32BIT_FLAGS) +AC_SUBST(LIPO_64BIT_FLAGS) +AC_SUBST(UNIVERSAL_ARCH32_FLAGS) +AC_SUBST(UNIVERSAL_ARCH64_FLAGS) 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", "3-way", "intel" or "all")), @@ -176,14 +180,16 @@ AC_ARG_ENABLE(framework, PYTHONFRAMEWORKINSTALLDIR=$PYTHONFRAMEWORKPREFIX/$PYTHONFRAMEWORKDIR FRAMEWORKINSTALLFIRST="frameworkinstallstructure" FRAMEWORKALTINSTALLFIRST="frameworkinstallstructure bininstall maninstall" - if test "$UNIVERSAL_ARCHS" = "all" - then + case "${UNIVERSAL_ARCHS}" in + all|3-way|intel) FRAMEWORKINSTALLLAST="frameworkinstallmaclib frameworkinstallapps4way frameworkinstallunixtools4way" FRAMEWORKALTINSTALLLAST="frameworkinstallmaclib frameworkinstallapps4way frameworkaltinstallunixtools4way" - else + ;; + *) FRAMEWORKINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools" FRAMEWORKALTINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkaltinstallunixtools" - fi + ;; + esac if test "x${prefix}" = "xNONE" ; then FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}" @@ -947,28 +953,39 @@ yes) # -Wno-long-double, -no-cpp-precomp, and -mno-fused-madd # used to be here, but non-Apple gcc doesn't accept them. - if test "${enable_universalsdk}"; then UNIVERSAL_ARCH_FLAGS="" if test "$UNIVERSAL_ARCHS" = "32-bit" ; then - UNIVERSAL_ARCH_FLAGS="-arch ppc -arch i386" ARCH_RUN_32BIT="" + UNIVERSAL_ARCH_FLAGS="-arch ppc -arch i386" elif test "$UNIVERSAL_ARCHS" = "64-bit" ; then - UNIVERSAL_ARCH_FLAGS="-arch ppc64 -arch x86_64" ARCH_RUN_32BIT="true" + UNIVERSAL_ARCH_FLAGS="-arch ppc64 -arch x86_64" elif test "$UNIVERSAL_ARCHS" = "all" ; then - UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch ppc64 -arch x86_64" ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc" + UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch ppc64 -arch x86_64" + UNIVERSAL_ARCH32_FLAGS="-arch i386 -arch ppc" + UNIVERSAL_ARCH64_FLAGS="-arch x86_64 -arch x86_64" + LIPO_32BIT_FLAGS="-extract i386 -extract ppc7400" + LIPO_64BIT_FLAGS="-extract x86_64 -extract ppc64" elif test "$UNIVERSAL_ARCHS" = "intel" ; then - UNIVERSAL_ARCH_FLAGS="-arch i386 -arch x86_64" ARCH_RUN_32BIT="/usr/bin/arch -i386" + UNIVERSAL_ARCH_FLAGS="-arch i386 -arch x86_64" + UNIVERSAL_ARCH32_FLAGS="-arch i386" + UNIVERSAL_ARCH64_FLAGS="-arch x86_64" + LIPO_32BIT_FLAGS="-extract i386" + LIPO_64BIT_FLAGS="-extract x86_64" elif test "$UNIVERSAL_ARCHS" = "3-way" ; then - UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch x86_64" ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc" + UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch x86_64" + UNIVERSAL_ARCH32_FLAGS="-arch i386 -arch ppc" + UNIVERSAL_ARCH64_FLAGS="-arch x86_64" + LIPO_32BIT_FLAGS="-extract i386 -extract ppc7400" + LIPO_64BIT_FLAGS="-extract x86_64" else AC_MSG_ERROR([proper usage is --with-universal-arch=32-bit|64-bit|all|intel|3-way])