mirror of
https://github.com/python/cpython
synced 2026-11-23 00:04:08 +03:00
This patch adds a new configure argument on OSX:
--with-universal-archs=[32-bit|64-bit|all]
When used with the --enable-universalsdk option this controls which
CPU architectures are includes in the framework. The default is 32-bit,
meaning i386 and ppc. The most useful alternative is 'all', which includes
all 4 CPU architectures supported by MacOS X (i386, ppc, x86_64 and ppc64).
This includes limited support for the Carbon bindings in 64-bit mode as well,
limited because (a) I haven't done extensive testing and (b) a large portion
of the Carbon API's aren't available in 64-bit mode anyway.
I've also duplicated a feature of Apple's build of python: setting the
environment variable 'ARCHFLAGS' controls the '-arch' flags used for building
extensions using distutils.
60 lines
2.1 KiB
Makefile
60 lines
2.1 KiB
Makefile
prefix=@prefix@
|
|
CC=@CC@
|
|
LD=@CC@
|
|
BASECFLAGS=@BASECFLAGS@
|
|
OPT=@OPT@
|
|
CFLAGS=$(BASECFLAGS) $(OPT)
|
|
LDFLAGS=@LDFLAGS@
|
|
srcdir= @srcdir@
|
|
VERSION= @VERSION@
|
|
UNIVERSALSDK=@UNIVERSALSDK@
|
|
builddir= ../..
|
|
PYTHONFRAMEWORK=@PYTHONFRAMEWORK@
|
|
|
|
RUNSHARED= @RUNSHARED@
|
|
BUILDEXE= @BUILDEXEEXT@
|
|
BUILDPYTHON= $(builddir)/python$(BUILDEXE)
|
|
|
|
# Deployment target selected during configure, to be checked
|
|
# by distutils
|
|
MACOSX_DEPLOYMENT_TARGET=@CONFIGURE_MACOSX_DEPLOYMENT_TARGET@
|
|
@EXPORT_MACOSX_DEPLOYMENT_TARGET@export MACOSX_DEPLOYMENT_TARGET
|
|
|
|
BUNDLEBULDER=$(srcdir)/../../Lib/plat-mac/bundlebuilder.py
|
|
|
|
PYTHONAPPSDIR=/Applications/$(PYTHONFRAMEWORK) $(VERSION)
|
|
|
|
all: IDLE.app
|
|
|
|
install: IDLE.app $(srcdir)/config-main.def $(srcdir)/config-extensions.def
|
|
test -d "$(DESTDIR)$(PYTHONAPPSDIR)" || mkdir -p "$(DESTDIR)$(PYTHONAPPSDIR)"
|
|
-test -d "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" && rm -r "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app"
|
|
cp -PR IDLE.app "$(DESTDIR)$(PYTHONAPPSDIR)"
|
|
touch "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app"
|
|
cp $(srcdir)/config-main.def "$(DESTDIR)$(prefix)/lib/python$(VERSION)/idlelib/config-main.def"
|
|
cp $(srcdir)/config-extensions.def "$(DESTDIR)$(prefix)/lib/python$(VERSION)/idlelib/config-extensions.def"
|
|
|
|
clean:
|
|
rm -rf IDLE.app
|
|
|
|
IDLE.app: \
|
|
$(srcdir)/../Icons/IDLE.icns $(srcdir)/idlemain.py \
|
|
$(srcdir)/../Icons/PythonSource.icns \
|
|
$(srcdir)/../Icons/PythonCompiled.icns Info.plist
|
|
rm -fr IDLE.app
|
|
$(RUNSHARED) arch -ppc -i386 $(BUILDPYTHON) $(BUNDLEBULDER) \
|
|
--builddir=. \
|
|
--name=IDLE \
|
|
--link-exec \
|
|
--plist=Info.plist \
|
|
--mainprogram=$(srcdir)/idlemain.py \
|
|
--iconfile=$(srcdir)/../Icons/IDLE.icns \
|
|
--resource=$(srcdir)/../Icons/PythonSource.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"` \
|
|
build
|
|
|
|
|
|
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
|
|
|