Maciej Fijalkowski  committed bcd415c

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

  • Participants
  • Parent commits c541bb3
  • Branches remove-translator-platform

Comments (0)

Files changed (2)

File pypy/translator/c/

 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)

File pypy/translator/c/src/main.h

-#define PYPY_MAIN_FUNCTION main
+#define MAIN_FUNCTION main
 #ifdef __GNUC__