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)


 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 import log, c_string_constant
+from 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
             # XXX incredible hack for darwin
-            cfiles = self.compiler.cfiles
             STR = '/*--no-profiling-for-this-file!--*/'
             no_prof = []
             prof = []
         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):
     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)


-#define PYPY_MAIN_FUNCTION main
+#define MAIN_FUNCTION main
 #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
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.