@@ -438,7 +438,7 @@ LIBRARY_OBJS= \
438438
439439# Default target
440440all: build_all
441- build_all: $(BUILDPYTHON) oldsharedmods sharedmods gdbhooks Modules/_testembed
441+ build_all: $(BUILDPYTHON) oldsharedmods sharedmods gdbhooks Modules/_testembed python-config
442442
443443# Compile a binary with gcc profile guided optimization.
444444profile-opt:
@@ -1132,10 +1132,12 @@ $(srcdir)/Lib/$(PLATDIR):
11321132 fi; \
11331133 cd $(srcdir)/Lib/$(PLATDIR); $(RUNSHARED) ./regen
11341134
1135- python-config: $(srcdir)/Misc/python-config.in
1135+ python-config: $(srcdir)/Misc/python-config.in Misc/python-config.sh
11361136 # Substitution happens here, as the completely-expanded BINDIR
11371137 # is not available in configure
1138- sed -e "s,@EXENAME@,$(BINDIR)/python$(LDVERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config
1138+ sed -e "s,@EXENAME@,$(BINDIR)/python$(LDVERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config.py
1139+ # Replace makefile compat. variable references with shell script compat. ones; $(VAR) -> ${VAR}
1140+ sed -e 's,\$$(\([A-Za-z0-9_]*\)),\$$\{\1\},g' < Misc/python-config.sh >python-config
11391141
11401142# Install the include files
11411143INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
@@ -1193,8 +1195,8 @@ libainstall: all python-config
11931195 $(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION).pc
11941196 $(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup
11951197 $(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh
1198+ $(INSTALL_SCRIPT) python-config.py $(DESTDIR)$(LIBPL)/python-config.py
11961199 $(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python$(LDVERSION)-config
1197- rm python-config
11981200 @if [ -s Modules/python.exp -a \
11991201 "`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \
12001202 echo; echo "Installing support files for building shared extension modules on AIX:"; \
@@ -1381,6 +1383,7 @@ clobber: clean profile-removal
13811383 config.cache config.log pyconfig.h Modules/config.c
13821384 -rm -rf build platform
13831385 -rm -rf $(PYTHONFRAMEWORKDIR)
1386+ -rm -f python-config.py python-config
13841387
13851388# Make things extra clean, before making a distribution:
13861389# remove all generated files, even Makefile[.pre]
0 commit comments