[pypy-svn] r51401 - pypy/dist/pypy/rpython/tool

simonb at codespeak.net simonb at codespeak.net
Mon Feb 11 23:46:52 CET 2008


Author: simonb
Date: Mon Feb 11 23:46:52 2008
New Revision: 51401

Modified:
   pypy/dist/pypy/rpython/tool/genrffi.py
Log:
update to use new rffi interface

Modified: pypy/dist/pypy/rpython/tool/genrffi.py
==============================================================================
--- pypy/dist/pypy/rpython/tool/genrffi.py	(original)
+++ pypy/dist/pypy/rpython/tool/genrffi.py	Mon Feb 11 23:46:52 2008
@@ -4,6 +4,7 @@
 from pypy.rpython.lltypesystem import rffi
 from pypy.rpython.lltypesystem import lltype
 from pypy.rlib.unroll import unrolling_iterable
+from pypy.translator.tool.cbuild import ExternalCompilationInfo
 
 import py
 
@@ -44,10 +45,17 @@
             self.ns = {}
         else:
             self.ns = ns
-        self.includes = includes
-        self.libraries = libraries
         self.include_dirs = include_dirs
 
+        CConfig = type('CConfig', (object,), {})
+        CConfig._compilation_info_ = ExternalCompilationInfo(
+            includes = list(includes),
+            include_dirs = list(include_dirs),
+            libraries = list(libraries),
+        )
+
+        self.CConfig = CConfig
+
     def proc_struct(self, tp):
         name = tp.__name__
         struct = self.ns.get(name)
@@ -88,8 +96,7 @@
         ll_item = rffi.llexternal(
             name, arg_tps,
             self.proc_tp(func.restype), 
-            includes=self.includes, libraries=self.libraries, 
-            include_dirs=self.include_dirs)
+            compilation_info=self.CConfig._compilation_info_)
         self.ns[name] = ll_item
         return ll_item
 



More information about the Pypy-commit mailing list