Author: Matti Picus <[email protected]>
Branch: pypy-config
Changeset: r87946:cb9e85067732
Date: 2016-10-26 20:09 +0300
http://bitbucket.org/pypy/pypy/changeset/cb9e85067732/

Log:    minimize diff to distutils/sysconfig_python.py

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
@@ -61,21 +61,21 @@
 
 def _init_posix():
     """Initialize the module as appropriate for POSIX systems."""
-    g = {}
-    g['EXE'] = ""
-    g['SO'] = [s[0] for s in imp.get_suffixes() if s[2] == imp.C_EXTENSION][0]
-    g['LIBDIR'] = os.path.join(sys.prefix, 'lib')
-    g['CC'] = "gcc -pthread" # -pthread might not be valid on OS/X, check
+    # _sysconfigdata is generated at build time, see the sysconfig module
+    from _sysconfigdata import build_time_vars
+    global _config_vars
+    _config_vars = {}
+    _config_vars.update(build_time_vars)
 
-    global _config_vars
-    _config_vars = g
 
 
 def _init_nt():
     """Initialize the module as appropriate for NT"""
     g = {}
+    g['SO'] = [s[0] for s in imp.get_suffixes() if s[2] == imp.C_EXTENSION][0]
     g['EXE'] = ".exe"
-    g['SO'] = [s[0] for s in imp.get_suffixes() if s[2] == imp.C_EXTENSION][0]
+    g['VERSION'] = get_python_version().replace(".", "")
+    g['BINDIR'] = os.path.dirname(os.path.abspath(sys.executable))
 
     global _config_vars
     _config_vars = g
@@ -99,6 +99,9 @@
         else:
             _config_vars = {}
 
+        # Normalized versions of prefix and exec_prefix are handy to have;
+        # in fact, these are the standard versions used most places in the
+        # Distutils.
         _config_vars['prefix'] = PREFIX
         _config_vars['exec_prefix'] = EXEC_PREFIX
 
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to