make/linux/makefiles/defs.make

Tue, 24 Apr 2012 15:20:40 -0700

author
dcubed
date
Tue, 24 Apr 2012 15:20:40 -0700
changeset 3726
74c359c4a9e5
parent 3649
3d7ea1dbe0de
parent 3725
744728c16316
child 4028
a9fed06c01d2
permissions
-rw-r--r--

Merge

duke@435 1 #
dcubed@3724 2 # Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
duke@435 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@435 4 #
duke@435 5 # This code is free software; you can redistribute it and/or modify it
duke@435 6 # under the terms of the GNU General Public License version 2 only, as
duke@435 7 # published by the Free Software Foundation.
duke@435 8 #
duke@435 9 # This code is distributed in the hope that it will be useful, but WITHOUT
duke@435 10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@435 11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@435 12 # version 2 for more details (a copy is included in the LICENSE file that
duke@435 13 # accompanied this code).
duke@435 14 #
duke@435 15 # You should have received a copy of the GNU General Public License version
duke@435 16 # 2 along with this work; if not, write to the Free Software Foundation,
duke@435 17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@435 18 #
trims@1907 19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@1907 20 # or visit www.oracle.com if you need additional information or have any
trims@1907 21 # questions.
duke@435 22 #
duke@435 23 #
duke@435 24
duke@435 25 # The common definitions for hotspot linux builds.
duke@435 26 # Include the top level defs.make under make directory instead of this one.
duke@435 27 # This file is included into make/defs.make.
duke@435 28
duke@435 29 SLASH_JAVA ?= /java
duke@435 30
duke@435 31 # Need PLATFORM (os-arch combo names) for jdk and hotspot, plus libarch name
duke@435 32 ARCH:=$(shell uname -m)
duke@435 33 PATH_SEP = :
duke@435 34 ifeq ($(LP64), 1)
duke@435 35 ARCH_DATA_MODEL ?= 64
duke@435 36 else
duke@435 37 ARCH_DATA_MODEL ?= 32
duke@435 38 endif
duke@435 39
never@1445 40 # zero
erikj@3649 41 ifeq ($(findstring true, $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true)
never@1445 42 ifeq ($(ARCH_DATA_MODEL), 64)
never@1445 43 MAKE_ARGS += LP64=1
never@1445 44 endif
never@1445 45 PLATFORM = linux-zero
never@1445 46 VM_PLATFORM = linux_$(subst i386,i486,$(ZERO_LIBARCH))
never@1445 47 HS_ARCH = zero
never@1445 48 ARCH = zero
never@1445 49 endif
never@1445 50
duke@435 51 # ia64
duke@435 52 ifeq ($(ARCH), ia64)
duke@435 53 ARCH_DATA_MODEL = 64
duke@435 54 MAKE_ARGS += LP64=1
duke@435 55 PLATFORM = linux-ia64
duke@435 56 VM_PLATFORM = linux_ia64
duke@435 57 HS_ARCH = ia64
duke@435 58 endif
duke@435 59
duke@435 60 # sparc
duke@435 61 ifeq ($(ARCH), sparc64)
duke@435 62 ifeq ($(ARCH_DATA_MODEL), 64)
duke@435 63 ARCH_DATA_MODEL = 64
duke@435 64 MAKE_ARGS += LP64=1
duke@435 65 PLATFORM = linux-sparcv9
duke@435 66 VM_PLATFORM = linux_sparcv9
duke@435 67 else
duke@435 68 ARCH_DATA_MODEL = 32
duke@435 69 PLATFORM = linux-sparc
duke@435 70 VM_PLATFORM = linux_sparc
duke@435 71 endif
duke@435 72 HS_ARCH = sparc
duke@435 73 endif
duke@435 74
duke@435 75 # x86_64
duke@435 76 ifeq ($(ARCH), x86_64)
duke@435 77 ifeq ($(ARCH_DATA_MODEL), 64)
duke@435 78 ARCH_DATA_MODEL = 64
duke@435 79 MAKE_ARGS += LP64=1
duke@435 80 PLATFORM = linux-amd64
duke@435 81 VM_PLATFORM = linux_amd64
duke@435 82 HS_ARCH = x86
duke@435 83 else
duke@435 84 ARCH_DATA_MODEL = 32
duke@435 85 PLATFORM = linux-i586
duke@435 86 VM_PLATFORM = linux_i486
duke@435 87 HS_ARCH = x86
duke@435 88 # We have to reset ARCH to i686 since SRCARCH relies on it
duke@435 89 ARCH = i686
duke@435 90 endif
duke@435 91 endif
duke@435 92
duke@435 93 # i686
duke@435 94 ifeq ($(ARCH), i686)
duke@435 95 ARCH_DATA_MODEL = 32
duke@435 96 PLATFORM = linux-i586
duke@435 97 VM_PLATFORM = linux_i486
duke@435 98 HS_ARCH = x86
duke@435 99 endif
duke@435 100
bobv@2036 101 # ARM
bobv@2036 102 ifeq ($(ARCH), arm)
bobv@2036 103 ARCH_DATA_MODEL = 32
bobv@2036 104 PLATFORM = linux-arm
bobv@2036 105 VM_PLATFORM = linux_arm
bobv@2036 106 HS_ARCH = arm
bobv@2036 107 endif
bobv@2036 108
bobv@2036 109 # PPC
bobv@2036 110 ifeq ($(ARCH), ppc)
bobv@2036 111 ARCH_DATA_MODEL = 32
bobv@2036 112 PLATFORM = linux-ppc
bobv@2036 113 VM_PLATFORM = linux_ppc
bobv@2036 114 HS_ARCH = ppc
bobv@2036 115 endif
bobv@2036 116
erikj@3649 117 # On 32 bit linux we build server and client, on 64 bit just server.
erikj@3649 118 ifeq ($(JVM_VARIANTS),)
erikj@3649 119 ifeq ($(ARCH_DATA_MODEL), 32)
erikj@3649 120 JVM_VARIANTS:=client,server
erikj@3649 121 JVM_VARIANT_CLIENT:=true
erikj@3649 122 JVM_VARIANT_SERVER:=true
erikj@3649 123 else
erikj@3649 124 JVM_VARIANTS:=server
erikj@3649 125 JVM_VARIANT_SERVER:=true
erikj@3649 126 endif
erikj@3649 127 endif
erikj@3649 128
dcubed@3150 129 # determine if HotSpot is being built in JDK6 or earlier version
dcubed@3150 130 JDK6_OR_EARLIER=0
dcubed@3150 131 ifeq "$(shell expr \( '$(JDK_MAJOR_VERSION)' != '' \& '$(JDK_MINOR_VERSION)' != '' \& '$(JDK_MICRO_VERSION)' != '' \))" "1"
dcubed@3150 132 # if the longer variable names (newer build style) are set, then check those
dcubed@3150 133 ifeq "$(shell expr \( $(JDK_MAJOR_VERSION) = 1 \& $(JDK_MINOR_VERSION) \< 7 \))" "1"
dcubed@3150 134 JDK6_OR_EARLIER=1
dcubed@3150 135 endif
dcubed@3150 136 else
dcubed@3150 137 # the longer variables aren't set so check the shorter variable names
dcubed@3150 138 ifeq "$(shell expr \( '$(JDK_MAJOR_VER)' = 1 \& '$(JDK_MINOR_VER)' \< 7 \))" "1"
dcubed@3150 139 JDK6_OR_EARLIER=1
dcubed@3150 140 endif
dcubed@3150 141 endif
dcubed@3150 142
dcubed@3150 143 ifeq ($(JDK6_OR_EARLIER),0)
dcubed@3724 144 # Full Debug Symbols is supported on JDK7 or newer.
dcubed@3725 145 # The Full Debug Symbols (FDS) default for BUILD_FLAVOR == product
dcubed@3725 146 # builds is enabled with debug info files ZIP'ed to save space. For
dcubed@3725 147 # BUILD_FLAVOR != product builds, FDS is always enabled, after all a
dcubed@3725 148 # debug build without debug info isn't very useful.
dcubed@3725 149 # The ZIP_DEBUGINFO_FILES option only has meaning when FDS is enabled.
dcubed@3725 150 #
dcubed@3725 151 # If you invoke a build with FULL_DEBUG_SYMBOLS=0, then FDS will be
dcubed@3725 152 # disabled for a BUILD_FLAVOR == product build.
dcubed@3725 153 #
dcubed@3725 154 # Note: Use of a different variable name for the FDS override option
dcubed@3725 155 # versus the FDS enabled check is intentional (FULL_DEBUG_SYMBOLS
dcubed@3725 156 # versus ENABLE_FULL_DEBUG_SYMBOLS). For auto build systems that pass
dcubed@3725 157 # in options via environment variables, use of distinct variables
dcubed@3725 158 # prevents strange behaviours. For example, in a BUILD_FLAVOR !=
dcubed@3725 159 # product build, the FULL_DEBUG_SYMBOLS environment variable will be
dcubed@3725 160 # 0, but the ENABLE_FULL_DEBUG_SYMBOLS make variable will be 1. If
dcubed@3725 161 # the same variable name is used, then different values can be picked
dcubed@3725 162 # up by different parts of the build. Just to be clear, we only need
dcubed@3725 163 # two variable names because the incoming option value can be
dcubed@3725 164 # overridden in some situations, e.g., a BUILD_FLAVOR != product
dcubed@3725 165 # build.
dcubed@3150 166
dcubed@3725 167 ifeq ($(BUILD_FLAVOR), product)
dcubed@3725 168 FULL_DEBUG_SYMBOLS ?= 1
dcubed@3725 169 ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS)
dcubed@3725 170 else
dcubed@3725 171 # debug variants always get Full Debug Symbols (if available)
dcubed@3725 172 ENABLE_FULL_DEBUG_SYMBOLS = 1
dcubed@3725 173 endif
dcubed@3725 174 _JUNK_ := $(shell \
dcubed@3725 175 echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")
dcubed@3724 176 # since objcopy is optional, we set ZIP_DEBUGINFO_FILES later
dcubed@3724 177
dcubed@3724 178 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
dcubed@3724 179 # Default OBJCOPY comes from GNU Binutils on Linux:
dcubed@3724 180 DEF_OBJCOPY=/usr/bin/objcopy
dcubed@3724 181 ifdef CROSS_COMPILE_ARCH
dcubed@3724 182 # don't try to generate .debuginfo files when cross compiling
dcubed@3724 183 _JUNK_ := $(shell \
dcubed@3724 184 echo >&2 "INFO: cross compiling for ARCH $(CROSS_COMPILE_ARCH)," \
dcubed@3724 185 "skipping .debuginfo generation.")
dcubed@3724 186 OBJCOPY=
dcubed@3724 187 else
dcubed@3724 188 OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY))
dcubed@3724 189 ifneq ($(ALT_OBJCOPY),)
dcubed@3724 190 _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)")
dcubed@3724 191 OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY))
dcubed@3724 192 endif
dcubed@3724 193 endif
dcubed@3724 194 else
dcubed@3150 195 OBJCOPY=
dcubed@3150 196 endif
dcubed@3724 197
dcubed@3150 198 ifeq ($(OBJCOPY),)
dcubed@3150 199 _JUNK_ := $(shell \
dcubed@3150 200 echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files.")
dcubed@3724 201 ENABLE_FULL_DEBUG_SYMBOLS=0
dcubed@3725 202 _JUNK_ := $(shell \
dcubed@3725 203 echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")
dcubed@3150 204 else
dcubed@3150 205 _JUNK_ := $(shell \
dcubed@3150 206 echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo files.")
dcubed@3724 207
dcubed@3150 208 # Library stripping policies for .debuginfo configs:
dcubed@3150 209 # all_strip - strips everything from the library
dcubed@3150 210 # min_strip - strips most stuff from the library; leaves minimum symbols
dcubed@3150 211 # no_strip - does not strip the library at all
dcubed@3150 212 #
dcubed@3150 213 # Oracle security policy requires "all_strip". A waiver was granted on
dcubed@3150 214 # 2011.09.01 that permits using "min_strip" in the Java JDK and Java JRE.
dcubed@3150 215 #
dcubed@3724 216 # Currently, STRIP_POLICY is only used when Full Debug Symbols is enabled.
dcubed@3724 217 #
dcubed@3724 218 STRIP_POLICY ?= min_strip
dcubed@3724 219
dcubed@3150 220 _JUNK_ := $(shell \
dcubed@3150 221 echo >&2 "INFO: STRIP_POLICY=$(STRIP_POLICY)")
dcubed@3724 222
dcubed@3724 223 ZIP_DEBUGINFO_FILES ?= 1
dcubed@3724 224
dcubed@3724 225 _JUNK_ := $(shell \
dcubed@3724 226 echo >&2 "INFO: ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES)")
dcubed@3150 227 endif
dcubed@3150 228 endif
dcubed@3150 229
duke@435 230 JDK_INCLUDE_SUBDIR=linux
duke@435 231
never@3156 232 # Library suffix
never@3156 233 LIBRARY_SUFFIX=so
never@3156 234
duke@435 235 # FIXUP: The subdirectory for a debug build is NOT the same on all platforms
duke@435 236 VM_DEBUG=jvmg
duke@435 237
duke@435 238 EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html
kvn@1450 239
kvn@1450 240 # client and server subdirectories have symbolic links to ../libjsig.so
never@3156 241 EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX)
dcubed@3724 242 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
dcubed@3724 243 ifeq ($(ZIP_DEBUGINFO_FILES),1)
dcubed@3724 244 EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.diz
dcubed@3724 245 else
dcubed@3724 246 EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.debuginfo
dcubed@3724 247 endif
dcubed@3150 248 endif
bobv@2036 249 EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server
kvn@3044 250 EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client
kvn@1450 251
mgerdin@3619 252 EXPORT_LIST += $(EXPORT_JRE_LIB_DIR)/wb.jar
mgerdin@3619 253
erikj@3649 254 ifeq ($(findstring true, $(JVM_VARIANT_SERVER) $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true)
erikj@3649 255 EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt
erikj@3649 256 EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.$(LIBRARY_SUFFIX)
dcubed@3724 257 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
dcubed@3724 258 ifeq ($(ZIP_DEBUGINFO_FILES),1)
dcubed@3724 259 EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.diz
dcubed@3724 260 else
dcubed@3724 261 EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.debuginfo
dcubed@3724 262 endif
dcubed@3150 263 endif
bobv@2036 264 endif
bobv@2036 265
erikj@3649 266 ifeq ($(JVM_VARIANT_CLIENT),true)
erikj@3649 267 EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt
erikj@3649 268 EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.$(LIBRARY_SUFFIX)
dcubed@3726 269 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
dcubed@3726 270 ifeq ($(ZIP_DEBUGINFO_FILES),1)
dcubed@3726 271 EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.diz
dcubed@3726 272 else
dcubed@3726 273 EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.debuginfo
dcubed@3150 274 endif
erikj@3649 275 endif
duke@435 276 endif
bobv@2036 277
bobv@2036 278 # Serviceability Binaries
bobv@2036 279 # No SA Support for PPC, IA64, ARM or zero
never@3156 280 ADD_SA_BINARIES/x86 = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \
bobv@2036 281 $(EXPORT_LIB_DIR)/sa-jdi.jar
never@3156 282 ADD_SA_BINARIES/sparc = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \
bobv@2036 283 $(EXPORT_LIB_DIR)/sa-jdi.jar
dcubed@3724 284 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
dcubed@3724 285 ifeq ($(ZIP_DEBUGINFO_FILES),1)
dcubed@3724 286 ADD_SA_BINARIES/x86 += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.diz
dcubed@3724 287 ADD_SA_BINARIES/sparc += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.diz
dcubed@3724 288 else
dcubed@3724 289 ADD_SA_BINARIES/x86 += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.debuginfo
dcubed@3724 290 ADD_SA_BINARIES/sparc += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.debuginfo
dcubed@3724 291 endif
dcubed@3150 292 endif
bobv@2036 293 ADD_SA_BINARIES/ppc =
bobv@2036 294 ADD_SA_BINARIES/ia64 =
bobv@2036 295 ADD_SA_BINARIES/arm =
bobv@2036 296 ADD_SA_BINARIES/zero =
bobv@2036 297
bobv@2036 298 EXPORT_LIST += $(ADD_SA_BINARIES/$(HS_ARCH))
bobv@2036 299
bobv@2036 300

mercurial