1
Description: Define new cpu architectures
2
mupen64plus must exactly know for which architectures it is build and
3
which word size and endianness it has. Most architectures supported
4
by debian weren't listed here. That means that the build would
5
probably fail or generate unusable binaries.
6
To better support unknown architectures NO_ASM must be enabled by
7
default and known good architectures can then override this value. The
8
user can still force to change that behavior by NO_ASM=0 or NO_ASM=1
10
Bug: http://code.google.com/p/mupen64plus/issues/detail?id=260
11
Bug-Debian: http://bugs.debian.org/544673
12
Bug-Debian: http://bugs.debian.org/545463
13
Author: Sven Eckelmann <sven.eckelmann@gmx.de>
16
diff --git a/pre.mk b/pre.mk
17
index 5c7b73c40731e7ac66d285c9fe783c9f250c5ca1..c128cf77aa0ba6eb692ab7528235235633491f02 100644
21
# * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
22
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
24
-# detect system architecture: i386, x86_64, or PPC/PPC64
25
+# detect system architecture: i386, x86_64, PPC/PPC64, ALPHA, ARM, AVR32, HPPA,
26
+# IA64, M32R, M68K, MIPS, S390, SH3, SH4, SPARC
27
UNAME = $(shell uname -m)
29
ifeq ("$(UNAME)","x86_64")
32
ifeq ("$(BITS)", "32")
40
+ CPU_ENDIANNESS := LITTLE
42
-ifneq ("$(filter i%86,$(UNAME))","")
45
+ifneq ("$(filter pentium i%86,$(UNAME))","")
49
+ CPU_ENDIANNESS := LITTLE
51
-ifeq ("$(UNAME)","ppc")
55
+ifneq ("$(filter ppc powerpc,$(UNAME))","")
59
+ CPU_ENDIANNESS := BIG
61
-ifeq ("$(UNAME)","ppc64")
65
+ifneq ("$(filter ppc64 powerpc64,$(UNAME))","")
69
+ CPU_ENDIANNESS := BIG
71
+ifneq ("$(filter alpha%,$(UNAME))","")
75
+ CPU_ENDIANNESS := LITTLE
77
+ifneq ("$(filter arm%b,$(UNAME))","")
81
+ CPU_ENDIANNESS := BIG
83
+ifneq ("$(filter arm%,$(UNAME))","")
87
+ CPU_ENDIANNESS := LITTLE
90
+ifneq ("$(filter hppa%b,$(UNAME))","")
94
+ CPU_ENDIANNESS := BIG
96
+ifeq ("$(UNAME)","ia64")
100
+ CPU_ENDIANNESS := LITTLE
102
+ifeq ("$(UNAME)","avr32")
106
+ CPU_ENDIANNESS := BIG
108
+ifeq ("$(UNAME)","m32r")
112
+ CPU_ENDIANNESS := BIG
114
+ifeq ("$(UNAME)","m68k")
118
+ CPU_ENDIANNESS := BIG
120
+ifneq ("$(filter mips mipseb,$(UNAME))","")
124
+ CPU_ENDIANNESS := BIG
126
+ifeq ("$(UNAME)","mipsel")
130
+ CPU_ENDIANNESS := LITTLE
132
+ifeq ("$(UNAME)","s390")
136
+ CPU_ENDIANNESS := BIG
138
+ifeq ("$(UNAME)","s390x")
142
+ CPU_ENDIANNESS := BIG
144
+ifeq ("$(UNAME)","sh3")
148
+ CPU_ENDIANNESS := LITTLE
150
+ifeq ("$(UNAME)","sh3eb")
154
+ CPU_ENDIANNESS := BIG
156
+ifeq ("$(UNAME)","sh4")
160
+ CPU_ENDIANNESS := LITTLE
162
+ifeq ("$(UNAME)","sh4eb")
166
+ CPU_ENDIANNESS := BIG
168
+ifeq ("$(UNAME)","sparc")
172
+ CPU_ENDIANNESS := BIG
175
# detect operation system. Currently just linux and OSX.
176
@@ -214,7 +325,10 @@ ifeq ($(CPU), X86)
180
- CFLAGS += -mcpu=powerpc -D_BIG_ENDIAN
181
+ CFLAGS += -mcpu=powerpc
183
+ifeq ($(CPU_ENDIANNESS), BIG)
184
+ CFLAGS += -D_BIG_ENDIAN
187
# set CFLAGS, LIBS, and LDFLAGS for external dependencies