[pypy-svn] r29844 - in pypy/dist/pypy/translator: . c

ericvrp at codespeak.net ericvrp at codespeak.net
Sat Jul 8 17:22:08 CEST 2006


Author: ericvrp
Date: Sat Jul  8 17:22:07 2006
New Revision: 29844

Modified:
   pypy/dist/pypy/translator/c/genc.py
   pypy/dist/pypy/translator/driver.py
Log:
fix for tests that do not supply a driver_options.cc


Modified: pypy/dist/pypy/translator/c/genc.py
==============================================================================
--- pypy/dist/pypy/translator/c/genc.py	(original)
+++ pypy/dist/pypy/translator/c/genc.py	Sat Jul  8 17:22:07 2006
@@ -208,11 +208,15 @@
         # XXX for now, we always include Python.h
         from distutils import sysconfig
         python_inc = sysconfig.get_python_inc()
+        if self.translator.driver_options:
+            cc = self.translator.driver_options.cc
+        else:
+            cc = None
         return CCompiler(
             [self.c_source_filename] + self.extrafiles,
             include_dirs = [autopath.this_dir, python_inc] + extra_includes,
             libraries    = self.libraries,
-            compiler_exe = self.translator.driver_options.cc)
+            compiler_exe = cc)
 
     def compile(self):
         assert self.c_source_filename
@@ -246,6 +250,11 @@
             cfiles.append(fn)
             ofiles.append(fn[:-2] + '.o')
 
+        if self.translator.driver_options and self.translator.driver_options.cc:
+            cc = self.translator.driver_options.cc
+        else:
+            cc = 'gcc'
+
         f = targetdir.join('Makefile').open('w')
         print >> f, '# automatically generated Makefile'
         print >> f
@@ -265,7 +274,7 @@
         print >> f, 'CFLAGS =', ' '.join(compiler.compile_extra)
         print >> f, 'LDFLAGS =', ' '.join(compiler.link_extra)
         print >> f, 'TFLAGS = ' + ('', '-pthread')[self.thread_enabled]
-        print >> f, 'CC = ' + (self.translator.driver_options.cc or 'cc')
+        print >> f, 'CC = ' + cc
         print >> f
         print >> f, MAKEFILE.strip()
         f.close()

Modified: pypy/dist/pypy/translator/driver.py
==============================================================================
--- pypy/dist/pypy/translator/driver.py	(original)
+++ pypy/dist/pypy/translator/driver.py	Sat Jul  8 17:22:07 2006
@@ -16,6 +16,7 @@
 
 DEFAULT_OPTIONS = {
   'gc': 'ref',
+  'cc': None,
 
   'thread': False, # influences GC policy
 



More information about the Pypy-commit mailing list