blob: e37b516e3b059ee1546ca8057b6b8904880ec035 [file] [log] [blame]
George Burgess IVb2459ff2019-02-05 13:04:40 -08001Python uses a hand-rolled Makefile parser to pick out important build-related
2environment variables and stash them in the `sysconfig` module. Crucially, it'll
3take a Makefile that looks like
4
5```
6FOO = 1
7BAR = $(FOO) $(BAZ) $(QUX)
8```
9
10...And given an environment of {'FOO': 99, 'BAZ': '98'}, will produce something
11like {'FOO': '1', 'BAR': '1 98 '}
12
13Since EXTRA_CFLAGS is literally only used as a means to pass a PGO profile in,
14and that profile won't be available to anything but the core Python modules, we
15clear EXTRA_CFLAGS for the generation of sysconfig.
16
17--- a/Makefile.pre.in
18+++ b/Makefile.pre.in
19@@ -456,6 +456,7 @@ platform: $(BUILDPYTHON) pybuilddir.txt
20 # or removed in case of failure.
21 pybuilddir.txt: $(BUILDPYTHON)
22 @echo "none" > ./pybuilddir.txt
23+ EXTRA_CFLAGS= \
24 $(RUNSHARED) $(PYTHON_FOR_BUILD) -S -m sysconfig --generate-posix-vars ;\
25 if test $$? -ne 0 ; then \
26 echo "generate-posix-vars failed" ; \