[pypy-svn] r72323 - in pypy/branch/kill-python-h/pypy/translator/c: . src

arigo at codespeak.net arigo at codespeak.net
Wed Mar 17 18:25:09 CET 2010


Author: arigo
Date: Wed Mar 17 18:25:08 2010
New Revision: 72323

Modified:
   pypy/branch/kill-python-h/pypy/translator/c/genc.py
   pypy/branch/kill-python-h/pypy/translator/c/src/g_prerequisite.h
Log:
Fix for the case of non-standalone builds.


Modified: pypy/branch/kill-python-h/pypy/translator/c/genc.py
==============================================================================
--- pypy/branch/kill-python-h/pypy/translator/c/genc.py	(original)
+++ pypy/branch/kill-python-h/pypy/translator/c/genc.py	Wed Mar 17 18:25:08 2010
@@ -115,7 +115,6 @@
         self.eci = self.get_eci()
 
     def get_eci(self):
-        from distutils import sysconfig
         pypy_include_dir = py.path.local(autopath.pypydir).join('translator', 'c')
         include_dirs = [pypy_include_dir]
         return ExternalCompilationInfo(include_dirs=include_dirs)
@@ -303,6 +302,12 @@
     _module = None
     _wrapper = None
 
+    def get_eci(self):
+        from distutils import sysconfig
+        python_inc = sysconfig.get_python_inc()
+        eci = ExternalCompilationInfo(include_dirs=[python_inc])
+        return eci.merge(CBuilder.get_eci(self))
+
     def getentrypointptr(self): # xxx
         if self._wrapper is None:
             self._wrapper = new_wrapper(self.entrypoint, self.translator)

Modified: pypy/branch/kill-python-h/pypy/translator/c/src/g_prerequisite.h
==============================================================================
--- pypy/branch/kill-python-h/pypy/translator/c/src/g_prerequisite.h	(original)
+++ pypy/branch/kill-python-h/pypy/translator/c/src/g_prerequisite.h	Wed Mar 17 18:25:08 2010
@@ -2,7 +2,13 @@
 /**************************************************************/
 /***  this is included before any code produced by genc.py  ***/
 
-#include "src/commondefs.h"
+
+#ifdef PYPY_STANDALONE
+#  include "src/commondefs.h"
+#else
+#  include "Python.h"
+#endif
+
 
 #ifndef AVR
 #include "thread.h"   /* needs to be included early to define the



More information about the Pypy-commit mailing list