@@ -71,12 +71,17 @@ OPT= @OPT@
7171BASECFLAGS= @BASECFLAGS@
7272BASECPPFLAGS= @BASECPPFLAGS@
7373CONFIGURE_CFLAGS= @CFLAGS@
74+ # CFLAGS_NODIST is used for building the interpreter and stdlib C extensions.
75+ # Use it when a compiler flag should _not_ be part of the distutils CFLAGS
76+ # once Python is installed (Issue #21121).
77+ CONFIGURE_CFLAGS_NODIST=@CFLAGS_NODIST@
7478CONFIGURE_CPPFLAGS= @CPPFLAGS@
7579CONFIGURE_LDFLAGS= @LDFLAGS@
7680# Avoid assigning CFLAGS, LDFLAGS, etc. so users can use them on the
7781# command line to append to these values without stomping the pre-set
7882# values.
7983PY_CFLAGS= $(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) $(EXTRA_CFLAGS)
84+ PY_CFLAGS_NODIST=$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST)
8085# Both CPPFLAGS and LDFLAGS need to contain the shell's value for setup.py to
8186# be able to build extension modules using the directories specified in the
8287# environment variables
@@ -91,7 +96,7 @@ ARFLAGS= @ARFLAGS@
9196# Extra C flags added for building the interpreter object files.
9297CFLAGSFORSHARED=@CFLAGSFORSHARED@
9398# C flags used for building the interpreter object files
94- PY_CORE_CFLAGS= $(PY_CFLAGS) $(PY_CPPFLAGS) $(CFLAGSFORSHARED) -DPy_BUILD_CORE
99+ PY_CORE_CFLAGS= $(PY_CFLAGS) $(PY_CFLAGS_NODIST) $( PY_CPPFLAGS) $(CFLAGSFORSHARED) -DPy_BUILD_CORE
95100
96101
97102# Machine-dependent subdirectories
0 commit comments