Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r49396:1be28eed2789
Date: 2011-11-14 10:56 +0100
http://bitbucket.org/pypy/pypy/changeset/1be28eed2789/

Log:    merge heads

diff --git a/pypy/translator/platform/__init__.py 
b/pypy/translator/platform/__init__.py
--- a/pypy/translator/platform/__init__.py
+++ b/pypy/translator/platform/__init__.py
@@ -42,6 +42,8 @@
 
     so_prefixes = ('',)
 
+    extra_libs = ()
+
     def __init__(self, cc):
         if self.__class__ is Platform:
             raise TypeError("You should not instantiate Platform class 
directly")
@@ -181,7 +183,8 @@
         link_files = self._linkfiles(eci.link_files)
         export_flags = self._exportsymbols_link_flags(eci)
         return (library_dirs + list(self.link_flags) + export_flags +
-                link_files + list(eci.link_extra) + libraries)
+                link_files + list(eci.link_extra) + libraries +
+                list(self.extra_libs))
 
     def _exportsymbols_link_flags(self, eci, relto=None):
         if eci.export_symbols:
diff --git a/pypy/translator/platform/linux.py 
b/pypy/translator/platform/linux.py
--- a/pypy/translator/platform/linux.py
+++ b/pypy/translator/platform/linux.py
@@ -6,7 +6,8 @@
 class BaseLinux(BasePosix):
     name = "linux"
     
-    link_flags = ('-pthread', '-lrt')
+    link_flags = ('-pthread',)
+    extra_libs = ('-lrt',)
     cflags = ('-O3', '-pthread', '-fomit-frame-pointer',
               '-Wall', '-Wno-unused')
     standalone_only = ()
diff --git a/pypy/translator/platform/posix.py 
b/pypy/translator/platform/posix.py
--- a/pypy/translator/platform/posix.py
+++ b/pypy/translator/platform/posix.py
@@ -140,7 +140,7 @@
             ('DEFAULT_TARGET', exe_name.basename),
             ('SOURCES', rel_cfiles),
             ('OBJECTS', rel_ofiles),
-            ('LIBS', self._libs(eci.libraries)),
+            ('LIBS', self._libs(eci.libraries) + list(self.extra_libs)),
             ('LIBDIRS', self._libdirs(rel_libdirs)),
             ('INCLUDEDIRS', self._includedirs(rel_includedirs)),
             ('CFLAGS', cflags),
diff --git a/pypy/translator/platform/test/test_posix.py 
b/pypy/translator/platform/test/test_posix.py
--- a/pypy/translator/platform/test/test_posix.py
+++ b/pypy/translator/platform/test/test_posix.py
@@ -41,6 +41,7 @@
         if self.strict_on_stderr:
             assert res.err == ''
         assert res.returncode == 0
+        assert '-lrt' in tmpdir.join("Makefile").read()
 
     def test_link_files(self):
         tmpdir = udir.join('link_files' + 
self.__class__.__name__).ensure(dir=1)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to