diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2011-10-18 15:52:24 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-10-18 15:52:24 (GMT) |
commit | 1e73a2467f312f7b5ebef515cca6d3a16cf36f97 (patch) | |
tree | a5ddfaf2907b079983a2924779eb36b708b4e4ea /Makefile.pre.in | |
parent | cf28eacafe603fac8784d4a0b22b7864aec4a383 (diff) | |
download | cpython-1e73a2467f312f7b5ebef515cca6d3a16cf36f97.zip cpython-1e73a2467f312f7b5ebef515cca6d3a16cf36f97.tar.gz cpython-1e73a2467f312f7b5ebef515cca6d3a16cf36f97.tar.bz2 |
Issue #13150: sysconfig no longer parses the Makefile and config.h files
when imported, instead doing it at build time. This makes importing
sysconfig faster and reduces Python startup time by 20%.
Diffstat (limited to 'Makefile.pre.in')
-rw-r--r-- | Makefile.pre.in | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Makefile.pre.in b/Makefile.pre.in index d35a2fef..5c30eb3 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -396,7 +396,7 @@ LIBRARY_OBJS= \ # Default target all: build_all -build_all: $(BUILDPYTHON) oldsharedmods sharedmods gdbhooks Modules/_testembed +build_all: $(BUILDPYTHON) sysconfig oldsharedmods sharedmods gdbhooks Modules/_testembed # Compile a binary with gcc profile guided optimization. profile-opt: @@ -429,12 +429,15 @@ coverage: $(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Modules/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) -platform: $(BUILDPYTHON) +platform: $(BUILDPYTHON) sysconfig $(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from sysconfig import get_platform ; print(get_platform()+"-"+sys.version[0:3])' >platform +# Generate the sysconfig build-time data +sysconfig: $(BUILDPYTHON) + $(RUNSHARED) ./$(BUILDPYTHON) -SE -m sysconfig --generate-posix-vars # Build the shared modules -sharedmods: $(BUILDPYTHON) +sharedmods: $(BUILDPYTHON) sysconfig @case $$MAKEFLAGS in \ *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \ @@ -1379,7 +1382,7 @@ patchcheck: Python/thread.o: @THREADHEADERS@ # Declare targets that aren't real files -.PHONY: all build_all sharedmods oldsharedmods test quicktest +.PHONY: all build_all sysconfig sharedmods oldsharedmods test quicktest .PHONY: install altinstall oldsharedinstall bininstall altbininstall .PHONY: maninstall libinstall inclinstall libainstall sharedinstall .PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure |