33 HOSTCPP = g++
34 HOSTCC = gcc
35 else
36 CPP = g++
37 CC = gcc
38 HOSTCPP = $(CPP)
39 HOSTCC = $(CC)
40 endif
41
42 AS = $(CC) -c
43
44 # -dumpversion in gcc-2.91 shows "egcs-2.91.66". In later version, it only
45 # prints the numbers (e.g. "2.95", "3.2.1")
46 CC_VER_MAJOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f1)
47 CC_VER_MINOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f2)
48
49 # check for precompiled headers support
50 ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 4 \) \))" "0"
51 # Allow the user to turn off precompiled headers from the command line.
52 ifneq ($(USE_PRECOMPILED_HEADER),0)
53 USE_PRECOMPILED_HEADER=1
54 PRECOMPILED_HEADER_DIR=.
55 PRECOMPILED_HEADER_SRC=$(GAMMADIR)/src/share/vm/precompiled/precompiled.hpp
56 PRECOMPILED_HEADER=$(PRECOMPILED_HEADER_DIR)/precompiled.hpp.gch
57 endif
58 endif
59
60
61 #------------------------------------------------------------------------
62 # Compiler flags
63
64 # position-independent code
65 PICFLAG = -fPIC
66
67 VM_PICFLAG/LIBJVM = $(PICFLAG)
68 VM_PICFLAG/AOUT =
69 VM_PICFLAG = $(VM_PICFLAG/$(LINK_INTO))
70
71 ifeq ($(ZERO_BUILD), true)
72 CFLAGS += $(LIBFFI_CFLAGS)
73 endif
148
149 # The gcc compiler segv's on ia64 when compiling bytecodeInterpreter.cpp
150 # if we use expensive-optimizations
151 ifeq ($(BUILDARCH), ia64)
152 OPT_CFLAGS += -fno-expensive-optimizations
153 endif
154
155 OPT_CFLAGS/NOOPT=-O0
156
157 # 6835796. Problem in GCC 4.3.0 with mulnode.o optimized compilation.
158 ifneq "$(shell expr \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) = 3 \) \))" "0"
159 OPT_CFLAGS/mulnode.o += -O0
160 endif
161
162 # Flags for generating make dependency flags.
163 ifneq ("${CC_VER_MAJOR}", "2")
164 DEPFLAGS = -MMD -MP -MF $(DEP_DIR)/$(@:%=%.d)
165 endif
166
167 # -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp.
168 ifneq ($(USE_PRECOMPILED_HEADER),1)
169 CFLAGS += -DDONT_USE_PRECOMPILED_HEADER
170 endif
171
172 #------------------------------------------------------------------------
173 # Linker flags
174
175 # statically link libstdc++.so, work with gcc but ignored by g++
176 STATIC_STDCXX = -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
177
178 # statically link libgcc and/or libgcc_s, libgcc does not exist before gcc-3.x.
179 ifneq ("${CC_VER_MAJOR}", "2")
180 STATIC_LIBGCC += -static-libgcc
181 endif
182
183 ifeq ($(BUILDARCH), ia64)
184 LFLAGS += -Wl,-relax
185 endif
186
187 # Enable linker optimization
188 LFLAGS += -Xlinker -O1
|
33 HOSTCPP = g++
34 HOSTCC = gcc
35 else
36 CPP = g++
37 CC = gcc
38 HOSTCPP = $(CPP)
39 HOSTCC = $(CC)
40 endif
41
42 AS = $(CC) -c
43
44 # -dumpversion in gcc-2.91 shows "egcs-2.91.66". In later version, it only
45 # prints the numbers (e.g. "2.95", "3.2.1")
46 CC_VER_MAJOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f1)
47 CC_VER_MINOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f2)
48
49 # check for precompiled headers support
50 ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 4 \) \))" "0"
51 # Allow the user to turn off precompiled headers from the command line.
52 ifneq ($(USE_PRECOMPILED_HEADER),0)
53 PRECOMPILED_HEADER_DIR=.
54 PRECOMPILED_HEADER_SRC=$(GAMMADIR)/src/share/vm/precompiled/precompiled.hpp
55 PRECOMPILED_HEADER=$(PRECOMPILED_HEADER_DIR)/precompiled.hpp.gch
56 endif
57 endif
58
59
60 #------------------------------------------------------------------------
61 # Compiler flags
62
63 # position-independent code
64 PICFLAG = -fPIC
65
66 VM_PICFLAG/LIBJVM = $(PICFLAG)
67 VM_PICFLAG/AOUT =
68 VM_PICFLAG = $(VM_PICFLAG/$(LINK_INTO))
69
70 ifeq ($(ZERO_BUILD), true)
71 CFLAGS += $(LIBFFI_CFLAGS)
72 endif
147
148 # The gcc compiler segv's on ia64 when compiling bytecodeInterpreter.cpp
149 # if we use expensive-optimizations
150 ifeq ($(BUILDARCH), ia64)
151 OPT_CFLAGS += -fno-expensive-optimizations
152 endif
153
154 OPT_CFLAGS/NOOPT=-O0
155
156 # 6835796. Problem in GCC 4.3.0 with mulnode.o optimized compilation.
157 ifneq "$(shell expr \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) = 3 \) \))" "0"
158 OPT_CFLAGS/mulnode.o += -O0
159 endif
160
161 # Flags for generating make dependency flags.
162 ifneq ("${CC_VER_MAJOR}", "2")
163 DEPFLAGS = -MMD -MP -MF $(DEP_DIR)/$(@:%=%.d)
164 endif
165
166 # -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp.
167 ifeq ($(USE_PRECOMPILED_HEADER),0)
168 CFLAGS += -DDONT_USE_PRECOMPILED_HEADER
169 endif
170
171 #------------------------------------------------------------------------
172 # Linker flags
173
174 # statically link libstdc++.so, work with gcc but ignored by g++
175 STATIC_STDCXX = -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
176
177 # statically link libgcc and/or libgcc_s, libgcc does not exist before gcc-3.x.
178 ifneq ("${CC_VER_MAJOR}", "2")
179 STATIC_LIBGCC += -static-libgcc
180 endif
181
182 ifeq ($(BUILDARCH), ia64)
183 LFLAGS += -Wl,-relax
184 endif
185
186 # Enable linker optimization
187 LFLAGS += -Xlinker -O1
|