[pypy-commit] pypy remove-PYPY_NOT_MAIN_FILE: This hack is not needed anymore :-)

amauryfa noreply at buildbot.pypy.org
Tue Oct 2 16:45:15 CEST 2012


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: remove-PYPY_NOT_MAIN_FILE
Changeset: r57736:3d4fb2de6119
Date: 2012-10-02 16:44 +0200
http://bitbucket.org/pypy/pypy/changeset/3d4fb2de6119/

Log:	This hack is not needed anymore :-)

diff --git a/pypy/rpython/tool/rffi_platform.py b/pypy/rpython/tool/rffi_platform.py
--- a/pypy/rpython/tool/rffi_platform.py
+++ b/pypy/rpython/tool/rffi_platform.py
@@ -718,7 +718,7 @@
 """
 
 def run_example_code(filepath, eci, ignore_errors=False):
-    eci = eci.convert_sources_to_files(being_main=True)
+    eci = eci.convert_sources_to_files()
     files = [filepath]
     output = build_executable_cache(files, eci, ignore_errors=ignore_errors)
     section = None
diff --git a/pypy/translator/c/genc.py b/pypy/translator/c/genc.py
--- a/pypy/translator/c/genc.py
+++ b/pypy/translator/c/genc.py
@@ -942,7 +942,6 @@
     #
     # Header
     #
-    print >> f, '#define PYPY_MAIN_IMPLEMENTATION_FILE'
     print >> f, '#include "common_header.h"'
     print >> f
     commondefs(defines)
@@ -973,6 +972,6 @@
         fi.close()
 
     eci = add_extra_files(eci)
-    eci = eci.convert_sources_to_files(being_main=True)
+    eci = eci.convert_sources_to_files()
     files, eci = eci.get_module_files()
     return eci, filename, sg.getextrafiles() + list(files)
diff --git a/pypy/translator/tool/cbuild.py b/pypy/translator/tool/cbuild.py
--- a/pypy/translator/tool/cbuild.py
+++ b/pypy/translator/tool/cbuild.py
@@ -238,7 +238,7 @@
             d[attr] = getattr(self, attr)
         return d
 
-    def convert_sources_to_files(self, cache_dir=None, being_main=False):
+    def convert_sources_to_files(self, cache_dir=None):
         if not self.separate_module_sources:
             return self
         if cache_dir is None:
@@ -252,11 +252,6 @@
                 if not filename.check():
                     break
             f = filename.open("w")
-            if not being_main:
-                # This eci is being built independently from a larger
-                # target, so it has to include a copy of the C RPython
-                # helper functions when needed.
-                f.write("#define PYPY_MAIN_IMPLEMENTATION_FILE\n")
             self.write_c_header(f)
             source = str(source)
             f.write(source)


More information about the pypy-commit mailing list