Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b30802b

Browse files
committed
merge 3.4 (#21121)
2 parents a61d058 + acb8c52 commit b30802b

5 files changed

Lines changed: 20 additions & 3 deletions

File tree

Makefile.pre.in

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,17 @@ OPT= @OPT@
7171
BASECFLAGS= @BASECFLAGS@
7272
BASECPPFLAGS= @BASECPPFLAGS@
7373
CONFIGURE_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@
7478
CONFIGURE_CPPFLAGS= @CPPFLAGS@
7579
CONFIGURE_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.
7983
PY_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.
9297
CFLAGSFORSHARED=@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

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,9 @@ Library
121121

122122
- Issue #5411: Added support for the "xztar" format in the shutil module.
123123

124+
- Issue #21121: Don't force 3rd party C extensions to be built with
125+
-Werror=declaration-after-statement.
126+
124127
- Issue #21975: Fixed crash when using uninitialized sqlite3.Row (in particular
125128
when unpickling pickled sqlite3.Row). sqlite3.Row is now initialized in the
126129
__new__() method.

configure

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,7 @@ SHLIB_SUFFIX
662662
LIBTOOL_CRUFT
663663
OTHER_LIBTOOL_OPT
664664
UNIVERSAL_ARCH_FLAGS
665+
CFLAGS_NODIST
665666
BASECFLAGS
666667
OPT
667668
ABIFLAGS
@@ -6347,6 +6348,7 @@ fi
63476348

63486349

63496350

6351+
63506352
# The -arch flags for universal builds on OSX
63516353
UNIVERSAL_ARCH_FLAGS=
63526354

@@ -6507,7 +6509,7 @@ $as_echo "$ac_cv_declaration_after_statement_warning" >&6; }
65076509

65086510
if test $ac_cv_declaration_after_statement_warning = yes
65096511
then
6510-
BASECFLAGS="$BASECFLAGS -Werror=declaration-after-statement"
6512+
CFLAGS_NODIST="$CFLAGS_NODIST -Werror=declaration-after-statement"
65116513
fi
65126514

65136515
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can turn on $CC mixed sign comparison warning" >&5

configure.ac

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1147,6 +1147,7 @@ then
11471147
fi
11481148

11491149
AC_SUBST(BASECFLAGS)
1150+
AC_SUBST(CFLAGS_NODIST)
11501151

11511152
# The -arch flags for universal builds on OSX
11521153
UNIVERSAL_ARCH_FLAGS=
@@ -1231,7 +1232,7 @@ yes)
12311232

12321233
if test $ac_cv_declaration_after_statement_warning = yes
12331234
then
1234-
BASECFLAGS="$BASECFLAGS -Werror=declaration-after-statement"
1235+
CFLAGS_NODIST="$CFLAGS_NODIST -Werror=declaration-after-statement"
12351236
fi
12361237

12371238
AC_MSG_CHECKING(if we can turn on $CC mixed sign comparison warning)

setup.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@
1919

2020
cross_compiling = "_PYTHON_HOST_PLATFORM" in os.environ
2121

22+
# Add special CFLAGS reserved for building the interpreter and the stdlib
23+
# modules (Issue #21121).
24+
cflags = sysconfig.get_config_var('CFLAGS')
25+
py_cflags_nodist = sysconfig.get_config_var('PY_CFLAGS_NODIST')
26+
sysconfig.get_config_vars()['CFLAGS'] = cflags + ' ' + py_cflags_nodist
27+
2228
def get_platform():
2329
# cross build
2430
if "_PYTHON_HOST_PLATFORM" in os.environ:

0 commit comments

Comments
 (0)