Commit 040e1a9c authored by Jack Jansen's avatar Jack Jansen

By popular demand the frameworkinstall target now installs everything:

the framework, the MacOSX apps and the unix tools.
Most of the hard work is done by Mac/OSX/Makefile.

Also, it should now be possible to install in a different directory,
such as /tmp/dist/Library/Frameworks, for building binary installers.
The fink crowd wanted this.
parent 3ed6e278
# This file can be invoked from the "python.app" target in the # This file can be invoked from the various frameworkinstall... targets in the
# main Makefile. The next two variables are overridden on the # main Makefile. The next couple of variables are overridden on the
# commandline in that case. # commandline in that case.
# assume user was invoking from Mac/OSX directory and building in source tree VERSION=2.3
builddir = ../.. builddir = ../..
srcdir = ../.. srcdir = ../..
VERSION=2.3 LIBDEST=$(prefix)/lib/python$(VERSION)
prefix=/Library/Frameworks/Python.framework/Versions/$(VERSION) prefix=/Library/Frameworks/Python.framework/Versions/$(VERSION)
PYTHONAPPSDIR=/Applications/Python dstroot=/.
# These are normally glimpsed from the previous set
bindir=$(dstroot)/usr/local/bin
PYTHONAPPSDIR=$(dstroot)/Applications/Python
APPINSTALLDIR=$(prefix)/Resources/Python.app APPINSTALLDIR=$(prefix)/Resources/Python.app
# Variables for installing the "normal" unix binaries # Variables for installing the "normal" unix binaries
UNIXBINDIR=/usr/local/bin
INSTALLED_PYTHON=$(prefix)/bin/python INSTALLED_PYTHON=$(prefix)/bin/python
INSTALLED_PYTHONW=$(APPINSTALLDIR)/Contents/MacOS/python INSTALLED_PYTHONW=$(APPINSTALLDIR)/Contents/MacOS/python
...@@ -27,7 +29,7 @@ STRIPFLAG=-s ...@@ -27,7 +29,7 @@ STRIPFLAG=-s
OPT=-g -O3 -Wall -Wstrict-prototypes -Wno-long-double -no-cpp-precomp \ OPT=-g -O3 -Wall -Wstrict-prototypes -Wno-long-double -no-cpp-precomp \
-fno-common -dynamic -fno-common -dynamic
INCLUDES=-I$(builddir) -I$(srcdir)/Include -I$(srcdir)/Mac/Include INCLUDES=-I$(builddir) -I$(srcdir)/Include -I$(srcdir)/Mac/Include
DEFINES=-DHAVE_CONFIG_H DEFINES=
CFLAGS=$(OPT) $(DEFINES) $(INCLUDES) CFLAGS=$(OPT) $(DEFINES) $(INCLUDES)
LDFLAGS=-F$(builddir) -framework System -framework Python -framework Carbon \ LDFLAGS=-F$(builddir) -framework System -framework Python -framework Carbon \
...@@ -44,11 +46,11 @@ RESOURCEDIR=$(srcdir)/Mac/Resources ...@@ -44,11 +46,11 @@ RESOURCEDIR=$(srcdir)/Mac/Resources
RESOURCEFILE=python.rsrc RESOURCEFILE=python.rsrc
RFCONVERTER=$(srcdir)/Mac/Lib/applesingle.py RFCONVERTER=$(srcdir)/Mac/Lib/applesingle.py
install_all: install_PythonLauncher install_Python install_BuildApplet install_IDE installapps: install_PythonLauncher install_Python install_BuildApplet install_IDE
install_PythonLauncher: install_PythonLauncher:
cd $(srcdir)/Mac/OSX/PythonLauncher/PythonLauncher.pbproj ; \ cd $(srcdir)/Mac/OSX/PythonLauncher/PythonLauncher.pbproj ; \
pbxbuild -target PythonLauncher -buildstyle Deployment DSTROOT=/ install pbxbuild -target PythonLauncher -buildstyle Deployment DSTROOT=$(dstroot) install
install_Python: $(PYTHON) install_Python: $(PYTHON)
@for i in $(PYTHONAPPSDIR) $(APPINSTALLDIR) $(APPINSTALLDIR)/Contents; do \ @for i in $(PYTHONAPPSDIR) $(APPINSTALLDIR) $(APPINSTALLDIR)/Contents; do \
...@@ -221,20 +223,22 @@ installmacsubtree: ...@@ -221,20 +223,22 @@ installmacsubtree:
done; \ done; \
done done
$(INSTALL_DATA) $(srcdir)/Mac/OSX/Mac.pth $(prefix)/lib/python$(VERSION)/site-packages/ $(INSTALL_DATA) $(srcdir)/Mac/OSX/Mac.pth $(LIBDEST)/site-packages/
# Put symlinks "python" and "pythonw" in the standard place # Put symlinks "python" and "pythonw" in the standard place
$(INSTALLED_PYTHONW): install_Python $(INSTALLED_PYTHONW): install_Python
# $(INSTALLED_PYTHON) has to be done by the main Makefile, we cannot do that here. # $(INSTALLED_PYTHON) has to be done by the main Makefile, we cannot do that here.
# At least this rule will give an error if it doesn't exist.
installunixprograms: $(INSTALLED_PYTHON) $(INSTALLED_PYTHONW) pythonw.sh installunixtools: $(INSTALLED_PYTHON) $(INSTALLED_PYTHONW) $(srcdir)/Mac/OSX/pythonw.sh
$(INSTALL) -d $(UNIXBINDIR) $(INSTALL) -d $(bindir)
$(INSTALL_SYMLINK) $(INSTALLED_PYTHON) $(UNIXBINDIR)/python $(INSTALL_SYMLINK) $(INSTALLED_PYTHON) $(bindir)/python
$(INSTALL) pythonw.sh $(UNIXBINDIR)/pythonw $(INSTALL) $(srcdir)/Mac/OSX/pythonw.sh $(bindir)/pythonw
# This is for development purposes: create a Mac.pth that refers to the source # This is for development purposes: create a Mac.pth that refers to the source
# directories # directories
dontinstallmacsubtree: dontinstallmacsubtree:
l=`cd $(srcdir)/Mac/Lib; pwd`; \ l=`cd $(srcdir)/Mac/Lib; pwd`; \
echo $$l > $(prefix)/lib/python$(VERSION)/site-packages/Mac.pth ; \ echo $$l > $(LIBDEST)/site-packages/Mac.pth ; \
echo $$l/lib-scriptpackages >> $(prefix)/lib/python$(VERSION)/site-packages/Mac.pth echo $$l/lib-scriptpackages >> $(LIBDEST)/site-packages/Mac.pth
...@@ -770,43 +770,60 @@ sharedinstall: ...@@ -770,43 +770,60 @@ sharedinstall:
--install-scripts=$(BINDIR) \ --install-scripts=$(BINDIR) \
--install-platlib=$(DESTSHARED) --install-platlib=$(DESTSHARED)
# Here are a couple of targets for MacOSX again, to install a full
# framework-based Python. frameworkinstall installs everything, the
# subtargets install specific parts. Much of the actual work is offloaded to
# the Makefile in Mac/OSX
#
frameworkinstall: frameworkinstallframework \
frameworkinstallapps frameworkinstallunixtools
# On install, we re-make the framework # On install, we re-make the framework
# structure in the install location, /Library/Frameworks/ or the argument to # structure in the install location, /Library/Frameworks/ or the argument to
# --enable-framework. If --enable-framework has been specified then we have # --enable-framework. If --enable-framework has been specified then we have
# automatically set prefix to the location deep down in the framework, so we # automatically set prefix to the location deep down in the framework, so we
# only have to cater for the structural bits of the framework. # only have to cater for the structural bits of the framework.
frameworkinstall: frameworkinfrastructureinstall install frameworkinstallframework: frameworkinstallstructure install frameworkinstallmaclib
FRAMEWORKFINALDEST=$(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)
frameworkinfrastructureinstall: $(LDLIBRARY) frameworkinstallstructure: $(LDLIBRARY)
@if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \ @if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
echo Not configured with --enable-framework; \ echo Not configured with --enable-framework; \
exit 1; \ exit 1; \
else true; \ else true; \
fi fi
@for i in $(FRAMEWORKFINALDEST)/Resources/English.lproj $(FRAMEWORKFINALDEST)/lib; do\ @for i in $(prefix)/Resources/English.lproj $(prefix)/lib; do\
if test ! -d $$i; then \ if test ! -d $$i; then \
echo "Creating directory $$i"; \ echo "Creating directory $$i"; \
$(INSTALL) -d -m $(DIRMODE) $$i; \ $(INSTALL) -d -m $(DIRMODE) $$i; \
else true; \ else true; \
fi; \ fi; \
done done
$(LN) -fsn include/python$(VERSION) $(FRAMEWORKFINALDEST)/Headers $(LN) -fsn include/python$(VERSION) $(prefix)/Headers
$(INSTALL_DATA) $(RESSRCDIR)/Info.plist $(FRAMEWORKFINALDEST)/Resources/Info.plist $(INSTALL_DATA) $(RESSRCDIR)/Info.plist $(prefix)/Resources/Info.plist
$(INSTALL_DATA) $(RESSRCDIR)/version.plist $(FRAMEWORKFINALDEST)/Resources/version.plist $(INSTALL_DATA) $(RESSRCDIR)/version.plist $(prefix)/Resources/version.plist
$(INSTALL_DATA) $(RESSRCDIR)/English.lproj/InfoPlist.strings \ $(INSTALL_DATA) $(RESSRCDIR)/English.lproj/InfoPlist.strings \
$(FRAMEWORKFINALDEST)/Resources/English.lproj/InfoPlist.strings $(prefix)/Resources/English.lproj/InfoPlist.strings
$(LN) -fsn $(VERSION) $(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current $(LN) -fsn $(VERSION) $(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
$(LN) -fsn Versions/Current/Python $(PYTHONFRAMEWORKINSTALLDIR)/Python $(LN) -fsn Versions/Current/Python $(PYTHONFRAMEWORKINSTALLDIR)/Python
$(LN) -fsn Versions/Current/Headers $(PYTHONFRAMEWORKINSTALLDIR)/Headers $(LN) -fsn Versions/Current/Headers $(PYTHONFRAMEWORKINSTALLDIR)/Headers
$(LN) -fsn Versions/Current/Resources $(PYTHONFRAMEWORKINSTALLDIR)/Resources $(LN) -fsn Versions/Current/Resources $(PYTHONFRAMEWORKINSTALLDIR)/Resources
$(INSTALL_DATA) $(LDLIBRARY) $(PYTHONFRAMEWORKPREFIX)/$(LDLIBRARY) $(INSTALL_DATA) $(LDLIBRARY) $(PYTHONFRAMEWORKPREFIX)/$(LDLIBRARY)
# Build Python executable that can run GUI code. Another MacOSX pseudo # This installs Mac/Lib into the framework
# target. frameworkinstallmaclib:
osxapps: $(MAKE) -f $(srcdir)/Mac/OSX/Makefile installmacsubtree \
$(MAKE) -f $(srcdir)/Mac/OSX/Makefile installmacsubtree install_all \ srcdir=$(srcdir) builddir=. prefix=$(prefix) LIBDEST=$(LIBDEST)
srcdir=$(srcdir) builddir=.
# This installs the IDE, the Launcher and other apps into /Applications
frameworkinstallapps:
$(MAKE) -f $(srcdir)/Mac/OSX/Makefile installapps \
srcdir=$(srcdir) builddir=. dstroot=$(PYTHONFRAMEWORKPREFIX)/../..
# This install the unix python and pythonw tools in /usr/local/bin
frameworkinstallunixtools:
$(MAKE) -f $(srcdir)/Mac/OSX/Makefile installunixtools \
srcdir=$(srcdir) builddir=. dstroot=$(PYTHONFRAMEWORKPREFIX)/../..
# Build the toplevel Makefile # Build the toplevel Makefile
Makefile.pre: Makefile.pre.in config.status Makefile.pre: Makefile.pre.in config.status
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment