Ronald Oussoren avatar Ronald Oussoren committed e2762f4

Fix for issue8089: a framework build with --with-universal-archs=3-way|intel had no way to select
a 32-bit executable (which is needed because not all (GUI) libraries are available in 64-bit mode)

Also fixes a typo in Mac/README

Comments (0)

Files changed (4)

 		-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:
 	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)"
 
 
 
   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.
 #! /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.
 #
 CONFIG_ARGS
 UNIVERSALSDK
 ARCH_RUN_32BIT
+LIPO_32BIT_FLAGS
+LIPO_64BIT_FLAGS
+UNIVERSAL_ARCH32_FLAGS
+UNIVERSAL_ARCH64_FLAGS
 PYTHONFRAMEWORK
 PYTHONFRAMEWORKIDENTIFIER
 PYTHONFRAMEWORKDIR
 
 
 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; }
 
 		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}"
 	    # -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
+		   ARCH_RUN_32BIT=""
 		   UNIVERSAL_ARCH_FLAGS="-arch ppc -arch i386"
-		   ARCH_RUN_32BIT=""
 
 	         elif test "$UNIVERSAL_ARCHS" = "64-bit" ; then
+		   ARCH_RUN_32BIT="true"
 		   UNIVERSAL_ARCH_FLAGS="-arch ppc64 -arch x86_64"
-		   ARCH_RUN_32BIT="true"
 
 	         elif test "$UNIVERSAL_ARCHS" = "all" ; then
+		   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
+		   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
 		   ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc"
-
-	         elif test "$UNIVERSAL_ARCHS" = "intel" ; then
-		   UNIVERSAL_ARCH_FLAGS="-arch i386 -arch x86_64"
-		   ARCH_RUN_32BIT="/usr/bin/arch -i386"
-
-	         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_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
 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
 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
 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
 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
 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")),
 		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}"
 	    # -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
+		   ARCH_RUN_32BIT=""
 		   UNIVERSAL_ARCH_FLAGS="-arch ppc -arch i386"
-		   ARCH_RUN_32BIT=""
 
 	         elif test "$UNIVERSAL_ARCHS" = "64-bit" ; then
+		   ARCH_RUN_32BIT="true"
 		   UNIVERSAL_ARCH_FLAGS="-arch ppc64 -arch x86_64"
-		   ARCH_RUN_32BIT="true"
 
 	         elif test "$UNIVERSAL_ARCHS" = "all" ; then
+		   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
+		   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
 		   ARCH_RUN_32BIT="/usr/bin/arch -i386 -ppc"
-
-	         elif test "$UNIVERSAL_ARCHS" = "intel" ; then
-		   UNIVERSAL_ARCH_FLAGS="-arch i386 -arch x86_64"
-		   ARCH_RUN_32BIT="/usr/bin/arch -i386"
-
-	         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_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])
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.