[pypy-svn] r50928 - pypy/branch/asmgcroot/pypy/translator/c

arigo at codespeak.net arigo at codespeak.net
Wed Jan 23 17:01:01 CET 2008


Author: arigo
Date: Wed Jan 23 17:01:00 2008
New Revision: 50928

Modified:
   pypy/branch/asmgcroot/pypy/translator/c/genc.py
Log:
Fix this logic.


Modified: pypy/branch/asmgcroot/pypy/translator/c/genc.py
==============================================================================
--- pypy/branch/asmgcroot/pypy/translator/c/genc.py	(original)
+++ pypy/branch/asmgcroot/pypy/translator/c/genc.py	Wed Jan 23 17:01:00 2008
@@ -281,25 +281,25 @@
             self.eci, compiler_exe = cc, profbased = profbased)
 
     def compile(self):
+        assert self.c_source_filename
+        assert not self._compiled
+        compiler = self.getccompiler()
         if self.config.translation.asmgcroot:
             # as we are gcc-only anyway, let's just use the Makefile.
             cmdline = "make -C '%s'" % (self.targetdir,)
             err = os.system(cmdline)
             if err != 0:
                 raise OSError("failed (see output): " + cmdline)
-            return str(self.getccompiler().outputfilename)
-        assert self.c_source_filename
-        assert not self._compiled
-        eci = self.eci.merge(ExternalCompilationInfo(includes=
-                                                     [str(self.targetdir)]))
-        compiler = self.getccompiler()
-        if sys.platform == 'darwin':
-            compiler.compile_extra.append('-mdynamic-no-pic')
-        if self.config.translation.compilerflags:
-            compiler.compile_extra.append(self.config.translation.compilerflags)
-        if self.config.translation.linkerflags:
-            compiler.link_extra.append(self.config.translation.linkerflags)
-        compiler.build()
+        else:
+            eci = self.eci.merge(ExternalCompilationInfo(includes=
+                                                         [str(self.targetdir)]))
+            if sys.platform == 'darwin':
+                compiler.compile_extra.append('-mdynamic-no-pic')
+            if self.config.translation.compilerflags:
+                compiler.compile_extra.append(self.config.translation.compilerflags)
+            if self.config.translation.linkerflags:
+                compiler.link_extra.append(self.config.translation.linkerflags)
+            compiler.build()
         self.executable_name = str(compiler.outputfilename)
         self._compiled = True
         return self.executable_name



More information about the Pypy-commit mailing list