82 CC_NO_OPT =
83
84 ifeq ($(PRODUCT), java)
85 _OPT = $(CC_HIGHER_OPT)
86 else
87 _OPT = $(CC_LOWER_OPT)
88 CPPFLAGS_DBG += -DLOGGING
89 endif
90
91 # For all platforms, do not omit the frame pointer register usage.
92 # We need this frame pointer to make it easy to walk the stacks.
93 # This should be the default on X86, but ia64 and amd64 may not have this
94 # as the default.
95 CFLAGS_REQUIRED_amd64 += -fno-omit-frame-pointer -D_LITTLE_ENDIAN
96 CFLAGS_REQUIRED_i586 += -fno-omit-frame-pointer -D_LITTLE_ENDIAN
97 CFLAGS_REQUIRED_ia64 += -fno-omit-frame-pointer -D_LITTLE_ENDIAN
98 CFLAGS_REQUIRED_sparcv9 += -m64 -mcpu=v9
99 LDFLAGS_COMMON_sparcv9 += -m64 -mcpu=v9
100 CFLAGS_REQUIRED_sparc += -m32 -mcpu=v9
101 LDFLAGS_COMMON_sparc += -m32 -mcpu=v9
102 CFLAGS_REQUIRED = $(CFLAGS_REQUIRED_$(ARCH))
103 LDFLAGS_COMMON += $(LDFLAGS_COMMON_$(ARCH))
104
105 # Add in platform specific optimizations for all opt levels
106 CC_HIGHEST_OPT += $(_OPT_$(ARCH))
107 CC_HIGHER_OPT += $(_OPT_$(ARCH))
108 CC_LOWER_OPT += $(_OPT_$(ARCH))
109
110 # If NO_OPTIMIZATIONS is defined in the environment, turn all optimzations off
111 ifdef NO_OPTIMIZATIONS
112 CC_HIGHEST_OPT = $(CC_NO_OPT)
113 CC_HIGHER_OPT = $(CC_NO_OPT)
114 CC_LOWER_OPT = $(CC_NO_OPT)
115 endif
116
117 #
118 # Selection of warning messages
119 #
120 GCC_INHIBIT = -Wno-unused -Wno-parentheses
121 GCC_STYLE =
122 GCC_WARNINGS = -W -Wall $(GCC_STYLE) $(GCC_INHIBIT)
123
179 CPPFLAGS_DBG = -DDEBUG
180
181 ifdef LIBRARY
182 # Libraries need to locate other libraries at runtime, and you can tell
183 # a library where to look by way of the dynamic runpaths (RPATH or RUNPATH)
184 # buried inside the .so. The $ORIGIN says to look relative to where
185 # the library itself is and it can be followed with relative paths from
186 # that. By default we always look in $ORIGIN, optionally we add relative
187 # paths if the Makefile sets LD_RUNPATH_EXTRAS to those relative paths.
188 # On Linux we add a flag -z origin, not sure if this is necessary, but
189 # doesn't seem to hurt.
190 # The environment variable LD_LIBRARY_PATH will over-ride these runpaths.
191 # Try: 'readelf -d lib*.so' to see these settings in a library.
192 #
193 LDFLAGS_COMMON += -Xlinker -z -Xlinker origin -Xlinker -rpath -Xlinker \$$ORIGIN
194 LDFLAGS_COMMON += $(LD_RUNPATH_EXTRAS:%=-Xlinker -z -Xlinker origin -Xlinker -rpath -Xlinker \$$ORIGIN/%)
195 endif
196
197 EXTRA_LIBS += -lc
198
199 LDFLAGS_DEFS_OPTION = -z defs
200 LDFLAGS_COMMON += $(LDFLAGS_DEFS_OPTION)
201
202 #
203 # -L paths for finding and -ljava
204 #
205 LDFLAGS_OPT = -Xlinker -O1
206 LDFLAGS_COMMON += -L$(LIBDIR)/$(LIBARCH)
207 LDFLAGS_COMMON += -Wl,-soname=$(LIB_PREFIX)$(LIBRARY).$(LIBRARY_SUFFIX)
208
209 #
210 # -static-libgcc is a gcc-3 flag to statically link libgcc, gcc-2.9x always
211 # statically link libgcc but will print a warning with the flag. We don't
212 # want the warning, so check gcc version first.
213 #
214 CC_VER_MAJOR := $(shell $(CC) -dumpversion | $(SED) 's/egcs-//' | $(CUT) -d'.' -f1)
215 ifeq ("$(CC_VER_MAJOR)", "3")
216 OTHER_LDFLAGS += -static-libgcc
217 endif
218
219 # Automatic precompiled header option to use (if COMPILE_APPROACH=batch)
|
82 CC_NO_OPT =
83
84 ifeq ($(PRODUCT), java)
85 _OPT = $(CC_HIGHER_OPT)
86 else
87 _OPT = $(CC_LOWER_OPT)
88 CPPFLAGS_DBG += -DLOGGING
89 endif
90
91 # For all platforms, do not omit the frame pointer register usage.
92 # We need this frame pointer to make it easy to walk the stacks.
93 # This should be the default on X86, but ia64 and amd64 may not have this
94 # as the default.
95 CFLAGS_REQUIRED_amd64 += -fno-omit-frame-pointer -D_LITTLE_ENDIAN
96 CFLAGS_REQUIRED_i586 += -fno-omit-frame-pointer -D_LITTLE_ENDIAN
97 CFLAGS_REQUIRED_ia64 += -fno-omit-frame-pointer -D_LITTLE_ENDIAN
98 CFLAGS_REQUIRED_sparcv9 += -m64 -mcpu=v9
99 LDFLAGS_COMMON_sparcv9 += -m64 -mcpu=v9
100 CFLAGS_REQUIRED_sparc += -m32 -mcpu=v9
101 LDFLAGS_COMMON_sparc += -m32 -mcpu=v9
102 ifeq ($(ZERO_BUILD), true)
103 CFLAGS_REQUIRED = $(ZERO_ARCHFLAG)
104 ifeq ($(ZERO_ENDIANNESS), little)
105 CFLAGS_REQUIRED += -D_LITTLE_ENDIAN
106 endif
107 LDFLAGS_COMMON += $(ZERO_ARCHFLAG)
108 else
109 CFLAGS_REQUIRED = $(CFLAGS_REQUIRED_$(ARCH))
110 LDFLAGS_COMMON += $(LDFLAGS_COMMON_$(ARCH))
111 endif
112
113 # Add in platform specific optimizations for all opt levels
114 CC_HIGHEST_OPT += $(_OPT_$(ARCH))
115 CC_HIGHER_OPT += $(_OPT_$(ARCH))
116 CC_LOWER_OPT += $(_OPT_$(ARCH))
117
118 # If NO_OPTIMIZATIONS is defined in the environment, turn all optimzations off
119 ifdef NO_OPTIMIZATIONS
120 CC_HIGHEST_OPT = $(CC_NO_OPT)
121 CC_HIGHER_OPT = $(CC_NO_OPT)
122 CC_LOWER_OPT = $(CC_NO_OPT)
123 endif
124
125 #
126 # Selection of warning messages
127 #
128 GCC_INHIBIT = -Wno-unused -Wno-parentheses
129 GCC_STYLE =
130 GCC_WARNINGS = -W -Wall $(GCC_STYLE) $(GCC_INHIBIT)
131
187 CPPFLAGS_DBG = -DDEBUG
188
189 ifdef LIBRARY
190 # Libraries need to locate other libraries at runtime, and you can tell
191 # a library where to look by way of the dynamic runpaths (RPATH or RUNPATH)
192 # buried inside the .so. The $ORIGIN says to look relative to where
193 # the library itself is and it can be followed with relative paths from
194 # that. By default we always look in $ORIGIN, optionally we add relative
195 # paths if the Makefile sets LD_RUNPATH_EXTRAS to those relative paths.
196 # On Linux we add a flag -z origin, not sure if this is necessary, but
197 # doesn't seem to hurt.
198 # The environment variable LD_LIBRARY_PATH will over-ride these runpaths.
199 # Try: 'readelf -d lib*.so' to see these settings in a library.
200 #
201 LDFLAGS_COMMON += -Xlinker -z -Xlinker origin -Xlinker -rpath -Xlinker \$$ORIGIN
202 LDFLAGS_COMMON += $(LD_RUNPATH_EXTRAS:%=-Xlinker -z -Xlinker origin -Xlinker -rpath -Xlinker \$$ORIGIN/%)
203 endif
204
205 EXTRA_LIBS += -lc
206
207 LDFLAGS_DEFS_OPTION = -Xlinker -z -Xlinker defs
208 LDFLAGS_COMMON += $(LDFLAGS_DEFS_OPTION)
209
210 #
211 # -L paths for finding and -ljava
212 #
213 LDFLAGS_OPT = -Xlinker -O1
214 LDFLAGS_COMMON += -L$(LIBDIR)/$(LIBARCH)
215 LDFLAGS_COMMON += -Wl,-soname=$(LIB_PREFIX)$(LIBRARY).$(LIBRARY_SUFFIX)
216
217 #
218 # -static-libgcc is a gcc-3 flag to statically link libgcc, gcc-2.9x always
219 # statically link libgcc but will print a warning with the flag. We don't
220 # want the warning, so check gcc version first.
221 #
222 CC_VER_MAJOR := $(shell $(CC) -dumpversion | $(SED) 's/egcs-//' | $(CUT) -d'.' -f1)
223 ifeq ("$(CC_VER_MAJOR)", "3")
224 OTHER_LDFLAGS += -static-libgcc
225 endif
226
227 # Automatic precompiled header option to use (if COMPILE_APPROACH=batch)
|