comparison make/common/shared/Platform.gmk @ 3767:54d8193f177b

7027910: Add basic cross-compilation support and add ARM/PPC to the known architectures in the open code Summary: Cross-compilation support Reviewed-by: ohair, andrew
author dholmes
date Wed, 16 Mar 2011 18:54:50 -0400
parents 7bb09178ffc7
children 4085d44dc7df
comparison
equal deleted inserted replaced
21:b215a9ffd7c4 23:3a9d68ca8731
1 # 1 #
2 # Copyright (c) 1997, 20010, Oracle and/or its affiliates. All rights reserved. 2 # Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 # 4 #
5 # This code is free software; you can redistribute it and/or modify it 5 # This code is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License version 2 only, as 6 # under the terms of the GNU General Public License version 2 only, as
7 # published by the Free Software Foundation. Oracle designates this 7 # published by the Free Software Foundation. Oracle designates this
153 153
154 # Platform settings specific to Linux 154 # Platform settings specific to Linux
155 ifeq ($(SYSTEM_UNAME), Linux) 155 ifeq ($(SYSTEM_UNAME), Linux)
156 PLATFORM = linux 156 PLATFORM = linux
157 # Arch and OS name/version 157 # Arch and OS name/version
158 mach := $(shell uname -m) 158 ifdef CROSS_COMPILE_ARCH
159 mach := $(CROSS_COMPILE_ARCH)
160 else
161 mach := $(shell uname -m)
162 endif
159 archExpr = case "$(mach)" in \ 163 archExpr = case "$(mach)" in \
160 i[3-9]86) \ 164 i[3-9]86) \
161 echo i586 \ 165 echo i586 \
162 ;; \ 166 ;; \
163 ia64) \ 167 ia64) \
190 ARCH=sparc 194 ARCH=sparc
191 else 195 else
192 ARCH=sparcv9 196 ARCH=sparcv9
193 endif 197 endif
194 else 198 else
195 # i586 is 32-bit, amd64 is 64-bit 199 # Most archs are 32-bit
196 ifndef ARCH_DATA_MODEL 200 ifndef ARCH_DATA_MODEL
197 ifeq ($(ARCH), i586) 201 ARCH_DATA_MODEL=32
198 ARCH_DATA_MODEL=32 202 ifeq ($(ARCH), amd64)
199 else 203 ARCH_DATA_MODEL=64
204 endif
205 ifeq ($(ARCH), ia64)
200 ARCH_DATA_MODEL=64 206 ARCH_DATA_MODEL=64
201 endif 207 endif
202 endif 208 endif
203 endif 209 endif
204 210