comparison make/linux/makefiles/gcc.make @ 1696:688a538aa654

Merge
author trims
date Fri, 13 Aug 2010 10:55:42 -0700
parents d2ede61b7a12
children f95d63e2154a
comparison
equal deleted inserted replaced
1673:6709c14587c2 1696:688a538aa654
1 # 1 #
2 # Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. 2 # Copyright (c) 1999, 2010, 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. 7 # published by the Free Software Foundation.
23 # 23 #
24 24
25 #------------------------------------------------------------------------ 25 #------------------------------------------------------------------------
26 # CC, CPP & AS 26 # CC, CPP & AS
27 27
28 ifdef ALT_COMPILER_PATH
29 CPP = $(ALT_COMPILER_PATH)/g++
30 CC = $(ALT_COMPILER_PATH)/gcc
31 else
28 CPP = g++ 32 CPP = g++
29 CC = gcc 33 CC = gcc
34 endif
35
30 AS = $(CC) -c 36 AS = $(CC) -c
31 37
32 # -dumpversion in gcc-2.91 shows "egcs-2.91.66". In later version, it only 38 # -dumpversion in gcc-2.91 shows "egcs-2.91.66". In later version, it only
33 # prints the numbers (e.g. "2.95", "3.2.1") 39 # prints the numbers (e.g. "2.95", "3.2.1")
34 CC_VER_MAJOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f1) 40 CC_VER_MAJOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f1)
52 VM_PICFLAG/AOUT = 58 VM_PICFLAG/AOUT =
53 VM_PICFLAG = $(VM_PICFLAG/$(LINK_INTO)) 59 VM_PICFLAG = $(VM_PICFLAG/$(LINK_INTO))
54 60
55 ifeq ($(ZERO_BUILD), true) 61 ifeq ($(ZERO_BUILD), true)
56 CFLAGS += $(LIBFFI_CFLAGS) 62 CFLAGS += $(LIBFFI_CFLAGS)
63 endif
64 ifeq ($(SHARK_BUILD), true)
65 CFLAGS += $(LLVM_CFLAGS)
57 endif 66 endif
58 CFLAGS += $(VM_PICFLAG) 67 CFLAGS += $(VM_PICFLAG)
59 CFLAGS += -fno-rtti 68 CFLAGS += -fno-rtti
60 CFLAGS += -fno-exceptions 69 CFLAGS += -fno-exceptions
61 CFLAGS += -D_REENTRANT 70 CFLAGS += -D_REENTRANT
65 ARCHFLAG/i486 = -m32 -march=i586 74 ARCHFLAG/i486 = -m32 -march=i586
66 ARCHFLAG/amd64 = -m64 75 ARCHFLAG/amd64 = -m64
67 ARCHFLAG/ia64 = 76 ARCHFLAG/ia64 =
68 ARCHFLAG/sparc = -m32 -mcpu=v9 77 ARCHFLAG/sparc = -m32 -mcpu=v9
69 ARCHFLAG/sparcv9 = -m64 -mcpu=v9 78 ARCHFLAG/sparcv9 = -m64 -mcpu=v9
79 ARCHFLAG/arm = -fsigned-char
70 ARCHFLAG/zero = $(ZERO_ARCHFLAG) 80 ARCHFLAG/zero = $(ZERO_ARCHFLAG)
81 ifndef E500V2
82 ARCHFLAG/ppc = -mcpu=powerpc
83 endif
71 84
72 CFLAGS += $(ARCHFLAG) 85 CFLAGS += $(ARCHFLAG)
73 AOUT_FLAGS += $(ARCHFLAG) 86 AOUT_FLAGS += $(ARCHFLAG)
74 LFLAGS += $(ARCHFLAG) 87 LFLAGS += $(ARCHFLAG)
75 ASFLAGS += $(ARCHFLAG) 88 ASFLAGS += $(ARCHFLAG)
76 89
90 ifdef E500V2
91 CFLAGS += -DE500V2
92 endif
93
77 # Use C++ Interpreter 94 # Use C++ Interpreter
78 ifdef CC_INTERP 95 ifdef CC_INTERP
79 CFLAGS += -DCC_INTERP 96 CFLAGS += -DCC_INTERP
97 endif
98
99 # Build for embedded targets
100 ifdef JAVASE_EMBEDDED
101 CFLAGS += -DJAVASE_EMBEDDED
80 endif 102 endif
81 103
82 # Keep temporary files (.ii, .s) 104 # Keep temporary files (.ii, .s)
83 ifdef NEED_ASM 105 ifdef NEED_ASM
84 CFLAGS += -save-temps 106 CFLAGS += -save-temps
169 # Change this back to "-g" if you want the most expressive format. 191 # Change this back to "-g" if you want the most expressive format.
170 # (warning: that could easily inflate libjvm_g.so to 150M!) 192 # (warning: that could easily inflate libjvm_g.so to 150M!)
171 # Note: The Itanium gcc compiler crashes when using -gstabs. 193 # Note: The Itanium gcc compiler crashes when using -gstabs.
172 DEBUG_CFLAGS/ia64 = -g 194 DEBUG_CFLAGS/ia64 = -g
173 DEBUG_CFLAGS/amd64 = -g 195 DEBUG_CFLAGS/amd64 = -g
196 DEBUG_CFLAGS/arm = -g
197 DEBUG_CFLAGS/ppc = -g
174 DEBUG_CFLAGS += $(DEBUG_CFLAGS/$(BUILDARCH)) 198 DEBUG_CFLAGS += $(DEBUG_CFLAGS/$(BUILDARCH))
175 ifeq ($(DEBUG_CFLAGS/$(BUILDARCH)),) 199 ifeq ($(DEBUG_CFLAGS/$(BUILDARCH)),)
176 DEBUG_CFLAGS += -gstabs 200 DEBUG_CFLAGS += -gstabs
177 endif 201 endif
178 202
179 # DEBUG_BINARIES overrides everything, use full -g debug information 203 # DEBUG_BINARIES overrides everything, use full -g debug information
180 ifeq ($(DEBUG_BINARIES), true) 204 ifeq ($(DEBUG_BINARIES), true)
181 DEBUG_CFLAGS = -g 205 DEBUG_CFLAGS = -g
182 CFLAGS += $(DEBUG_CFLAGS) 206 CFLAGS += $(DEBUG_CFLAGS)
183 endif 207 endif
208
209 # If we are building HEADLESS, pass on to VM
210 # so it can set the java.awt.headless property
211 ifdef HEADLESS
212 CFLAGS += -DHEADLESS
213 endif
214
215 # We are building Embedded for a small device
216 # favor code space over speed
217 ifdef MINIMIZE_RAM_USAGE
218 CFLAGS += -DMINIMIZE_RAM_USAGE
219 endif