# HG changeset patch # Parent 2248b9fbab3995f328794cbef41f1a59119485ea Issue #19533: PEP 453 - add --with-ensurepip[=upgrade|install|no] to configure diff a/Makefile.pre.in b/Makefile.pre.in --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -154,6 +154,9 @@ # Environment to run shared python without installed libraries RUNSHARED= @RUNSHARED@ +# ensurepip options +ENSUREPIP= @ENSUREPIP@ + # Modes for directories, executables and data files created by the # install process. Default to user-only-writable for all file types. DIRMODE= 755 @@ -953,10 +956,30 @@ $(TESTRUNNER) $(QUICKTESTOPTS) -install: altinstall bininstall maninstall +install: commoninstall bininstall maninstall + if test "x$(ENSUREPIP)" != "xno" ; then \ + case $(ENSUREPIP) in \ + upgrade) ensurepip="--upgrade" ;; \ + install|*) ensurepip="" ;; \ + esac; \ + $(RUNSHARED) $(PYTHON_FOR_BUILD) -m ensurepip \ + $$ensurepip --root=$(DESTDIR)/ ; \ + fi -altinstall: @FRAMEWORKALTINSTALLFIRST@ altbininstall libinstall inclinstall libainstall \ - sharedinstall oldsharedinstall altmaninstall @FRAMEWORKALTINSTALLLAST@ +altinstall: commoninstall + if test "x$(ENSUREPIP)" != "xno" ; then \ + case $(ENSUREPIP) in \ + upgrade) ensurepip="--altinstall --upgrade" ;; \ + install|*) ensurepip="--altinstall" ;; \ + esac; \ + $(RUNSHARED) $(PYTHON_FOR_BUILD) -m ensurepip \ + $$ensurepip --root=$(DESTDIR)/ ; \ + fi + +commoninstall: @FRAMEWORKALTINSTALLFIRST@ \ + altbininstall libinstall inclinstall libainstall \ + sharedinstall oldsharedinstall altmaninstall \ + @FRAMEWORKALTINSTALLLAST@ # Install shared libraries enabled by Setup DESTDIRS= $(exec_prefix) $(LIBDIR) $(BINLIBDEST) $(DESTSHARED) @@ -1541,7 +1564,7 @@ .PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure .PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools .PHONY: frameworkaltinstallunixtools recheck autoconf clean clobber distclean -.PHONY: smelly funny patchcheck touch altmaninstall +.PHONY: smelly funny patchcheck touch altmaninstall commoninstall .PHONY: gdbhooks # IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff a/configure.ac b/configure.ac --- a/configure.ac +++ b/configure.ac @@ -4693,6 +4693,21 @@ esac fi +# ensurepip option +AC_MSG_CHECKING(for ensurepip) +AC_ARG_WITH(ensurepip, + [AS_HELP_STRING([--with(out)-ensurepip=@<:@=upgrade@:>@], + ["install" or "upgrade" using bundled pip])], + [], + [with_ensurepip=upgrade]) +AS_CASE($with_ensurepip, + [yes|upgrade],[ENSUREPIP=upgrade], + [install],[ENSUREPIP=install], + [no],[ENSUREPIP=no], + [AC_MSG_ERROR([--with-ensurepip=upgrade|install|no])]) +AC_MSG_RESULT($ENSUREPIP) +AC_SUBST(ENSUREPIP) + # generate output files AC_CONFIG_FILES(Makefile.pre Modules/Setup.config Misc/python.pc Misc/python-config.sh) AC_CONFIG_FILES([Modules/ld_so_aix], [chmod +x Modules/ld_so_aix])