[pypy-svn] r56587 - pypy/dist/pypy/translator/c

hpk at codespeak.net hpk at codespeak.net
Wed Jul 16 10:27:36 CEST 2008


Author: hpk
Date: Wed Jul 16 10:27:34 2008
New Revision: 56587

Modified:
   pypy/dist/pypy/translator/c/genc.py
Log:
refactor ld/cflags options a bit to make a simple pypy-c build work on solaris/SunOS 5.10 (i.e. no-threads and no-allworkingmodules) 


Modified: pypy/dist/pypy/translator/c/genc.py
==============================================================================
--- pypy/dist/pypy/translator/c/genc.py	(original)
+++ pypy/dist/pypy/translator/c/genc.py	Wed Jul 16 10:27:34 2008
@@ -341,12 +341,7 @@
         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)
+            self.adaptflags(compiler)
             compiler.build()
         self.executable_name = str(compiler.outputfilename)
         self._compiled = True
@@ -356,6 +351,16 @@
         assert self._compiled
         return py.process.cmdexec('"%s" %s' % (self.executable_name, args))
 
+    def adaptflags(self, compiler):
+        if sys.platform == 'darwin':
+            compiler.compile_extra.append('-mdynamic-no-pic')
+        if sys.platform == 'sunos5':
+            compiler.link_extra.append("-lrt")
+        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)
+
     def gen_makefile(self, targetdir):
         def write_list(lst, prefix):
             for i, fn in enumerate(lst):
@@ -369,12 +374,8 @@
         self.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)
+       
+        self.adaptflags(compiler)
         assert self.config.translation.gcrootfinder != "llvmgc"
         cfiles = []
         ofiles = []



More information about the Pypy-commit mailing list