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.
This commit is contained in:
Ronald Oussoren 2009-12-24 13:30:58 +00:00
parent 1a13cff7a5
commit 92919a66d2
11 changed files with 240 additions and 117 deletions

View file

@ -5,13 +5,19 @@ GUI application (as opposed to an X11 application).
import sys import sys
import Tkinter import Tkinter
_appbundle = None
def runningAsOSXApp(): def runningAsOSXApp():
""" """
Returns True if Python is running from within an app on OSX. Returns True if Python is running from within an app on OSX.
If so, assume that Python was built with Aqua Tcl/Tk rather than If so, assume that Python was built with Aqua Tcl/Tk rather than
X11 Tcl/Tk. X11 Tcl/Tk.
""" """
return (sys.platform == 'darwin' and '.app' in sys.executable) global _appbundle
if _appbundle is None:
_appbundle = (sys.platform == 'darwin' and '.app' in sys.executable)
return _appbundle
def addOpenEventSupport(root, flist): def addOpenEventSupport(root, flist):
""" """

View file

@ -51,5 +51,14 @@
<string>%VERSION%</string> <string>%VERSION%</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>%VERSION%</string> <string>%VERSION%</string>
<!--
<key>LSMinimumSystemVersionByArchitecture</key>
<dict>
<key>x86_64</key>
<string>10.6.0</string>
<key>ppc64</key>
<string>10.6.0</string>
</dict>
-->
</dict> </dict>
</plist> </plist>

View file

@ -10,6 +10,8 @@ VERSION= @VERSION@
UNIVERSALSDK=@UNIVERSALSDK@ UNIVERSALSDK=@UNIVERSALSDK@
builddir= ../.. builddir= ../..
PYTHONFRAMEWORK=@PYTHONFRAMEWORK@ PYTHONFRAMEWORK=@PYTHONFRAMEWORK@
LIPO_32BIT_FLAGS=@LIPO_32BIT_FLAGS@
RUNSHARED= @RUNSHARED@ RUNSHARED= @RUNSHARED@
BUILDEXE= @BUILDEXEEXT@ BUILDEXE= @BUILDEXEEXT@
@ -51,9 +53,12 @@ IDLE.app: \
--iconfile=$(srcdir)/../Icons/IDLE.icns \ --iconfile=$(srcdir)/../Icons/IDLE.icns \
--resource=$(srcdir)/../Icons/PythonSource.icns \ --resource=$(srcdir)/../Icons/PythonSource.icns \
--resource=$(srcdir)/../Icons/PythonCompiled.icns \ --resource=$(srcdir)/../Icons/PythonCompiled.icns \
--python=$(prefix)/Resources/Python.app/Contents/MacOS/$(PYTHONFRAMEWORK)`test -f "$(DESTDIR)$(prefix)/Resources/Python.app/Contents/MacOS/$(PYTHONFRAMEWORK)-32" && echo "-32"` \ --python=$(prefix)/Resources/Python.app/Contents/MacOS/Python \
build build
ifneq ($(LIPO_32BIT_FLAGS),)
rm "IDLE.app/Contents/MacOS/Python"
lipo $(LIPO_32BIT_FLAGS) -output "IDLE.app/Contents/MacOS/Python" "$(BUILDPYTHON)"
endif
Info.plist: $(srcdir)/Info.plist.in Info.plist: $(srcdir)/Info.plist.in
sed 's/%VERSION%/'"`$(RUNSHARED) $(BUILDPYTHON) -c 'import platform; print platform.python_version()'`"'/g' < $(srcdir)/Info.plist.in > Info.plist sed 's/%VERSION%/'"`$(RUNSHARED) $(BUILDPYTHON) -c 'import platform; print platform.python_version()'`"'/g' < $(srcdir)/Info.plist.in > Info.plist

View file

@ -48,7 +48,7 @@ os.chdir(os.path.expanduser('~/Documents'))
# the interpreter in the framework, by following the symlink # the interpreter in the framework, by following the symlink
# exported in PYTHONEXECUTABLE. # exported in PYTHONEXECUTABLE.
pyex = os.environ['PYTHONEXECUTABLE'] pyex = os.environ['PYTHONEXECUTABLE']
sys.executable = os.path.join(os.path.dirname(pyex), os.readlink(pyex)) sys.executable = os.path.join(sys.prefix, 'bin', 'python%d.%d'%(sys.version_info[:2]))
# Remove any sys.path entries for the Resources dir in the IDLE.app bundle. # Remove any sys.path entries for the Resources dir in the IDLE.app bundle.
p = pyex.partition('.app') p = pyex.partition('.app')
@ -68,6 +68,8 @@ for idx, value in enumerate(sys.argv):
break break
# Now it is safe to import idlelib. # Now it is safe to import idlelib.
from idlelib import macosxSupport
macosxSupport._appbundle = True
from idlelib.PyShell import main from idlelib.PyShell import main
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View file

@ -15,6 +15,7 @@ LDFLAGS=@LDFLAGS@
FRAMEWORKUNIXTOOLSPREFIX=@FRAMEWORKUNIXTOOLSPREFIX@ FRAMEWORKUNIXTOOLSPREFIX=@FRAMEWORKUNIXTOOLSPREFIX@
PYTHONFRAMEWORK=@PYTHONFRAMEWORK@ PYTHONFRAMEWORK=@PYTHONFRAMEWORK@
PYTHONFRAMEWORKIDENTIFIER=@PYTHONFRAMEWORKIDENTIFIER@ PYTHONFRAMEWORKIDENTIFIER=@PYTHONFRAMEWORKIDENTIFIER@
LIPO_32BIT_FLAGS=@LIPO_32BIT_FLAGS@
# These are normally glimpsed from the previous set # These are normally glimpsed from the previous set
@ -42,10 +43,8 @@ APPSUBDIRS=MacOS Resources
CACHERSRC=$(srcdir)/scripts/cachersrc.py CACHERSRC=$(srcdir)/scripts/cachersrc.py
compileall=$(srcdir)/../Lib/compileall.py compileall=$(srcdir)/../Lib/compileall.py
installapps: install_Python install_BuildApplet install_PythonLauncher \ installapps: install_Python install_pythonw install_BuildApplet install_PythonLauncher \
install_IDLE checkapplepython install_pythonw install_versionedtools install_IDLE checkapplepython install_versionedtools
installapps4way: install_Python4way install_BuildApplet install_PythonLauncher install_IDLE install_pythonw4way install_versionedtools
install_pythonw: pythonw install_pythonw: pythonw
@ -53,33 +52,13 @@ install_pythonw: pythonw
$(INSTALL_PROGRAM) $(STRIPFLAG) pythonw "$(DESTDIR)$(prefix)/bin/python$(VERSION)" $(INSTALL_PROGRAM) $(STRIPFLAG) pythonw "$(DESTDIR)$(prefix)/bin/python$(VERSION)"
ln -sf python$(VERSION) "$(DESTDIR)$(prefix)/bin/python" ln -sf python$(VERSION) "$(DESTDIR)$(prefix)/bin/python"
ln -sf pythonw$(VERSION) "$(DESTDIR)$(prefix)/bin/pythonw" ln -sf pythonw$(VERSION) "$(DESTDIR)$(prefix)/bin/pythonw"
ifneq ($(LIPO_32BIT_FLAGS),)
lipo $(LIPO_32BIT_FLAGS) -output $(DESTDIR)$(prefix)/bin/python$(VERSION)-32 pythonw
# Install 3 variants of python/pythonw: lipo $(LIPO_32BIT_FLAGS) -output $(DESTDIR)$(prefix)/bin/pythonw$(VERSION)-32 pythonw
# - 32-bit (i386 and ppc)
# - 64-bit (x86_64 and ppc64)
# - all (all four architectures)
# - Make 'python' and 'pythonw' aliases for the 32-bit variant
install_pythonw4way: pythonw-32 pythonw-64 pythonw
$(INSTALL_PROGRAM) $(STRIPFLAG) pythonw-64 "$(DESTDIR)$(prefix)/bin/pythonw$(VERSION)-64"
$(INSTALL_PROGRAM) $(STRIPFLAG) pythonw-64 "$(DESTDIR)$(prefix)/bin/python$(VERSION)-64"
ln -sf python$(VERSION)-64 "$(DESTDIR)$(prefix)/bin/python-64"
ln -sf pythonw$(VERSION)-64 "$(DESTDIR)$(prefix)/bin/pythonw-64"
$(INSTALL_PROGRAM) $(STRIPFLAG) pythonw-32 "$(DESTDIR)$(prefix)/bin/pythonw$(VERSION)-32"
$(INSTALL_PROGRAM) $(STRIPFLAG) pythonw-32 "$(DESTDIR)$(prefix)/bin/python$(VERSION)-32"
ln -sf python$(VERSION)-32 "$(DESTDIR)$(prefix)/bin/python-32" ln -sf python$(VERSION)-32 "$(DESTDIR)$(prefix)/bin/python-32"
ln -sf pythonw$(VERSION)-32 "$(DESTDIR)$(prefix)/bin/pythonw-32" ln -sf pythonw$(VERSION)-32 "$(DESTDIR)$(prefix)/bin/pythonw-32"
endif
$(INSTALL_PROGRAM) $(STRIPFLAG) pythonw "$(DESTDIR)$(prefix)/bin/pythonw$(VERSION)-all"
$(INSTALL_PROGRAM) $(STRIPFLAG) pythonw "$(DESTDIR)$(prefix)/bin/python$(VERSION)-all"
ln -sf python$(VERSION)-all "$(DESTDIR)$(prefix)/bin/python-all"
ln -sf pythonw$(VERSION)-all "$(DESTDIR)$(prefix)/bin/pythonw-all"
ln -sf pythonw$(VERSION)-32 "$(DESTDIR)$(prefix)/bin/pythonw$(VERSION)"
ln -sf python$(VERSION)-32 "$(DESTDIR)$(prefix)/bin/python$(VERSION)"
ln -sf pythonw$(VERSION)-32 "$(DESTDIR)$(prefix)/bin/pythonw"
ln -sf python$(VERSION)-32 "$(DESTDIR)$(prefix)/bin/python"
# #
# Install unix tools in /usr/local/bin. These are just aliases for the # Install unix tools in /usr/local/bin. These are just aliases for the
@ -97,10 +76,6 @@ installunixtools:
done done
# TODO: install symlinks for -32, -64 and -all as well
installunixtools4way: installunixtools
# #
# Like installunixtools, but only install links to the versioned binaries. # Like installunixtools, but only install links to the versioned binaries.
# #
@ -114,9 +89,6 @@ altinstallunixtools:
ln -fs "$(prefix)/bin/$${fn}" "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin/$${fn}" ;\ ln -fs "$(prefix)/bin/$${fn}" "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin/$${fn}" ;\
done done
# TODO: -32, -64 and -all variants
altinstallunixtools4way: altinstallunixtools
# By default most tools are installed without a version in their basename, to # By default most tools are installed without a version in their basename, to
# make it easier to install (and use) several python versions side-by-side move # make it easier to install (and use) several python versions side-by-side move
# the tools to a version-specific name and add the non-versioned name as an # the tools to a version-specific name and add the non-versioned name as an
@ -141,16 +113,7 @@ install_versionedtools:
pythonw: $(srcdir)/Tools/pythonw.c Makefile pythonw: $(srcdir)/Tools/pythonw.c Makefile
$(CC) $(LDFLAGS) -o $@ $(srcdir)/Tools/pythonw.c \ $(CC) $(LDFLAGS) -o $@ $(srcdir)/Tools/pythonw.c -I.. -I$(srcdir)/../Include ../$(PYTHONFRAMEWORK).framework/Versions/$(VERSION)/$(PYTHONFRAMEWORK)
-DPYTHONWEXECUTABLE='"$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)"'
pythonw-32: $(srcdir)/Tools/pythonw.c Makefile
$(CC) $(LDFLAGS) -o $@ -arch i386 -arch ppc $(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 \
-DPYTHONWEXECUTABLE='"$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)-64"'
install_PythonLauncher: install_PythonLauncher:
cd PythonLauncher && make install DESTDIR=$(DESTDIR) cd PythonLauncher && make install DESTDIR=$(DESTDIR)
@ -206,11 +169,6 @@ install_Python:
> "$(DESTDIR)$(APPINSTALLDIR)/Contents/Info.plist" > "$(DESTDIR)$(APPINSTALLDIR)/Contents/Info.plist"
rm "$(DESTDIR)$(APPINSTALLDIR)/Contents/Info.plist.in" 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)"
install_IDLE: install_IDLE:
cd IDLE && make install cd IDLE && make install
@ -218,9 +176,13 @@ install_IDLE:
install_BuildApplet: install_BuildApplet:
$(RUNSHARED) @ARCH_RUN_32BIT@ $(BUILDPYTHON) $(srcdir)/scripts/BuildApplet.py \ $(RUNSHARED) @ARCH_RUN_32BIT@ $(BUILDPYTHON) $(srcdir)/scripts/BuildApplet.py \
--destroot "$(DESTDIR)" \ --destroot "$(DESTDIR)" \
--python=$(prefix)/Resources/Python.app/Contents/MacOS/$(PYTHONFRAMEWORK)`test -f "$(DESTDIR)$(prefix)/Resources/Python.app/Contents/MacOS/$(PYTHONFRAMEWORK)-32" && echo "-32"` \ --python=$(prefix)/Resources/Python.app/Contents/MacOS/Python \
--output "$(DESTDIR)$(PYTHONAPPSDIR)/Build Applet.app" \ --output "$(DESTDIR)$(PYTHONAPPSDIR)/Build Applet.app" \
$(srcdir)/scripts/BuildApplet.py $(srcdir)/scripts/BuildApplet.py
ifneq ($(LIPO_32BIT_FLAGS),)
rm "$(DESTDIR)$(PYTHONAPPSDIR)/Build Applet.app/Contents/MacOS/Python"
lipo $(LIPO_32BIT_FLAGS) -output "$(DESTDIR)$(PYTHONAPPSDIR)/Build Applet.app/Contents/MacOS/Python" $(BUILDPYTHON)
endif
MACLIBDEST=$(LIBDEST)/plat-mac MACLIBDEST=$(LIBDEST)/plat-mac
MACTOOLSDEST=$(prefix)/Mac/Tools MACTOOLSDEST=$(prefix)/Mac/Tools

View file

@ -25,7 +25,7 @@ Mac-specific arguments to configure
Create a universal binary build of of Python. This can be used with both Create a universal binary build of of Python. This can be used with both
regular and framework builds. 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 build. This defaults to ``/Developer/SDKs/MacOSX.10.4u.sdk``, specify
``/`` when building on a 10.5 system, especially when building 64-bit code. ``/`` when building on a 10.5 system, especially when building 64-bit code.
@ -88,10 +88,29 @@ values are available:
* ``intel``: ``i386``, ``x86_64`` * ``intel``: ``i386``, ``x86_64``
To build a universal binary that includes a 64-bit architecture you must build 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 on a system running OSX 10.5 or later. The ``all`` flavour can only be built on
OSX 10.5. 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. Building and using a framework-based Python on Mac OS X.
======================================================== ========================================================

View file

@ -3,15 +3,145 @@
* application bundle inside the Python framework. This is needed to run * application bundle inside the Python framework. This is needed to run
* GUI code: some GUI API's don't work unless the program is inside an * GUI code: some GUI API's don't work unless the program is inside an
* application bundle. * application bundle.
*
* This program uses posix_spawn rather than plain execv because we need
* slightly more control over how the "real" interpreter is executed.
*/ */
#include <unistd.h> #include <unistd.h>
#include <spawn.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <err.h> #include <err.h>
#include <dlfcn.h>
#include <stdlib.h>
#include <Python.h>
static char Python[] = PYTHONWEXECUTABLE;
int main(int argc, char **argv) { extern char** environ;
argv[0] = Python;
execv(Python, argv); /*
err(1, "execv: %s", Python); * Locate the python framework by looking for the
* library that contains Py_Initialize.
*
* In a regular framework the structure is:
*
* Python.framework/Versions/2.7
* /Python
* /Resources/Python.app/Contents/MacOS/Python
*
* In a virtualenv style structure the expected
* structure is:
*
* ROOT
* /bin/pythonw
* /.Python <- the dylib
* /.Resources/Python.app/Contents/MacOS/Python
*
* NOTE: virtualenv's are not an officially supported
* feature, support for that structure is provided as
* a convenience.
*/
static char* get_python_path(void)
{
size_t len;
Dl_info info;
char* end;
char* g_path;
if (dladdr(Py_Initialize, &info) == 0) {
return NULL;
}
len = strlen(info.dli_fname);
g_path = malloc(len+60);
if (g_path == NULL) {
return NULL;
}
strcpy(g_path, info.dli_fname);
end = g_path + len - 1;
while (end != g_path && *end != '/') {
end --;
}
end++;
if (end[1] == '.') {
end++;
}
strcpy(end, "Resources/Python.app/Contents/MacOS/Python");
return g_path;
}
static void
setup_spawnattr(posix_spawnattr_t* spawnattr)
{
size_t ocount;
size_t count;
cpu_type_t cpu_types[1];
short flags = 0;
#ifdef __LP64__
int ch;
#endif
if ((errno = posix_spawnattr_init(spawnattr)) != 0) {
err(2, "posix_spawnattr_int");
/* NOTREACHTED */
}
count = 1;
/* Run the real python executable using the same architure as this
* executable, this allows users to controle the architecture using
* "arch -ppc python"
*/
#if defined(__ppc64__)
cpu_types[0] = CPU_TYPE_POWERPC64;
#elif defined(__x86_64__)
cpu_types[0] = CPU_TYPE_X86_64;
#elif defined(__ppc__)
cpu_types[0] = CPU_TYPE_POWERPC;
#elif defined(__i386__)
cpu_types[0] = CPU_TYPE_X86;
#else
# error "Unknown CPU"
#endif
if (posix_spawnattr_setbinpref_np(spawnattr, count,
cpu_types, &ocount) == -1) {
err(1, "posix_spawnattr_setbinpref");
/* NOTREACHTED */
}
if (count != ocount) {
fprintf(stderr, "posix_spawnattr_setbinpref failed to copy\n");
exit(1);
/* NOTREACHTED */
}
/*
* Set flag that causes posix_spawn to behave like execv
*/
flags |= POSIX_SPAWN_SETEXEC;
if ((errno = posix_spawnattr_setflags(spawnattr, flags)) != 0) {
err(1, "posix_spawnattr_setflags");
/* NOTREACHTED */
}
}
int
main(int argc, char **argv) {
posix_spawnattr_t spawnattr = NULL;
char* exec_path = get_python_path();
setup_spawnattr(&spawnattr);
posix_spawn(NULL, exec_path, NULL,
&spawnattr, argv, environ);
err(1, "posix_spawn: %s", argv[0]);
/* NOTREACHED */ /* NOTREACHED */
} }

View file

@ -1079,22 +1079,13 @@ frameworkinstallmaclib:
frameworkinstallapps: frameworkinstallapps:
cd Mac && $(MAKE) installapps DESTDIR="$(DESTDIR)" cd Mac && $(MAKE) installapps DESTDIR="$(DESTDIR)"
frameworkinstallapps4way:
cd Mac && $(MAKE) installapps4way DESTDIR="$(DESTDIR)"
# This install the unix python and pythonw tools in /usr/local/bin # This install the unix python and pythonw tools in /usr/local/bin
frameworkinstallunixtools: frameworkinstallunixtools:
cd Mac && $(MAKE) installunixtools DESTDIR="$(DESTDIR)" cd Mac && $(MAKE) installunixtools DESTDIR="$(DESTDIR)"
frameworkinstallunixtools4way:
cd Mac && $(MAKE) installunixtools4way DESTDIR="$(DESTDIR)"
frameworkaltinstallunixtools: frameworkaltinstallunixtools:
cd Mac && $(MAKE) altinstallunixtools DESTDIR="$(DESTDIR)" cd Mac && $(MAKE) altinstallunixtools DESTDIR="$(DESTDIR)"
frameworkaltinstallunixtools4way:
cd Mac && $(MAKE) altinstallunixtools4way DESTDIR="$(DESTDIR)"
# This installs the Demos and Tools into the applications directory. # This installs the Demos and Tools into the applications directory.
# It is not part of a normal frameworkinstall # It is not part of a normal frameworkinstall
frameworkinstallextras: frameworkinstallextras:

View file

@ -12,6 +12,13 @@ What's New in Python 2.7 alpha 2?
Core and Builtins Core and Builtins
----------------- -----------------
- Issue #6834: replace the implementation for the 'python' and 'pythonw'
executables on OSX.
These executables now work properly with the arch(1) command:
``arch -ppc python`` will start a universal binary version of python
in PPC mode (unlike previous releases).
- Issue #1680159: unicode coercion during an 'in' operation no longer masks - Issue #1680159: unicode coercion during an 'in' operation no longer masks
the underlying error when the coercion fails for the left hand operand. the underlying error when the coercion fails for the left hand operand.

59
configure vendored
View file

@ -658,6 +658,7 @@ SOVERSION
CONFIG_ARGS CONFIG_ARGS
UNIVERSALSDK UNIVERSALSDK
ARCH_RUN_32BIT ARCH_RUN_32BIT
LIPO_32BIT_FLAGS
PYTHONFRAMEWORK PYTHONFRAMEWORK
PYTHONFRAMEWORKIDENTIFIER PYTHONFRAMEWORKIDENTIFIER
PYTHONFRAMEWORKDIR PYTHONFRAMEWORKDIR
@ -1915,6 +1916,7 @@ fi
UNIVERSAL_ARCHS="32-bit" UNIVERSAL_ARCHS="32-bit"
{ echo "$as_me:$LINENO: checking for --with-universal-archs" >&5 { echo "$as_me:$LINENO: checking for --with-universal-archs" >&5
echo $ECHO_N "checking for --with-universal-archs... $ECHO_C" >&6; } echo $ECHO_N "checking for --with-universal-archs... $ECHO_C" >&6; }
@ -1994,14 +1996,8 @@ if test "${enable_framework+set}" = set; then
PYTHONFRAMEWORKINSTALLDIR=$PYTHONFRAMEWORKPREFIX/$PYTHONFRAMEWORKDIR PYTHONFRAMEWORKINSTALLDIR=$PYTHONFRAMEWORKPREFIX/$PYTHONFRAMEWORKDIR
FRAMEWORKINSTALLFIRST="frameworkinstallstructure" FRAMEWORKINSTALLFIRST="frameworkinstallstructure"
FRAMEWORKALTINSTALLFIRST="frameworkinstallstructure bininstall maninstall" FRAMEWORKALTINSTALLFIRST="frameworkinstallstructure bininstall maninstall"
if test "$UNIVERSAL_ARCHS" = "all" FRAMEWORKINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools"
then FRAMEWORKALTINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkaltinstallunixtools"
FRAMEWORKINSTALLLAST="frameworkinstallmaclib frameworkinstallapps4way frameworkinstallunixtools4way"
FRAMEWORKALTINSTALLLAST="frameworkinstallmaclib frameworkinstallapps4way frameworkaltinstallunixtools4way"
else
FRAMEWORKINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools"
FRAMEWORKALTINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkaltinstallunixtools"
fi
if test "x${prefix}" = "xNONE" ; then if test "x${prefix}" = "xNONE" ; then
FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}" FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
@ -2041,11 +2037,6 @@ else
fi fi
enable_framework= enable_framework=
if test "$UNIVERSAL_ARCHS" = "all"
then
FRAMEWORKINSTALLLAST=update4wayuniversal
FRAMEWORKALTINSTALLLAST=update4wayuniversal
fi
fi fi
@ -3866,7 +3857,7 @@ else
{ echo "$as_me:$LINENO: result: no" >&5 { echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; } echo "${ECHO_T}no" >&6; }
fi fi
rm -f conftest* rm -f -r conftest*
@ -4697,22 +4688,27 @@ echo "${ECHO_T}$ac_cv_no_strict_aliasing_ok" >&6; }
if test "$UNIVERSAL_ARCHS" = "32-bit" ; then if test "$UNIVERSAL_ARCHS" = "32-bit" ; then
UNIVERSAL_ARCH_FLAGS="-arch ppc -arch i386" UNIVERSAL_ARCH_FLAGS="-arch ppc -arch i386"
ARCH_RUN_32BIT="" ARCH_RUN_32BIT=""
LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
elif test "$UNIVERSAL_ARCHS" = "64-bit" ; then elif test "$UNIVERSAL_ARCHS" = "64-bit" ; then
UNIVERSAL_ARCH_FLAGS="-arch ppc64 -arch x86_64" UNIVERSAL_ARCH_FLAGS="-arch ppc64 -arch x86_64"
LIPO_32BIT_FLAGS=""
ARCH_RUN_32BIT="true" ARCH_RUN_32BIT="true"
elif test "$UNIVERSAL_ARCHS" = "all" ; then elif test "$UNIVERSAL_ARCHS" = "all" ; then
UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch ppc64 -arch x86_64" UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch ppc64 -arch x86_64"
LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
ARCH_RUN_32BIT="arch -i386 -ppc" ARCH_RUN_32BIT="arch -i386 -ppc"
elif test "$UNIVERSAL_ARCHS" = "intel" ; then elif test "$UNIVERSAL_ARCHS" = "intel" ; then
UNIVERSAL_ARCH_FLAGS="-arch i386 -arch x86_64" UNIVERSAL_ARCH_FLAGS="-arch i386 -arch x86_64"
LIPO_32BIT_FLAGS="-extract i386"
ARCH_RUN_32BIT="arch -i386" ARCH_RUN_32BIT="arch -i386"
elif test "$UNIVERSAL_ARCHS" = "3-way" ; then elif test "$UNIVERSAL_ARCHS" = "3-way" ; then
UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch x86_64" UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch x86_64"
ARCH_RUN_32BIT="arch -i386 -ppc" LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
ARCH_RUN_32BIT="arch -i386 -ppc7400"
else else
{ { echo "$as_me:$LINENO: error: proper usage is --with-universal-arch=32-bit|64-bit|all|intel|3-way" >&5 { { echo "$as_me:$LINENO: error: proper usage is --with-universal-arch=32-bit|64-bit|all|intel|3-way" >&5
@ -5414,7 +5410,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
else else
ac_cv_header_stdc=no ac_cv_header_stdc=no
fi fi
rm -f conftest* rm -f -r conftest*
fi fi
@ -5435,7 +5431,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
else else
ac_cv_header_stdc=no ac_cv_header_stdc=no
fi fi
rm -f conftest* rm -f -r conftest*
fi fi
@ -6533,7 +6529,7 @@ _ACEOF
fi fi
rm -f conftest* rm -f -r conftest*
{ echo "$as_me:$LINENO: result: $was_it_defined" >&5 { echo "$as_me:$LINENO: result: $was_it_defined" >&5
echo "${ECHO_T}$was_it_defined" >&6; } echo "${ECHO_T}$was_it_defined" >&6; }
@ -7063,7 +7059,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
else else
ac_cv_type_uid_t=no ac_cv_type_uid_t=no
fi fi
rm -f conftest* rm -f -r conftest*
fi fi
{ echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 { echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5
@ -15723,7 +15719,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
else else
unistd_defines_pthreads=no unistd_defines_pthreads=no
fi fi
rm -f conftest* rm -f -r conftest*
{ echo "$as_me:$LINENO: result: $unistd_defines_pthreads" >&5 { echo "$as_me:$LINENO: result: $unistd_defines_pthreads" >&5
echo "${ECHO_T}$unistd_defines_pthreads" >&6; } echo "${ECHO_T}$unistd_defines_pthreads" >&6; }
@ -17337,7 +17333,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
$EGREP "yes" >/dev/null 2>&1; then $EGREP "yes" >/dev/null 2>&1; then
ipv6type=$i ipv6type=$i
fi fi
rm -f conftest* rm -f -r conftest*
;; ;;
kame) kame)
@ -17360,7 +17356,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
ipv6libdir=/usr/local/v6/lib ipv6libdir=/usr/local/v6/lib
ipv6trylibc=yes ipv6trylibc=yes
fi fi
rm -f conftest* rm -f -r conftest*
;; ;;
linux-glibc) linux-glibc)
@ -17381,7 +17377,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
ipv6type=$i; ipv6type=$i;
ipv6trylibc=yes ipv6trylibc=yes
fi fi
rm -f conftest* rm -f -r conftest*
;; ;;
linux-inet6) linux-inet6)
@ -17419,7 +17415,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
ipv6lib=inet6; ipv6lib=inet6;
ipv6libdir=/usr/local/v6/lib ipv6libdir=/usr/local/v6/lib
fi fi
rm -f conftest* rm -f -r conftest*
;; ;;
v6d) v6d)
@ -17442,7 +17438,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
ipv6libdir=/usr/local/v6/lib; ipv6libdir=/usr/local/v6/lib;
BASECFLAGS="-I/usr/local/v6/include $BASECFLAGS" BASECFLAGS="-I/usr/local/v6/include $BASECFLAGS"
fi fi
rm -f conftest* rm -f -r conftest*
;; ;;
zeta) zeta)
@ -17464,7 +17460,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
ipv6lib=inet6; ipv6lib=inet6;
ipv6libdir=/usr/local/v6/lib ipv6libdir=/usr/local/v6/lib
fi fi
rm -f conftest* rm -f -r conftest*
;; ;;
esac esac
@ -26007,7 +26003,7 @@ cat >>confdefs.h <<\_ACEOF
_ACEOF _ACEOF
fi fi
rm -f conftest* rm -f -r conftest*
cat >conftest.$ac_ext <<_ACEOF cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */ /* confdefs.h. */
@ -26026,7 +26022,7 @@ cat >>confdefs.h <<\_ACEOF
_ACEOF _ACEOF
fi fi
rm -f conftest* rm -f -r conftest*
fi fi
@ -26296,7 +26292,7 @@ cat >>confdefs.h <<\_ACEOF
_ACEOF _ACEOF
fi fi
rm -f conftest* rm -f -r conftest*
fi fi
@ -28235,6 +28231,7 @@ SOVERSION!$SOVERSION$ac_delim
CONFIG_ARGS!$CONFIG_ARGS$ac_delim CONFIG_ARGS!$CONFIG_ARGS$ac_delim
UNIVERSALSDK!$UNIVERSALSDK$ac_delim UNIVERSALSDK!$UNIVERSALSDK$ac_delim
ARCH_RUN_32BIT!$ARCH_RUN_32BIT$ac_delim ARCH_RUN_32BIT!$ARCH_RUN_32BIT$ac_delim
LIPO_32BIT_FLAGS!$LIPO_32BIT_FLAGS$ac_delim
PYTHONFRAMEWORK!$PYTHONFRAMEWORK$ac_delim PYTHONFRAMEWORK!$PYTHONFRAMEWORK$ac_delim
PYTHONFRAMEWORKIDENTIFIER!$PYTHONFRAMEWORKIDENTIFIER$ac_delim PYTHONFRAMEWORKIDENTIFIER!$PYTHONFRAMEWORKIDENTIFIER$ac_delim
PYTHONFRAMEWORKDIR!$PYTHONFRAMEWORKDIR$ac_delim PYTHONFRAMEWORKDIR!$PYTHONFRAMEWORKDIR$ac_delim
@ -28289,7 +28286,6 @@ LIBTOOL_CRUFT!$LIBTOOL_CRUFT$ac_delim
SO!$SO$ac_delim SO!$SO$ac_delim
LDSHARED!$LDSHARED$ac_delim LDSHARED!$LDSHARED$ac_delim
BLDSHARED!$BLDSHARED$ac_delim BLDSHARED!$BLDSHARED$ac_delim
CCSHARED!$CCSHARED$ac_delim
_ACEOF _ACEOF
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@ -28331,6 +28327,7 @@ _ACEOF
ac_delim='%!_!# ' ac_delim='%!_!# '
for ac_last_try in false false false false false :; do for ac_last_try in false false false false false :; do
cat >conf$$subs.sed <<_ACEOF cat >conf$$subs.sed <<_ACEOF
CCSHARED!$CCSHARED$ac_delim
LINKFORSHARED!$LINKFORSHARED$ac_delim LINKFORSHARED!$LINKFORSHARED$ac_delim
CFLAGSFORSHARED!$CFLAGSFORSHARED$ac_delim CFLAGSFORSHARED!$CFLAGSFORSHARED$ac_delim
SHLIBS!$SHLIBS$ac_delim SHLIBS!$SHLIBS$ac_delim
@ -28357,7 +28354,7 @@ SRCDIRS!$SRCDIRS$ac_delim
LTLIBOBJS!$LTLIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF _ACEOF
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 24; then if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 25; then
break break
elif $ac_last_try; then elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5

View file

@ -112,6 +112,7 @@ AC_SUBST(UNIVERSALSDK)
AC_SUBST(ARCH_RUN_32BIT) AC_SUBST(ARCH_RUN_32BIT)
UNIVERSAL_ARCHS="32-bit" UNIVERSAL_ARCHS="32-bit"
AC_SUBST(LIPO_32BIT_FLAGS)
AC_MSG_CHECKING(for --with-universal-archs) AC_MSG_CHECKING(for --with-universal-archs)
AC_ARG_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")), AC_HELP_STRING(--with-universal-archs=ARCH, select architectures for universal build ("32-bit", "64-bit", "3-way", "intel" or "all")),
@ -177,14 +178,8 @@ AC_ARG_ENABLE(framework,
PYTHONFRAMEWORKINSTALLDIR=$PYTHONFRAMEWORKPREFIX/$PYTHONFRAMEWORKDIR PYTHONFRAMEWORKINSTALLDIR=$PYTHONFRAMEWORKPREFIX/$PYTHONFRAMEWORKDIR
FRAMEWORKINSTALLFIRST="frameworkinstallstructure" FRAMEWORKINSTALLFIRST="frameworkinstallstructure"
FRAMEWORKALTINSTALLFIRST="frameworkinstallstructure bininstall maninstall" FRAMEWORKALTINSTALLFIRST="frameworkinstallstructure bininstall maninstall"
if test "$UNIVERSAL_ARCHS" = "all" FRAMEWORKINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools"
then FRAMEWORKALTINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkaltinstallunixtools"
FRAMEWORKINSTALLLAST="frameworkinstallmaclib frameworkinstallapps4way frameworkinstallunixtools4way"
FRAMEWORKALTINSTALLLAST="frameworkinstallmaclib frameworkinstallapps4way frameworkaltinstallunixtools4way"
else
FRAMEWORKINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools"
FRAMEWORKALTINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkaltinstallunixtools"
fi
if test "x${prefix}" = "xNONE" ; then if test "x${prefix}" = "xNONE" ; then
FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}" FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
@ -217,11 +212,6 @@ AC_ARG_ENABLE(framework,
fi fi
enable_framework= enable_framework=
if test "$UNIVERSAL_ARCHS" = "all"
then
FRAMEWORKINSTALLLAST=update4wayuniversal
FRAMEWORKALTINSTALLLAST=update4wayuniversal
fi
]) ])
AC_SUBST(PYTHONFRAMEWORK) AC_SUBST(PYTHONFRAMEWORK)
AC_SUBST(PYTHONFRAMEWORKIDENTIFIER) AC_SUBST(PYTHONFRAMEWORKIDENTIFIER)
@ -952,22 +942,27 @@ yes)
if test "$UNIVERSAL_ARCHS" = "32-bit" ; then if test "$UNIVERSAL_ARCHS" = "32-bit" ; then
UNIVERSAL_ARCH_FLAGS="-arch ppc -arch i386" UNIVERSAL_ARCH_FLAGS="-arch ppc -arch i386"
ARCH_RUN_32BIT="" ARCH_RUN_32BIT=""
LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
elif test "$UNIVERSAL_ARCHS" = "64-bit" ; then elif test "$UNIVERSAL_ARCHS" = "64-bit" ; then
UNIVERSAL_ARCH_FLAGS="-arch ppc64 -arch x86_64" UNIVERSAL_ARCH_FLAGS="-arch ppc64 -arch x86_64"
LIPO_32BIT_FLAGS=""
ARCH_RUN_32BIT="true" ARCH_RUN_32BIT="true"
elif test "$UNIVERSAL_ARCHS" = "all" ; then elif test "$UNIVERSAL_ARCHS" = "all" ; then
UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch ppc64 -arch x86_64" UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch ppc64 -arch x86_64"
LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
ARCH_RUN_32BIT="arch -i386 -ppc" ARCH_RUN_32BIT="arch -i386 -ppc"
elif test "$UNIVERSAL_ARCHS" = "intel" ; then elif test "$UNIVERSAL_ARCHS" = "intel" ; then
UNIVERSAL_ARCH_FLAGS="-arch i386 -arch x86_64" UNIVERSAL_ARCH_FLAGS="-arch i386 -arch x86_64"
LIPO_32BIT_FLAGS="-extract i386"
ARCH_RUN_32BIT="arch -i386" ARCH_RUN_32BIT="arch -i386"
elif test "$UNIVERSAL_ARCHS" = "3-way" ; then elif test "$UNIVERSAL_ARCHS" = "3-way" ; then
UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch x86_64" UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch x86_64"
ARCH_RUN_32BIT="arch -i386 -ppc" LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
ARCH_RUN_32BIT="arch -i386 -ppc7400"
else else
AC_MSG_ERROR([proper usage is --with-universal-arch=32-bit|64-bit|all|intel|3-way]) AC_MSG_ERROR([proper usage is --with-universal-arch=32-bit|64-bit|all|intel|3-way])