Author: Pawe? Piotr Przeradowski <[email protected]>
Branch: distutils-cppldflags
Changeset: r65378:d13af1390dae
Date: 2013-07-13 19:50 +0200
http://bitbucket.org/pypy/pypy/changeset/d13af1390dae/

Log:    ADD CPPFLAGS and LDFLAGS

diff --git a/lib-python/2.7/distutils/sysconfig_pypy.py 
b/lib-python/2.7/distutils/sysconfig_pypy.py
--- a/lib-python/2.7/distutils/sysconfig_pypy.py
+++ b/lib-python/2.7/distutils/sysconfig_pypy.py
@@ -12,6 +12,7 @@
 
 import sys
 import os
+import shlex
 
 from distutils.errors import DistutilsPlatformError
 
@@ -124,11 +125,19 @@
     if compiler.compiler_type == "unix":
         compiler.compiler_so.extend(['-O2', '-fPIC', '-Wimplicit'])
         compiler.shared_lib_extension = get_config_var('SO')
+        if "CPPFLAGS" in os.environ:
+            cppflags = shlex.split(os.environ["CPPFLAGS"])
+            compiler.compiler.extend(cppflags)
+            compiler.compiler_so.extend(cppflags)
+            compiler.linker_so.extend(cppflags)
         if "CFLAGS" in os.environ:
-            cflags = os.environ["CFLAGS"].split()
+            cflags = shlex.split(os.environ["CFLAGS"])
             compiler.compiler.extend(cflags)
             compiler.compiler_so.extend(cflags)
             compiler.linker_so.extend(cflags)
+        if "LDFLAGS" in os.environ:
+            ldflags = shlex.split(os.environ["LDFLAGS"])
+            compiler.linker_so.extend(ldflags)
 
 
 from sysconfig_cpython import (
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to