[pypy-commit] pypy default: (mwp antocuni) make platform work on PowerPC

mwp noreply at buildbot.pypy.org
Thu Nov 10 11:07:23 CET 2011


Author: Mark Pearse <mark.pearse at skynet.be>
Branch: 
Changeset: r49119:065a3c82eebf
Date: 2011-11-04 13:40 +0100
http://bitbucket.org/pypy/pypy/changeset/065a3c82eebf/

Log:	(mwp antocuni) make platform work on PowerPC

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
@@ -240,10 +240,13 @@
     else:
         host_factory = Linux64
 elif sys.platform == 'darwin':
-    from pypy.translator.platform.darwin import Darwin_i386, Darwin_x86_64
+    from pypy.translator.platform.darwin import Darwin_i386, Darwin_x86_64, Darwin_PowerPC
     import platform
-    assert platform.machine() in ('i386', 'x86_64')
-    if sys.maxint <= 2147483647:
+    assert platform.machine() in ('Power Macintosh', 'i386', 'x86_64')
+
+    if  platform.machine() == 'Power Macintosh':
+        host_factory = Darwin_PowerPC
+    elif sys.maxint <= 2147483647:
         host_factory = Darwin_i386
     else:
         host_factory = Darwin_x86_64
diff --git a/pypy/translator/platform/darwin.py b/pypy/translator/platform/darwin.py
--- a/pypy/translator/platform/darwin.py
+++ b/pypy/translator/platform/darwin.py
@@ -71,6 +71,11 @@
     link_flags = ('-arch', 'i386')
     cflags = ('-arch', 'i386', '-O3', '-fomit-frame-pointer')
 
+class Darwin_PowerPC(Darwin):#xxx fixme, mwp
+    name = "darwin_powerpc"
+    link_flags = ()
+    cflags = ('-O3', '-fomit-frame-pointer')
+
 class Darwin_x86_64(Darwin):
     name = "darwin_x86_64"
     link_flags = ('-arch', 'x86_64')
diff --git a/pypy/translator/platform/test/test_darwin.py b/pypy/translator/platform/test/test_darwin.py
--- a/pypy/translator/platform/test/test_darwin.py
+++ b/pypy/translator/platform/test/test_darwin.py
@@ -7,7 +7,7 @@
     py.test.skip("Darwin only")
 
 from pypy.tool.udir import udir
-from pypy.translator.platform.darwin import Darwin_i386, Darwin_x86_64
+from pypy.translator.platform.darwin import Darwin_i386, Darwin_x86_64, Darwin_PowerPC
 from pypy.translator.platform.test.test_platform import TestPlatform as BasicTest
 from pypy.translator.tool.cbuild import ExternalCompilationInfo
 
@@ -17,7 +17,7 @@
     else:
         host_factory = Darwin_x86_64
 else:
-    host_factory = Darwin
+    host_factory = Darwin_PowerPC
 
 class TestDarwin(BasicTest):
     platform = host_factory()


More information about the pypy-commit mailing list