11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 # version 2 for more details (a copy is included in the LICENSE file that 13 # accompanied this code). 14 # 15 # You should have received a copy of the GNU General Public License version 16 # 2 along with this work; if not, write to the Free Software Foundation, 17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 # 19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 # or visit www.oracle.com if you need additional information or have any 21 # questions. 22 # 23 # 24 25 # The common definitions for hotspot bsd builds. 26 # Include the top level defs.make under make directory instead of this one. 27 # This file is included into make/defs.make. 28 29 SLASH_JAVA ?= /java 30 31 # Need PLATFORM (os-arch combo names) for jdk and hotspot, plus libarch name 32 ARCH:=$(shell uname -m) 33 PATH_SEP = : 34 ifeq ($(LP64), 1) 35 ARCH_DATA_MODEL ?= 64 36 else 37 ARCH_DATA_MODEL ?= 32 38 endif 39 40 # zero 41 ifeq ($(findstring true, $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true) 42 ifeq ($(ARCH_DATA_MODEL), 64) 43 MAKE_ARGS += LP64=1 44 endif 45 PLATFORM = bsd-zero 46 VM_PLATFORM = bsd_$(subst i386,i486,$(ZERO_LIBARCH)) 47 HS_ARCH = zero 48 ARCH = zero 49 endif 50 170 # prevents strange behaviours. For example, in a BUILD_FLAVOR != 171 # product build, the FULL_DEBUG_SYMBOLS environment variable will be 172 # 0, but the ENABLE_FULL_DEBUG_SYMBOLS make variable will be 1. If 173 # the same variable name is used, then different values can be picked 174 # up by different parts of the build. Just to be clear, we only need 175 # two variable names because the incoming option value can be 176 # overridden in some situations, e.g., a BUILD_FLAVOR != product 177 # build. 178 179 # Due to the multiple sub-make processes that occur this logic gets 180 # executed multiple times. We reduce the noise by at least checking that 181 # BUILD_FLAVOR has been set. 182 ifneq ($(BUILD_FLAVOR),) 183 ifeq ($(BUILD_FLAVOR), product) 184 FULL_DEBUG_SYMBOLS ?= 1 185 ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS) 186 else 187 # debug variants always get Full Debug Symbols (if available) 188 ENABLE_FULL_DEBUG_SYMBOLS = 1 189 endif 190 _JUNK_ := $(shell \ 191 echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)") 192 # since objcopy is optional, we set ZIP_DEBUGINFO_FILES later 193 194 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) 195 ifeq ($(OS_VENDOR), Darwin) 196 # MacOS X doesn't use OBJCOPY or STRIP_POLICY 197 OBJCOPY= 198 STRIP_POLICY= 199 ZIP_DEBUGINFO_FILES ?= 1 200 else 201 # Default OBJCOPY comes from GNU Binutils on BSD 202 ifeq ($(CROSS_COMPILE_ARCH),) 203 DEF_OBJCOPY=/usr/bin/objcopy 204 else 205 # Assume objcopy is part of the cross-compilation toolset 206 ifneq ($(ALT_COMPILER_PATH),) 207 DEF_OBJCOPY=$(ALT_COMPILER_PATH)/objcopy 208 endif 209 endif 210 OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY)) 211 ifneq ($(ALT_OBJCOPY),) 212 _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)") 213 OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY)) 214 endif 215 216 ifeq ($(OBJCOPY),) 217 _JUNK_ := $(shell \ 218 echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo" \ 219 "files. You may need to set ALT_OBJCOPY.") 220 ENABLE_FULL_DEBUG_SYMBOLS=0 221 _JUNK_ := $(shell \ 222 echo >&2 "INFO:" \ 223 "ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)") 224 else 225 _JUNK_ := $(shell \ 226 echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo" \ 227 "files.") 228 229 # Library stripping policies for .debuginfo configs: 230 # all_strip - strips everything from the library 231 # min_strip - strips most stuff from the library; leaves 232 # minimum symbols 233 # no_strip - does not strip the library at all 234 # 235 # Oracle security policy requires "all_strip". A waiver was 236 # granted on 2011.09.01 that permits using "min_strip" in the 237 # Java JDK and Java JRE. 238 # 239 # Currently, STRIP_POLICY is only used when Full Debug Symbols 240 # is enabled. 241 # 242 STRIP_POLICY ?= min_strip 243 244 _JUNK_ := $(shell \ 245 echo >&2 "INFO: STRIP_POLICY=$(STRIP_POLICY)") 246 247 ZIP_DEBUGINFO_FILES ?= 1 248 endif 249 250 _JUNK_ := $(shell \ 251 echo >&2 "INFO: ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES)") 252 endif 253 endif # ENABLE_FULL_DEBUG_SYMBOLS=1 254 endif # BUILD_FLAVOR 255 endif # JDK_6_OR_EARLIER 256 257 JDK_INCLUDE_SUBDIR=bsd 258 259 # Library suffix 260 ifeq ($(OS_VENDOR),Darwin) 261 LIBRARY_SUFFIX=dylib 262 else 263 LIBRARY_SUFFIX=so 264 endif 265 266 EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html 267 268 # client and server subdirectories have symbolic links to ../libjsig.so 269 EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX) 270 271 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) | 11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 # version 2 for more details (a copy is included in the LICENSE file that 13 # accompanied this code). 14 # 15 # You should have received a copy of the GNU General Public License version 16 # 2 along with this work; if not, write to the Free Software Foundation, 17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 # 19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 # or visit www.oracle.com if you need additional information or have any 21 # questions. 22 # 23 # 24 25 # The common definitions for hotspot bsd builds. 26 # Include the top level defs.make under make directory instead of this one. 27 # This file is included into make/defs.make. 28 29 SLASH_JAVA ?= /java 30 31 define print_info 32 ifneq ($$(LOG_LEVEL), warn) 33 $$(shell echo >&2 "INFO: $1") 34 endif 35 endef 36 37 # Need PLATFORM (os-arch combo names) for jdk and hotspot, plus libarch name 38 ARCH:=$(shell uname -m) 39 PATH_SEP = : 40 ifeq ($(LP64), 1) 41 ARCH_DATA_MODEL ?= 64 42 else 43 ARCH_DATA_MODEL ?= 32 44 endif 45 46 # zero 47 ifeq ($(findstring true, $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true) 48 ifeq ($(ARCH_DATA_MODEL), 64) 49 MAKE_ARGS += LP64=1 50 endif 51 PLATFORM = bsd-zero 52 VM_PLATFORM = bsd_$(subst i386,i486,$(ZERO_LIBARCH)) 53 HS_ARCH = zero 54 ARCH = zero 55 endif 56 176 # prevents strange behaviours. For example, in a BUILD_FLAVOR != 177 # product build, the FULL_DEBUG_SYMBOLS environment variable will be 178 # 0, but the ENABLE_FULL_DEBUG_SYMBOLS make variable will be 1. If 179 # the same variable name is used, then different values can be picked 180 # up by different parts of the build. Just to be clear, we only need 181 # two variable names because the incoming option value can be 182 # overridden in some situations, e.g., a BUILD_FLAVOR != product 183 # build. 184 185 # Due to the multiple sub-make processes that occur this logic gets 186 # executed multiple times. We reduce the noise by at least checking that 187 # BUILD_FLAVOR has been set. 188 ifneq ($(BUILD_FLAVOR),) 189 ifeq ($(BUILD_FLAVOR), product) 190 FULL_DEBUG_SYMBOLS ?= 1 191 ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS) 192 else 193 # debug variants always get Full Debug Symbols (if available) 194 ENABLE_FULL_DEBUG_SYMBOLS = 1 195 endif 196 $(eval $(call print_info, "ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")) 197 # since objcopy is optional, we set ZIP_DEBUGINFO_FILES later 198 199 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) 200 ifeq ($(OS_VENDOR), Darwin) 201 # MacOS X doesn't use OBJCOPY or STRIP_POLICY 202 OBJCOPY= 203 STRIP_POLICY= 204 ZIP_DEBUGINFO_FILES ?= 1 205 else 206 # Default OBJCOPY comes from GNU Binutils on BSD 207 ifeq ($(CROSS_COMPILE_ARCH),) 208 DEF_OBJCOPY=/usr/bin/objcopy 209 else 210 # Assume objcopy is part of the cross-compilation toolset 211 ifneq ($(ALT_COMPILER_PATH),) 212 DEF_OBJCOPY=$(ALT_COMPILER_PATH)/objcopy 213 endif 214 endif 215 OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY)) 216 ifneq ($(ALT_OBJCOPY),) 217 $(eval $(call print_info, "ALT_OBJCOPY=$(ALT_OBJCOPY)")) 218 OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY)) 219 endif 220 221 ifeq ($(OBJCOPY),) 222 $(eval $(call print_info, "no objcopy cmd found so cannot create .debuginfo" \ 223 "files. You may need to set ALT_OBJCOPY.")) 224 ENABLE_FULL_DEBUG_SYMBOLS=0 225 $(eval $(call print_info, "ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")) 226 else 227 $(eval $(call print_info, "$(OBJCOPY) cmd found so will create .debuginfo" \ 228 "files.")) 229 230 # Library stripping policies for .debuginfo configs: 231 # all_strip - strips everything from the library 232 # min_strip - strips most stuff from the library; leaves 233 # minimum symbols 234 # no_strip - does not strip the library at all 235 # 236 # Oracle security policy requires "all_strip". A waiver was 237 # granted on 2011.09.01 that permits using "min_strip" in the 238 # Java JDK and Java JRE. 239 # 240 # Currently, STRIP_POLICY is only used when Full Debug Symbols 241 # is enabled. 242 # 243 STRIP_POLICY ?= min_strip 244 245 $(eval $(call print_info, "STRIP_POLICY=$(STRIP_POLICY)")) 246 247 ZIP_DEBUGINFO_FILES ?= 1 248 endif 249 250 $(eval $(call print_info, "ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES)")) 251 endif 252 endif # ENABLE_FULL_DEBUG_SYMBOLS=1 253 endif # BUILD_FLAVOR 254 endif # JDK_6_OR_EARLIER 255 256 JDK_INCLUDE_SUBDIR=bsd 257 258 # Library suffix 259 ifeq ($(OS_VENDOR),Darwin) 260 LIBRARY_SUFFIX=dylib 261 else 262 LIBRARY_SUFFIX=so 263 endif 264 265 EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html 266 267 # client and server subdirectories have symbolic links to ../libjsig.so 268 EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX) 269 270 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |