George Burgess IV | b2459ff | 2019-02-05 13:04:40 -0800 | [diff] [blame] | 1 | Python uses a hand-rolled Makefile parser to pick out important build-related |
| 2 | environment variables and stash them in the `sysconfig` module. Crucially, it'll |
| 3 | take a Makefile that looks like |
| 4 | |
| 5 | ``` |
| 6 | FOO = 1 |
| 7 | BAR = $(FOO) $(BAZ) $(QUX) |
| 8 | ``` |
| 9 | |
| 10 | ...And given an environment of {'FOO': 99, 'BAZ': '98'}, will produce something |
| 11 | like {'FOO': '1', 'BAR': '1 98 '} |
| 12 | |
| 13 | Since EXTRA_CFLAGS is literally only used as a means to pass a PGO profile in, |
| 14 | and that profile won't be available to anything but the core Python modules, we |
| 15 | clear 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" ; \ |