diff --git a/Mac/Makefile.in b/Mac/Makefile.in --- a/Mac/Makefile.in +++ b/Mac/Makefile.in @@ -46,8 +46,9 @@ APPSUBDIRS=MacOS Resources compileall=$(srcdir)/../Lib/compileall.py -installapps: install_Python install_pythonw install_PythonLauncher install_IDLE \ - checkapplepython +installapps: install_Python install_pythonw checkapplepython + +installapplications: install_PythonLauncher install_IDLE install_pythonw: pythonw $(INSTALL_PROGRAM) $(STRIPFLAG) pythonw "$(DESTDIR)$(prefix)/bin/pythonw$(VERSION)" @@ -94,11 +95,15 @@ pythonw: $(srcdir)/Tools/pythonw.c Makefile $(CC) $(LDFLAGS) -DPYTHONFRAMEWORK='"$(PYTHONFRAMEWORK)"' -o $@ $(srcdir)/Tools/pythonw.c -I.. -I$(srcdir)/../Include ../$(PYTHONFRAMEWORK).framework/Versions/$(VERSION)/$(PYTHONFRAMEWORK) -install_PythonLauncher: +$(DESTDIR)$(PYTHONAPPSDIR): + echo "Creating directory $(DESTDIR)$(PYTHONAPPSDIR)"; + $(INSTALL) -d -m $(DIRMODE) "$(DESTDIR)$(PYTHONAPPSDIR)"; + +install_PythonLauncher: $(DESTDIR)$(PYTHONAPPSDIR) cd PythonLauncher && make install DESTDIR=$(DESTDIR) install_Python: - @for i in "$(PYTHONAPPSDIR)" "$(APPINSTALLDIR)" "$(APPINSTALLDIR)/Contents"; do \ + @for i in "$(APPINSTALLDIR)" "$(APPINSTALLDIR)/Contents"; do \ if test ! -d "$(DESTDIR)$$i"; then \ echo "Creating directory $(DESTDIR)$$i"; \ $(INSTALL) -d -m $(DIRMODE) "$(DESTDIR)$$i"; \ @@ -149,7 +154,7 @@ rm "$(DESTDIR)$(APPINSTALLDIR)/Contents/Info.plist.in" -install_IDLE: +install_IDLE: $(DESTDIR)$(PYTHONAPPSDIR) test -d "$(DESTDIR)$(PYTHONAPPSDIR)" || mkdir -p "$(DESTDIR)$(PYTHONAPPSDIR)" -test -d "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" && rm -rf "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" /bin/cp -PR "$(srcdir)/IDLE/IDLE.app" "$(DESTDIR)$(PYTHONAPPSDIR)" diff --git a/Mac/README b/Mac/README --- a/Mac/README +++ b/Mac/README @@ -28,6 +28,14 @@ Specify the name for the python framework, defaults to ``Python``. This option is only valid when ``--enable-framework`` is specified. +* ``--without-framework-applications`` + + Do not install the application bundles for IDLE and the Python Launcher. + This option is only valid when ``--enable-framework`` is specified. + + Use this when your embedding a Python framework in another application and + don't need the contents of ``/Applications/Python X.Y``. + * ``--enable-universalsdk[=PATH]`` Create a universal binary build of of Python. This can be used with both diff --git a/Makefile.pre.in b/Makefile.pre.in --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1149,10 +1149,14 @@ ln -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/python$(VERSION)/config-$(LDVERSION)/libpython$(VERSION).dylib" ln -fs "../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/libpython$(VERSION).dylib" -# This installs the IDE, the Launcher and other apps into /Applications +# This installs the Python.app and pythonw commands for a framework frameworkinstallapps: cd Mac && $(MAKE) installapps DESTDIR="$(DESTDIR)" +# This installs the IDE, the Launcher and other apps into /Applications +frameworkinstallapplications: + cd Mac && $(MAKE) installapplications DESTDIR="$(DESTDIR)" + # This install the unix python and pythonw tools in /usr/local/bin frameworkinstallunixtools: cd Mac && $(MAKE) installunixtools DESTDIR="$(DESTDIR)" diff --git a/configure.in b/configure.in --- a/configure.in +++ b/configure.in @@ -134,6 +134,22 @@ ]) +AC_ARG_WITH(framework-applications, + AS_HELP_STRING([--without-framework-applications], + [do not install framework applications into /Applications]), +[ + case ${withval} in + yes|no) + WITH_FRAMEWORK_APPS=${withval} + ;; + *) + AC_MSG_ERROR([proper usage is --with-framework-applications or --without-framework-applications]) + ;; + esac +],[ + WITH_FRAMEWORK_APPS=yes +]) + AC_ARG_WITH(framework-name, AS_HELP_STRING([--with-framework-name=FRAMEWORK], @@ -177,7 +193,12 @@ PYTHONFRAMEWORKINSTALLDIR=$PYTHONFRAMEWORKPREFIX/$PYTHONFRAMEWORKDIR FRAMEWORKINSTALLFIRST="frameworkinstallstructure" FRAMEWORKALTINSTALLFIRST="frameworkinstallstructure " - FRAMEWORKINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools" + + if test "${WITH_FRAMEWORK_APPS}" = "yes"; then + FRAMEWORKINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkinstallapplications frameworkinstallunixtools" + else + FRAMEWORKINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools" + fi FRAMEWORKALTINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkaltinstallunixtools" FRAMEWORKINSTALLAPPSPREFIX="/Applications"