Source

pypy / ctypes_configure / cbuild.py

The branch 'cli-jit' does not exist.
Diff from to

File ctypes_configure/cbuild.py

 
 import os, sys, inspect, re, imp, py
 from ctypes_configure import stdoutcapture
+import distutils
 
 debug = 0
 
         opt += '/Op'
     gcv['OPT'] = opt
 
+
+def try_compile(c_files, eci):
+    try:
+        build_executable(c_files, eci)
+        result = True
+    except (distutils.errors.CompileError,
+            distutils.errors.LinkError):
+        result = False
+    return result
+
 def compile_c_module(cfiles, modbasename, eci, tmpdir=None):
     #try:
     #    from distutils.log import set_threshold
 
 def log_spawned_cmd(spawn):
     def spawn_and_log(cmd, *args, **kwds):
-        log.execute(' '.join(cmd))
+        if debug:
+            log.execute(' '.join(cmd))
         return spawn(cmd, *args, **kwds)
     return spawn_and_log