Patchwork WIP pypy3.3 - tests still fail? Anyone see why?

login
register
mail settings
Submitter Danny Milosavljevic
Date Oct. 8, 2016, 8:09 a.m.
Message ID <20161008100911.7b481a42@scratchpost.org>
Download mbox | patch
Permalink /patch/16363/
State New
Headers show

Comments

Danny Milosavljevic - Oct. 8, 2016, 8:09 a.m.
and the patch...

Patch

--- /tmp/sysconfig_pypy.py	2016-09-14 00:38:36.325334296 +0200
+++ pypy3.3-v5.2.0-alpha1-src/lib-python/3/distutils/sysconfig_pypy.py	2016-09-14 00:37:55.068908258 +0200
@@ -123,6 +123,19 @@ 
     optional C speedup components.
     """
     if compiler.compiler_type == "unix":
+        varnames = ["CC", "CXX", "LDSHARED", "CPP", "LDFLAGS", "CFLAGS", "CPPFLAGS", "AR", "ARFLAGS", "OPT", "CFLAGS", "CCSHARED", "SHLIB_SUFFIX"]
+        cfg = get_config_vars()
+        g = {}
+        for varname in varnames:
+            g[varname] = os.environ.get(varname) or cfg.get(varname)
+        cc = g["CC"] or "cc"
+        cpp = g["CPP"] if "CPP" in os.environ else ("{} -E".format(g["CC"]))
+        cc_cmd = "{} {}".format(g["CC"], g["CFLAGS"] or "")
+        ccshared = g["CCSHARED"] or ""
+        cxx = g["CXX"]
+        ldshared = "{} -shared {} {} {}".format(g["LDSHARED"] or g["CC"], os.environ.get("LDFLAGS", ""), os.environ.get("CFLAGS", ""), os.environ.get("CPPFLAGS", ""))
+        archiver = "{} {}".format(g["AR"], g["ARFLAGS"])
+        compiler.set_executables(preprocessor=cpp, compiler=cc_cmd, compiler_so=cc_cmd + " " + ccshared, compiler_cxx=cxx, linker_so=ldshared, linker_exe=cc, archiver=archiver)
         compiler.compiler_so.extend(['-O2', '-fPIC', '-Wimplicit'])
         compiler.shared_lib_extension = get_config_var('SO')
         if "CPPFLAGS" in os.environ: