Description: Add GNU/kFreeBSD platform description
 Add a new GNUkFreebsd platform, subclassing Freebsd.
 It include -lrt in extra_libs
Author: Stefano Rivera <stefanor@debian.org>
Forwarded: no
Last-Update: 2012-02-18

--- a/pypy/translator/platform/__init__.py
+++ b/pypy/translator/platform/__init__.py
@@ -260,6 +260,13 @@
         host_factory = Darwin_i386
     else:
         host_factory = Darwin_x86_64
+elif "gnukfreebsd" in sys.platform:
+    from pypy.translator.platform.freebsd import GNUkFreebsd, GNUkFreebsd_64
+    import platform
+    if platform.architecture()[0] == '32bit':
+        host_factory = GNUkFreebsd
+    else:
+        host_factory = GNUkFreebsd_64
 elif "freebsd" in sys.platform:
     from pypy.translator.platform.freebsd import Freebsd, Freebsd_64
     import platform
--- a/pypy/translator/platform/freebsd.py
+++ b/pypy/translator/platform/freebsd.py
@@ -52,3 +52,9 @@
 
 class Freebsd_64(Freebsd):
     shared_only = ('-fPIC',)
+
+class GNUkFreebsd(Freebsd):
+    extra_libs = ('-lrt',)
+
+class GNUkFreebsd_64(Freebsd_64):
+    extra_libs = ('-lrt',)
