diff options
author | Jeffrey Yasskin <jyasskin@gmail.com> | 2010-07-09 16:30:58 (GMT) |
---|---|---|
committer | Jeffrey Yasskin <jyasskin@gmail.com> | 2010-07-09 16:30:58 (GMT) |
commit | d4fcdb1ea847389f0cc62840d59d0701f33bbf3d (patch) | |
tree | 4aa78e816c9dd0575f1f9aec33eeb4e36c3c571b /Lib/sysconfig.py | |
parent | 74e4561a3cdf9d38caca4573b68e1c72fc489629 (diff) | |
download | cpython-d4fcdb1ea847389f0cc62840d59d0701f33bbf3d.zip cpython-d4fcdb1ea847389f0cc62840d59d0701f33bbf3d.tar.gz cpython-d4fcdb1ea847389f0cc62840d59d0701f33bbf3d.tar.bz2 |
Issue #9189: Allow users to set $CFLAGS, $CPPFLAGS, and $LDFLAGS when running
configure to append to Python's default values for those variables, and
similarly allow users to set $XXFLAGS on the make command line to append to the
values set by configure.
In the makefile, this renames the variables that used to be $XXFLAGS to
$PY_XXFLAGS, and renames the old $PY_CFLAGS to $PY_CORE_CFLAGS. To compensate,
sysconfig now aliases $XXFLAGS=$PY_XXFLAGS so that scripts using it keep
working. I see that as the right interface, not a backward-compatibility hack,
since these are logically the $XXFLAGS variables; we just use a different name
in the makefile to deal with make's semantics.
Diffstat (limited to 'Lib/sysconfig.py')
-rw-r--r-- | Lib/sysconfig.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py index 03f2d5c..d59a682 100644 --- a/Lib/sysconfig.py +++ b/Lib/sysconfig.py @@ -259,6 +259,11 @@ def _parse_makefile(filename, vars=None): # bogus variable reference; just drop it since we can't deal variables.remove(name) + # Add in CFLAGS, LDFLAGS, and CPPFLAGS, which are named with a + # prefix in the Makefile. + for var in ('CFLAGS', 'LDFLAGS', 'CPPFLAGS'): + done[var] = done['PY_' + var] + # save the results in the global dictionary vars.update(done) return vars |