Kaydet (Commit) 08cd598c authored tarafından Brett Cannon's avatar Brett Cannon

Introduced EXTRA_CFLAGS as an environment variable used by the Makefile. Meant

to be used for flags that change binary compatibility.

Distutils was tweaked to also use the variable if used during compilation of
the interpreter.
üst 43148c84
...@@ -146,8 +146,9 @@ def customize_compiler(compiler): ...@@ -146,8 +146,9 @@ def customize_compiler(compiler):
varies across Unices and is stored in Python's Makefile. varies across Unices and is stored in Python's Makefile.
""" """
if compiler.compiler_type == "unix": if compiler.compiler_type == "unix":
(cc, cxx, opt, basecflags, ccshared, ldshared, so_ext) = \ (cc, cxx, opt, extra_cflags, basecflags, ccshared, ldshared, so_ext) = \
get_config_vars('CC', 'CXX', 'OPT', 'BASECFLAGS', 'CCSHARED', 'LDSHARED', 'SO') get_config_vars('CC', 'CXX', 'OPT', 'EXTRA_CFLAGS', 'BASECFLAGS',
'CCSHARED', 'LDSHARED', 'SO')
if os.environ.has_key('CC'): if os.environ.has_key('CC'):
cc = os.environ['CC'] cc = os.environ['CC']
...@@ -171,7 +172,7 @@ def customize_compiler(compiler): ...@@ -171,7 +172,7 @@ def customize_compiler(compiler):
opt = opt + ' ' + os.environ['CPPFLAGS'] opt = opt + ' ' + os.environ['CPPFLAGS']
ldshared = ldshared + ' ' + os.environ['CPPFLAGS'] ldshared = ldshared + ' ' + os.environ['CPPFLAGS']
cc_cmd = cc + ' ' + opt cc_cmd = ' '.join(str(x) for x in (cc, opt, extra_cflags) if x)
compiler.set_executables( compiler.set_executables(
preprocessor=cpp, preprocessor=cpp,
compiler=cc_cmd, compiler=cc_cmd,
......
...@@ -55,7 +55,7 @@ MAKESETUP= $(srcdir)/Modules/makesetup ...@@ -55,7 +55,7 @@ MAKESETUP= $(srcdir)/Modules/makesetup
# Compiler options # Compiler options
OPT= @OPT@ OPT= @OPT@
BASECFLAGS= @BASECFLAGS@ BASECFLAGS= @BASECFLAGS@
CFLAGS= $(BASECFLAGS) $(OPT) CFLAGS= $(BASECFLAGS) $(OPT) $(EXTRA_CFLAGS)
# Both CPPFLAGS and LDFLAGS need to contain the shell's value for setup.py to # Both CPPFLAGS and LDFLAGS need to contain the shell's value for setup.py to
# be able to build extension modules using the directories specified in the # be able to build extension modules using the directories specified in the
# environment variables # environment variables
......
...@@ -276,6 +276,11 @@ Library ...@@ -276,6 +276,11 @@ Library
Build Build
----- -----
- EXTRA_CFLAGS has been introduced as an environment variable to hold compiler
flags that change binary compatibility. Changes were also made to
distutils.sysconfig to also use the environment variable when used during
compilation of the interpreter.
- SF patch 1171735: Darwin 8's headers are anal about POSIX compliance, - SF patch 1171735: Darwin 8's headers are anal about POSIX compliance,
and linking has changed (prebinding is now deprecated, and libcc_dynamic and linking has changed (prebinding is now deprecated, and libcc_dynamic
no longer exists). This configure patch makes things right. no longer exists). This configure patch makes things right.
......
This file describes some special Python build types enabled via This file describes some special Python build types enabled via
compile-time preprocessor defines. compile-time preprocessor defines.
It is best to define these options in the OPT environment variable; It is best to define these options in the EXTRA_FLAGS environment variable;
``OPT="-DPy_REF_DEBUG" ./configure``. If you want the default values of ``EXTRA_CFLAGS="-DPy_REF_DEBUG" ./configure``.
OPT to also be included you will need to add them in yourself manually.
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Py_REF_DEBUG introduced in 1.4 Py_REF_DEBUG introduced in 1.4
......
...@@ -827,6 +827,9 @@ the -Wall and -Wstrict-prototypes options. ...@@ -827,6 +827,9 @@ the -Wall and -Wstrict-prototypes options.
Additional debugging code to help debug memory management problems can Additional debugging code to help debug memory management problems can
be enabled by using the --with-pydebug option to the configure script. be enabled by using the --with-pydebug option to the configure script.
For flags that change binary compatibility, use the EXTRA_CFLAGS
variable.
Profiling Profiling
--------- ---------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment