[pypy-svn] r79618 - in pypy/branch/freebsd-compat: ctypes_configure lib_pypy pypy/jit/backend pypy/module/fcntl/test pypy/module/imp pypy/rlib pypy/rpython/lltypesystem pypy/rpython/module pypy/rpython/tool pypy/translator/platform pypy/translator/tool

antocuni at codespeak.net antocuni at codespeak.net
Mon Nov 29 09:27:10 CET 2010


Author: antocuni
Date: Mon Nov 29 09:27:08 2010
New Revision: 79618

Modified:
   pypy/branch/freebsd-compat/ctypes_configure/configure.py
   pypy/branch/freebsd-compat/lib_pypy/ctypes_support.py
   pypy/branch/freebsd-compat/pypy/jit/backend/detect_cpu.py
   pypy/branch/freebsd-compat/pypy/module/fcntl/test/test_fcntl.py
   pypy/branch/freebsd-compat/pypy/module/imp/importing.py
   pypy/branch/freebsd-compat/pypy/rlib/rdynload.py
   pypy/branch/freebsd-compat/pypy/rpython/lltypesystem/ll2ctypes.py
   pypy/branch/freebsd-compat/pypy/rpython/module/ll_time.py
   pypy/branch/freebsd-compat/pypy/rpython/tool/rffi_platform.py
   pypy/branch/freebsd-compat/pypy/translator/platform/__init__.py
   pypy/branch/freebsd-compat/pypy/translator/tool/cbuild.py
Log:
apply patch-pypy3.diff from https://codespeak.net/issue/pypy-dev/issue551



Modified: pypy/branch/freebsd-compat/ctypes_configure/configure.py
==============================================================================
--- pypy/branch/freebsd-compat/ctypes_configure/configure.py	(original)
+++ pypy/branch/freebsd-compat/ctypes_configure/configure.py	Mon Nov 29 09:27:08 2010
@@ -559,6 +559,7 @@
 C_HEADER = """
 #include <stdio.h>
 #include <stddef.h>   /* for offsetof() */
+#include <stdint.h>   /* FreeBSD: for uint64_t */
 
 void dump(char* key, int value) {
     printf("%s: %d\\n", key, value);

Modified: pypy/branch/freebsd-compat/lib_pypy/ctypes_support.py
==============================================================================
--- pypy/branch/freebsd-compat/lib_pypy/ctypes_support.py	(original)
+++ pypy/branch/freebsd-compat/lib_pypy/ctypes_support.py	Mon Nov 29 09:27:08 2010
@@ -25,7 +25,7 @@
     def _where_is_errno():
         return standard_c_lib.__errno_location()
 
-elif sys.platform == 'darwin':
+elif sys.platform in ('darwin', 'freebsd7', 'freebsd8', 'freebsd9'):
     standard_c_lib.__error.restype = ctypes.POINTER(ctypes.c_int)
     def _where_is_errno():
         return standard_c_lib.__error()

Modified: pypy/branch/freebsd-compat/pypy/jit/backend/detect_cpu.py
==============================================================================
--- pypy/branch/freebsd-compat/pypy/jit/backend/detect_cpu.py	(original)
+++ pypy/branch/freebsd-compat/pypy/jit/backend/detect_cpu.py	Mon Nov 29 09:27:08 2010
@@ -65,7 +65,7 @@
         return "pypy.jit.backend.x86.runner", "CPU"
     elif backend_name == 'x86-without-sse2':
         return "pypy.jit.backend.x86.runner", "CPU386_NO_SSE2"
-    elif backend_name == 'x86_64':
+    elif backend_name == 'amd64_64':
         return "pypy.jit.backend.x86.runner", "CPU_X86_64"
     elif backend_name == 'cli':
         return "pypy.jit.backend.cli.runner", "CliCPU"

Modified: pypy/branch/freebsd-compat/pypy/module/fcntl/test/test_fcntl.py
==============================================================================
--- pypy/branch/freebsd-compat/pypy/module/fcntl/test/test_fcntl.py	(original)
+++ pypy/branch/freebsd-compat/pypy/module/fcntl/test/test_fcntl.py	Mon Nov 29 09:27:08 2010
@@ -63,7 +63,7 @@
         if sys.platform in ('netbsd1', 'netbsd2', 'netbsd3', 
                             'Darwin1.2', 'darwin',
                             'freebsd2', 'freebsd3', 'freebsd4', 'freebsd5',
-                            'freebsd6', 'freebsd7', 
+                            'freebsd6', 'freebsd7', 'freebsd8', 'freebsd9',
                             'bsdos2', 'bsdos3', 'bsdos4',
                             'openbsd', 'openbsd2', 'openbsd3'):
             if struct.calcsize('l') == 8:
@@ -159,7 +159,7 @@
 
         if "linux" in sys.platform:
             TIOCGPGRP = 0x540f
-        elif "darwin" in sys.platform or "freebsd6" == sys.platform:
+        elif "darwin" in sys.platform or "freebsd" in sys.platform:
             TIOCGPGRP = 0x40047477
         else:
             skip("don't know how to test ioctl() on this platform")

Modified: pypy/branch/freebsd-compat/pypy/module/imp/importing.py
==============================================================================
--- pypy/branch/freebsd-compat/pypy/module/imp/importing.py	(original)
+++ pypy/branch/freebsd-compat/pypy/module/imp/importing.py	Mon Nov 29 09:27:08 2010
@@ -76,7 +76,7 @@
 
     return SEARCH_ERROR, None, None
 
-if sys.platform in ['linux2', 'freebsd']:
+if sys.platform == 'linux2' or 'freebsd' in sys.platform:
     def case_ok(filename):
         return True
 else:

Modified: pypy/branch/freebsd-compat/pypy/rlib/rdynload.py
==============================================================================
--- pypy/branch/freebsd-compat/pypy/rlib/rdynload.py	(original)
+++ pypy/branch/freebsd-compat/pypy/rlib/rdynload.py	Mon Nov 29 09:27:08 2010
@@ -14,7 +14,7 @@
 _MINGW = platform.name == "mingw32"
 _WIN32 = _MSVC or _MINGW
 _MAC_OS = platform.name == "darwin"
-_FREEBSD_7 = platform.name == "freebsd7"
+_FREEBSD = platform.name == "freebsd"
 
 if _WIN32:
     from pypy.rlib import rwin32
@@ -27,7 +27,7 @@
 else: 
     pre_include_bits = []
 
-if _FREEBSD_7 or _WIN32:
+if _FREEBSD or _WIN32:
     libraries = []
 else:
     libraries = ['dl']

Modified: pypy/branch/freebsd-compat/pypy/rpython/lltypesystem/ll2ctypes.py
==============================================================================
--- pypy/branch/freebsd-compat/pypy/rpython/lltypesystem/ll2ctypes.py	(original)
+++ pypy/branch/freebsd-compat/pypy/rpython/lltypesystem/ll2ctypes.py	Mon Nov 29 09:27:08 2010
@@ -1294,7 +1294,7 @@
             def _where_is_errno():
                 return standard_c_lib.__errno_location()
 
-        elif sys.platform in ('darwin', 'freebsd7'):
+        elif sys.platform in ('darwin', 'freebsd7', 'freebsd8', 'freebsd9'):
             standard_c_lib.__error.restype = ctypes.POINTER(ctypes.c_int)
             def _where_is_errno():
                 return standard_c_lib.__error()

Modified: pypy/branch/freebsd-compat/pypy/rpython/module/ll_time.py
==============================================================================
--- pypy/branch/freebsd-compat/pypy/rpython/module/ll_time.py	(original)
+++ pypy/branch/freebsd-compat/pypy/rpython/module/ll_time.py	Mon Nov 29 09:27:08 2010
@@ -41,7 +41,7 @@
         RUSAGE = platform.Struct('struct rusage', [('ru_utime', TIMEVAL),
                                                    ('ru_stime', TIMEVAL)])
 
-if sys.platform == 'freebsd7':
+if "freebsd" in sys.platform:
     libraries = ['compat']
 else:
     libraries = []

Modified: pypy/branch/freebsd-compat/pypy/rpython/tool/rffi_platform.py
==============================================================================
--- pypy/branch/freebsd-compat/pypy/rpython/tool/rffi_platform.py	(original)
+++ pypy/branch/freebsd-compat/pypy/rpython/tool/rffi_platform.py	Mon Nov 29 09:27:08 2010
@@ -639,6 +639,7 @@
 C_HEADER = """
 #include <stdio.h>
 #include <stddef.h>   /* for offsetof() */
+#include <stdint.h>   /* FreeBSD: for uint64_t */
 
 void dump(char* key, int value) {
     printf("%s: %d\\n", key, value);

Modified: pypy/branch/freebsd-compat/pypy/translator/platform/__init__.py
==============================================================================
--- pypy/branch/freebsd-compat/pypy/translator/platform/__init__.py	(original)
+++ pypy/branch/freebsd-compat/pypy/translator/platform/__init__.py	Mon Nov 29 09:27:08 2010
@@ -215,13 +215,13 @@
         host_factory = Darwin_i386
     else:
         host_factory = Darwin_x86_64
-elif sys.platform == 'freebsd7':
-    from pypy.translator.platform.freebsd7 import Freebsd7, Freebsd7_64
+elif "freebsd" in sys.platform:
+    from pypy.translator.platform.freebsd import Freebsd, Freebsd_64
     import platform
     if platform.architecture()[0] == '32bit':
-        host_factory = Freebsd7
+        host_factory = Freebsd
     else:
-        host_factory = Freebsd7_64
+        host_factory = Freebsd_64
 elif os.name == 'nt':
     from pypy.translator.platform.windows import Windows
     host_factory = Windows

Modified: pypy/branch/freebsd-compat/pypy/translator/tool/cbuild.py
==============================================================================
--- pypy/branch/freebsd-compat/pypy/translator/tool/cbuild.py	(original)
+++ pypy/branch/freebsd-compat/pypy/translator/tool/cbuild.py	Mon Nov 29 09:27:08 2010
@@ -309,6 +309,7 @@
 #define _POSIX_C_SOURCE 200112L
 /* Define on FreeBSD to activate all library features */
 #define __BSD_VISIBLE 1
+#define __XSI_VISIBLE 700
 /* Windows: winsock/winsock2 mess */
 #define WIN32_LEAN_AND_MEAN
 '''



More information about the Pypy-commit mailing list