]> granicus.if.org Git - python/commitdiff
Introduced EXTRA_CFLAGS as an environment variable used by the Makefile. Meant
authorBrett Cannon <bcannon@gmail.com>
Sun, 24 Apr 2005 22:26:38 +0000 (22:26 +0000)
committerBrett Cannon <bcannon@gmail.com>
Sun, 24 Apr 2005 22:26:38 +0000 (22:26 +0000)
to be used for flags that change binary compatibility.

Distutils was tweaked to also use the variable if used during compilation of
the interpreter.

Lib/distutils/sysconfig.py
Makefile.pre.in
Misc/NEWS
Misc/SpecialBuilds.txt
README

index aae0f27cb57624745db9f78e07ce45aac4981653..1bd62097f04e95344c2f9168e49aed1902642a2b 100644 (file)
@@ -146,8 +146,9 @@ def customize_compiler(compiler):
     varies across Unices and is stored in Python's Makefile.
     """
     if compiler.compiler_type == "unix":
-        (cc, cxx, opt, basecflags, ccshared, ldshared, so_ext) = \
-            get_config_vars('CC', 'CXX', 'OPT', 'BASECFLAGS', 'CCSHARED', 'LDSHARED', 'SO')
+        (cc, cxx, opt, extra_cflags, basecflags, ccshared, ldshared, so_ext) = \
+            get_config_vars('CC', 'CXX', 'OPT', 'EXTRA_CFLAGS', 'BASECFLAGS',
+                            'CCSHARED', 'LDSHARED', 'SO')
 
         if os.environ.has_key('CC'):
             cc = os.environ['CC']
@@ -171,7 +172,7 @@ def customize_compiler(compiler):
             opt = opt + ' ' + 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(
             preprocessor=cpp,
             compiler=cc_cmd,
index e4d9008d50abe6c796afd56ac27e44d5d52e775b..7b440f311880f1e4c1add10ce724f0a432a3534f 100644 (file)
@@ -55,7 +55,7 @@ MAKESETUP=      $(srcdir)/Modules/makesetup
 # Compiler options
 OPT=           @OPT@
 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
 # be able to build extension modules using the directories specified in the
 # environment variables
index 23f760b774bd437fbc6e9f9a4e81a7bf9ac96487..1557a46ce1b57a9fd6595b836bf29af2a62e62d7 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -276,6 +276,11 @@ Library
 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,
   and linking has changed (prebinding is now deprecated, and libcc_dynamic
   no longer exists). This configure patch makes things right.
index feff20e5cd7a77ab74943b2e2e448d03716eedbc..811147668f637a7fd120102ef309c472f24006ff 100644 (file)
@@ -1,9 +1,8 @@
 This file describes some special Python build types enabled via
 compile-time preprocessor defines.
 
-It is best to define these options in the OPT environment variable;
-``OPT="-DPy_REF_DEBUG" ./configure``.  If you want the default values of
-OPT to also be included you will need to add them in yourself manually.
+It is best to define these options in the EXTRA_FLAGS environment variable;
+``EXTRA_CFLAGS="-DPy_REF_DEBUG" ./configure``.
 
 ---------------------------------------------------------------------------
 Py_REF_DEBUG                                              introduced in 1.4
diff --git a/README b/README
index dedd3bd2e457db8cd25d8233cea4563daa6fe50a..f1c3a890ea1dd24b2db0c48e2b42d08bad832fc0 100644 (file)
--- a/README
+++ b/README
@@ -827,6 +827,9 @@ the -Wall and -Wstrict-prototypes options.
 Additional debugging code to help debug memory management problems can
 be enabled by using the --with-pydebug option to the configure script.
 
+For flags that change binary compatibility, use the EXTRA_CFLAGS
+variable.
+
 
 Profiling
 ---------