1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/make/bsd/makefiles/defs.make Wed Apr 27 01:25:04 2016 +0800 1.3 @@ -0,0 +1,415 @@ 1.4 +# 1.5 +# Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. 1.6 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.7 +# 1.8 +# This code is free software; you can redistribute it and/or modify it 1.9 +# under the terms of the GNU General Public License version 2 only, as 1.10 +# published by the Free Software Foundation. 1.11 +# 1.12 +# This code is distributed in the hope that it will be useful, but WITHOUT 1.13 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.14 +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.15 +# version 2 for more details (a copy is included in the LICENSE file that 1.16 +# accompanied this code). 1.17 +# 1.18 +# You should have received a copy of the GNU General Public License version 1.19 +# 2 along with this work; if not, write to the Free Software Foundation, 1.20 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.21 +# 1.22 +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 1.23 +# or visit www.oracle.com if you need additional information or have any 1.24 +# questions. 1.25 +# 1.26 +# 1.27 + 1.28 +# The common definitions for hotspot bsd builds. 1.29 +# Include the top level defs.make under make directory instead of this one. 1.30 +# This file is included into make/defs.make. 1.31 + 1.32 +SLASH_JAVA ?= /java 1.33 + 1.34 +# Need PLATFORM (os-arch combo names) for jdk and hotspot, plus libarch name 1.35 +ARCH:=$(shell uname -m) 1.36 +PATH_SEP = : 1.37 +ifeq ($(LP64), 1) 1.38 + ARCH_DATA_MODEL ?= 64 1.39 +else 1.40 + ARCH_DATA_MODEL ?= 32 1.41 +endif 1.42 + 1.43 +# zero 1.44 +ifeq ($(findstring true, $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true) 1.45 + ifeq ($(ARCH_DATA_MODEL), 64) 1.46 + MAKE_ARGS += LP64=1 1.47 + endif 1.48 + PLATFORM = bsd-zero 1.49 + VM_PLATFORM = bsd_$(subst i386,i486,$(ZERO_LIBARCH)) 1.50 + HS_ARCH = zero 1.51 + ARCH = zero 1.52 +endif 1.53 + 1.54 +# ia64 1.55 +ifeq ($(ARCH), ia64) 1.56 + ARCH_DATA_MODEL = 64 1.57 + MAKE_ARGS += LP64=1 1.58 + PLATFORM = bsd-ia64 1.59 + VM_PLATFORM = bsd_ia64 1.60 + HS_ARCH = ia64 1.61 +endif 1.62 + 1.63 +# sparc 1.64 +ifeq ($(ARCH), sparc64) 1.65 + ifeq ($(ARCH_DATA_MODEL), 64) 1.66 + ARCH_DATA_MODEL = 64 1.67 + MAKE_ARGS += LP64=1 1.68 + PLATFORM = bsd-sparcv9 1.69 + VM_PLATFORM = bsd_sparcv9 1.70 + else 1.71 + ARCH_DATA_MODEL = 32 1.72 + PLATFORM = bsd-sparc 1.73 + VM_PLATFORM = bsd_sparc 1.74 + endif 1.75 + HS_ARCH = sparc 1.76 +endif 1.77 + 1.78 +# amd64 1.79 +ifneq (,$(findstring $(ARCH), amd64 x86_64)) 1.80 + ifeq ($(ARCH_DATA_MODEL), 64) 1.81 + ARCH_DATA_MODEL = 64 1.82 + MAKE_ARGS += LP64=1 1.83 + PLATFORM = bsd-amd64 1.84 + VM_PLATFORM = bsd_amd64 1.85 + HS_ARCH = x86 1.86 + else 1.87 + ARCH_DATA_MODEL = 32 1.88 + PLATFORM = bsd-i586 1.89 + VM_PLATFORM = bsd_i486 1.90 + HS_ARCH = x86 1.91 + # We have to reset ARCH to i386 since SRCARCH relies on it 1.92 + ARCH = i386 1.93 + endif 1.94 +endif 1.95 + 1.96 +# i386 1.97 +ifeq ($(ARCH), i386) 1.98 + ifeq ($(ARCH_DATA_MODEL), 64) 1.99 + ARCH_DATA_MODEL = 64 1.100 + MAKE_ARGS += LP64=1 1.101 + PLATFORM = bsd-amd64 1.102 + VM_PLATFORM = bsd_amd64 1.103 + HS_ARCH = x86 1.104 + # We have to reset ARCH to amd64 since SRCARCH relies on it 1.105 + ARCH = amd64 1.106 + else 1.107 + ARCH_DATA_MODEL = 32 1.108 + PLATFORM = bsd-i586 1.109 + VM_PLATFORM = bsd_i486 1.110 + HS_ARCH = x86 1.111 + endif 1.112 +endif 1.113 + 1.114 +# ARM 1.115 +ifeq ($(ARCH), arm) 1.116 + ARCH_DATA_MODEL = 32 1.117 + PLATFORM = bsd-arm 1.118 + VM_PLATFORM = bsd_arm 1.119 + HS_ARCH = arm 1.120 +endif 1.121 + 1.122 +# PPC 1.123 +ifeq ($(ARCH), ppc) 1.124 + ARCH_DATA_MODEL = 32 1.125 + PLATFORM = bsd-ppc 1.126 + VM_PLATFORM = bsd_ppc 1.127 + HS_ARCH = ppc 1.128 +endif 1.129 + 1.130 +# On 32 bit bsd we build server and client, on 64 bit just server. 1.131 +ifeq ($(JVM_VARIANTS),) 1.132 + ifeq ($(ARCH_DATA_MODEL), 32) 1.133 + JVM_VARIANTS:=client,server 1.134 + JVM_VARIANT_CLIENT:=true 1.135 + JVM_VARIANT_SERVER:=true 1.136 + else 1.137 + JVM_VARIANTS:=server 1.138 + JVM_VARIANT_SERVER:=true 1.139 + endif 1.140 +endif 1.141 + 1.142 +OS_VENDOR:=$(shell uname -s) 1.143 + 1.144 +# determine if HotSpot is being built in JDK6 or earlier version 1.145 +JDK6_OR_EARLIER=0 1.146 +ifeq "$(shell expr \( '$(JDK_MAJOR_VERSION)' != '' \& '$(JDK_MINOR_VERSION)' != '' \& '$(JDK_MICRO_VERSION)' != '' \))" "1" 1.147 + # if the longer variable names (newer build style) are set, then check those 1.148 + ifeq "$(shell expr \( $(JDK_MAJOR_VERSION) = 1 \& $(JDK_MINOR_VERSION) \< 7 \))" "1" 1.149 + JDK6_OR_EARLIER=1 1.150 + endif 1.151 +else 1.152 + # the longer variables aren't set so check the shorter variable names 1.153 + ifeq "$(shell expr \( '$(JDK_MAJOR_VER)' = 1 \& '$(JDK_MINOR_VER)' \< 7 \))" "1" 1.154 + JDK6_OR_EARLIER=1 1.155 + endif 1.156 +endif 1.157 + 1.158 +ifeq ($(JDK6_OR_EARLIER),0) 1.159 + # Full Debug Symbols is supported on JDK7 or newer. 1.160 + # The Full Debug Symbols (FDS) default for BUILD_FLAVOR == product 1.161 + # builds is enabled with debug info files ZIP'ed to save space. For 1.162 + # BUILD_FLAVOR != product builds, FDS is always enabled, after all a 1.163 + # debug build without debug info isn't very useful. 1.164 + # The ZIP_DEBUGINFO_FILES option only has meaning when FDS is enabled. 1.165 + # 1.166 + # If you invoke a build with FULL_DEBUG_SYMBOLS=0, then FDS will be 1.167 + # disabled for a BUILD_FLAVOR == product build. 1.168 + # 1.169 + # Note: Use of a different variable name for the FDS override option 1.170 + # versus the FDS enabled check is intentional (FULL_DEBUG_SYMBOLS 1.171 + # versus ENABLE_FULL_DEBUG_SYMBOLS). For auto build systems that pass 1.172 + # in options via environment variables, use of distinct variables 1.173 + # prevents strange behaviours. For example, in a BUILD_FLAVOR != 1.174 + # product build, the FULL_DEBUG_SYMBOLS environment variable will be 1.175 + # 0, but the ENABLE_FULL_DEBUG_SYMBOLS make variable will be 1. If 1.176 + # the same variable name is used, then different values can be picked 1.177 + # up by different parts of the build. Just to be clear, we only need 1.178 + # two variable names because the incoming option value can be 1.179 + # overridden in some situations, e.g., a BUILD_FLAVOR != product 1.180 + # build. 1.181 + 1.182 + # Due to the multiple sub-make processes that occur this logic gets 1.183 + # executed multiple times. We reduce the noise by at least checking that 1.184 + # BUILD_FLAVOR has been set. 1.185 + ifneq ($(BUILD_FLAVOR),) 1.186 + ifeq ($(BUILD_FLAVOR), product) 1.187 + FULL_DEBUG_SYMBOLS ?= 1 1.188 + ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS) 1.189 + else 1.190 + # debug variants always get Full Debug Symbols (if available) 1.191 + ENABLE_FULL_DEBUG_SYMBOLS = 1 1.192 + endif 1.193 + _JUNK_ := $(shell \ 1.194 + echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)") 1.195 + # since objcopy is optional, we set ZIP_DEBUGINFO_FILES later 1.196 + 1.197 + ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) 1.198 + ifeq ($(OS_VENDOR), Darwin) 1.199 + # MacOS X doesn't use OBJCOPY or STRIP_POLICY 1.200 + OBJCOPY= 1.201 + STRIP_POLICY= 1.202 + ZIP_DEBUGINFO_FILES ?= 1 1.203 + else 1.204 + # Default OBJCOPY comes from GNU Binutils on BSD 1.205 + ifeq ($(CROSS_COMPILE_ARCH),) 1.206 + DEF_OBJCOPY=/usr/bin/objcopy 1.207 + else 1.208 + # Assume objcopy is part of the cross-compilation toolset 1.209 + ifneq ($(ALT_COMPILER_PATH),) 1.210 + DEF_OBJCOPY=$(ALT_COMPILER_PATH)/objcopy 1.211 + endif 1.212 + endif 1.213 + OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY)) 1.214 + ifneq ($(ALT_OBJCOPY),) 1.215 + _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)") 1.216 + OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY)) 1.217 + endif 1.218 + 1.219 + ifeq ($(OBJCOPY),) 1.220 + _JUNK_ := $(shell \ 1.221 + echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo" \ 1.222 + "files. You may need to set ALT_OBJCOPY.") 1.223 + ENABLE_FULL_DEBUG_SYMBOLS=0 1.224 + _JUNK_ := $(shell \ 1.225 + echo >&2 "INFO:" \ 1.226 + "ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)") 1.227 + else 1.228 + _JUNK_ := $(shell \ 1.229 + echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo" \ 1.230 + "files.") 1.231 + 1.232 + # Library stripping policies for .debuginfo configs: 1.233 + # all_strip - strips everything from the library 1.234 + # min_strip - strips most stuff from the library; leaves 1.235 + # minimum symbols 1.236 + # no_strip - does not strip the library at all 1.237 + # 1.238 + # Oracle security policy requires "all_strip". A waiver was 1.239 + # granted on 2011.09.01 that permits using "min_strip" in the 1.240 + # Java JDK and Java JRE. 1.241 + # 1.242 + # Currently, STRIP_POLICY is only used when Full Debug Symbols 1.243 + # is enabled. 1.244 + # 1.245 + STRIP_POLICY ?= min_strip 1.246 + 1.247 + _JUNK_ := $(shell \ 1.248 + echo >&2 "INFO: STRIP_POLICY=$(STRIP_POLICY)") 1.249 + 1.250 + ZIP_DEBUGINFO_FILES ?= 1 1.251 + endif 1.252 + 1.253 + _JUNK_ := $(shell \ 1.254 + echo >&2 "INFO: ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES)") 1.255 + endif 1.256 + endif # ENABLE_FULL_DEBUG_SYMBOLS=1 1.257 + endif # BUILD_FLAVOR 1.258 +endif # JDK_6_OR_EARLIER 1.259 + 1.260 +JDK_INCLUDE_SUBDIR=bsd 1.261 + 1.262 +# Library suffix 1.263 +ifeq ($(OS_VENDOR),Darwin) 1.264 + LIBRARY_SUFFIX=dylib 1.265 +else 1.266 + LIBRARY_SUFFIX=so 1.267 +endif 1.268 + 1.269 +EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html 1.270 + 1.271 +# client and server subdirectories have symbolic links to ../libjsig.so 1.272 +EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX) 1.273 + 1.274 +ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) 1.275 + ifeq ($(ZIP_DEBUGINFO_FILES),1) 1.276 + EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.diz 1.277 + else 1.278 + ifeq ($(OS_VENDOR), Darwin) 1.279 + EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX).dSYM 1.280 + else 1.281 + EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.debuginfo 1.282 + endif 1.283 + endif 1.284 +endif 1.285 + 1.286 +EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server 1.287 +EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client 1.288 +EXPORT_MINIMAL_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/minimal 1.289 + 1.290 +ifeq ($(findstring true, $(JVM_VARIANT_SERVER) $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true) 1.291 + EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt 1.292 + EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.$(LIBRARY_SUFFIX) 1.293 + 1.294 + ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) 1.295 + ifeq ($(ZIP_DEBUGINFO_FILES),1) 1.296 + EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.diz 1.297 + else 1.298 + ifeq ($(OS_VENDOR), Darwin) 1.299 + EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.$(LIBRARY_SUFFIX).dSYM 1.300 + else 1.301 + EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.debuginfo 1.302 + endif 1.303 + endif 1.304 + endif 1.305 +endif 1.306 + 1.307 +ifeq ($(JVM_VARIANT_CLIENT),true) 1.308 + EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt 1.309 + EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.$(LIBRARY_SUFFIX) 1.310 + 1.311 + ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) 1.312 + ifeq ($(ZIP_DEBUGINFO_FILES),1) 1.313 + EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.diz 1.314 + else 1.315 + ifeq ($(OS_VENDOR), Darwin) 1.316 + EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.$(LIBRARY_SUFFIX).dSYM 1.317 + else 1.318 + EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.debuginfo 1.319 + endif 1.320 + endif 1.321 + endif 1.322 +endif 1.323 + 1.324 +ifeq ($(JVM_VARIANT_MINIMAL1),true) 1.325 + EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/Xusage.txt 1.326 + EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.$(LIBRARY_SUFFIX) 1.327 +endif 1.328 + 1.329 +# Serviceability Binaries 1.330 +# No SA Support for PPC, IA64, ARM or zero 1.331 +ADD_SA_BINARIES/x86 = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \ 1.332 + $(EXPORT_LIB_DIR)/sa-jdi.jar 1.333 + 1.334 +ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) 1.335 + ifeq ($(ZIP_DEBUGINFO_FILES),1) 1.336 + ADD_SA_BINARIES/x86 += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.diz 1.337 + else 1.338 + ifeq ($(OS_VENDOR), Darwin) 1.339 + ADD_SA_BINARIES/x86 += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX).dSYM 1.340 + else 1.341 + ADD_SA_BINARIES/x86 += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.debuginfo 1.342 + endif 1.343 + endif 1.344 +endif 1.345 + 1.346 +ADD_SA_BINARIES/sparc = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \ 1.347 + $(EXPORT_LIB_DIR)/sa-jdi.jar 1.348 +ADD_SA_BINARIES/universal = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \ 1.349 + $(EXPORT_LIB_DIR)/sa-jdi.jar 1.350 + 1.351 +ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) 1.352 + ifeq ($(ZIP_DEBUGINFO_FILES),1) 1.353 + ADD_SA_BINARIES/universal += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.diz 1.354 + else 1.355 + ifeq ($(OS_VENDOR), Darwin) 1.356 + ADD_SA_BINARIES/universal += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX).dSYM 1.357 + else 1.358 + ADD_SA_BINARIES/universal += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.debuginfo 1.359 + endif 1.360 + endif 1.361 +endif 1.362 + 1.363 +ADD_SA_BINARIES/ppc = 1.364 +ADD_SA_BINARIES/ia64 = 1.365 +ADD_SA_BINARIES/arm = 1.366 +ADD_SA_BINARIES/zero = 1.367 + 1.368 +EXPORT_LIST += $(ADD_SA_BINARIES/$(HS_ARCH)) 1.369 + 1.370 +# Universal build settings 1.371 +ifeq ($(OS_VENDOR), Darwin) 1.372 + # Build universal binaries by default on Mac OS X 1.373 + MACOSX_UNIVERSAL = true 1.374 + ifneq ($(ALT_MACOSX_UNIVERSAL),) 1.375 + MACOSX_UNIVERSAL = $(ALT_MACOSX_UNIVERSAL) 1.376 + endif 1.377 + MAKE_ARGS += MACOSX_UNIVERSAL=$(MACOSX_UNIVERSAL) 1.378 + 1.379 + # Universal settings 1.380 + ifeq ($(MACOSX_UNIVERSAL), true) 1.381 + 1.382 + # Set universal export path but avoid using ARCH or PLATFORM subdirs 1.383 + EXPORT_PATH=$(OUTPUTDIR)/export-universal$(EXPORT_SUBDIR) 1.384 + ifneq ($(ALT_EXPORT_PATH),) 1.385 + EXPORT_PATH=$(ALT_EXPORT_PATH) 1.386 + endif 1.387 + 1.388 + # Set universal image dir 1.389 + JDK_IMAGE_DIR=$(OUTPUTDIR)/jdk-universal$(EXPORT_SUBDIR) 1.390 + ifneq ($(ALT_JDK_IMAGE_DIR),) 1.391 + JDK_IMAGE_DIR=$(ALT_JDK_IMAGE_DIR) 1.392 + endif 1.393 + 1.394 + # Binaries to 'universalize' if built 1.395 + UNIVERSAL_LIPO_LIST += $(EXPORT_JRE_LIB_DIR)/libjsig.$(LIBRARY_SUFFIX) 1.396 + UNIVERSAL_LIPO_LIST += $(EXPORT_JRE_LIB_DIR)/libsaproc.$(LIBRARY_SUFFIX) 1.397 + UNIVERSAL_LIPO_LIST += $(EXPORT_JRE_LIB_DIR)/server/libjvm.$(LIBRARY_SUFFIX) 1.398 + UNIVERSAL_LIPO_LIST += $(EXPORT_JRE_LIB_DIR)/client/libjvm.$(LIBRARY_SUFFIX) 1.399 + 1.400 + # Files to simply copy in place 1.401 + UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/server/Xusage.txt 1.402 + UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/client/Xusage.txt 1.403 + ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) 1.404 + ifeq ($(ZIP_DEBUGINFO_FILES),1) 1.405 + UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/server/libjvm.diz 1.406 + UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/client/libjvm.diz 1.407 + UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/libjsig.diz 1.408 + UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/libsaproc.diz 1.409 + else 1.410 + UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/server/libjvm.$(LIBRARY_SUFFIX).dSYM 1.411 + UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/client/libjvm.$(LIBRARY_SUFFIX).dSYM 1.412 + UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/libjsig.$(LIBRARY_SUFFIX).dSYM 1.413 + UNIVERSAL_COPY_LIST += $(EXPORT_JRE_LIB_DIR)/libsaproc.$(LIBRARY_SUFFIX).dSYM 1.414 + endif 1.415 + endif 1.416 + 1.417 + endif 1.418 +endif