Maciej Fijalkowski avatar Maciej Fijalkowski committed bcd415c

a branch to use platformer instead of translator/platform and to remove the latter

Comments (0)

Files changed (2)

pypy/translator/c/genc.py

 from pypy.translator.gensupp import uniquemodulename, NameManager
 from pypy.translator.tool.cbuild import ExternalCompilationInfo
 from pypy.rpython.lltypesystem import lltype
-from pypy.tool.udir import udir
+from pypy.tool.udir import udir, pypydir
 from pypy.tool import isolate, runsubprocess
-from pypy.translator.c.support import log, c_string_constant
+from pypy.translator.c.support import log
 from pypy.rpython.typesystem import getfunctionptr
 from pypy.translator.c import gc
 from pypy.rlib import exports
 from pypy.tool.nullpath import NullPyPathLocal
 
-def import_module_from_directory(dir, modname):
-    file, pathname, description = imp.find_module(modname, [str(dir)])
-    try:
-        mod = imp.load_module(modname, file, pathname, description)
-    finally:
-        if file:
-            file.close()
-    return mod
-
 class ProfOpt(object):
     #XXX assuming gcc style flags for now
     name = "profopt"
         platform = self.compiler.platform
         if platform.name.startswith('darwin'):
             # XXX incredible hack for darwin
-            cfiles = self.compiler.cfiles
             STR = '/*--no-profiling-for-this-file!--*/'
             no_prof = []
             prof = []
                                             split=self.split)
         self.c_source_filename = py.path.local(cfile)
         self.extrafiles = self.eventually_copy(extra)
-        self.gen_makefile(targetdir, exe_name=exe_name)
+        self.gen_makefile(targetdir, exe_name=exe_name, proj_dir=pypydir,
+                          proj_main_function="pypy_main_startup")
         return cfile
 
     def eventually_copy(self, cfiles):
         fi.close()
 
     eci = add_extra_files(eci)
-    eci = eci.convert_sources_to_files(being_main=True)
+    eci = eci.convert_sources_to_files(main_clause='"#define NOT_MAIN_FILE\n')
     files, eci = eci.get_module_files()
     return eci, filename, sg.getextrafiles() + list(files)

pypy/translator/c/src/main.h

 
 #ifndef PYPY_NOT_MAIN_FILE
 
-#ifndef PYPY_MAIN_FUNCTION
-#define PYPY_MAIN_FUNCTION main
+#ifndef MAIN_FUNCTION
+#define MAIN_FUNCTION main
 #endif
 
 #ifdef __GNUC__
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.