1 #
   2 # Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
   3 # Copyright 2012, 2013 SAP AG. All rights reserved.
   4 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   5 #
   6 # This code is free software; you can redistribute it and/or modify it
   7 # under the terms of the GNU General Public License version 2 only, as
   8 # published by the Free Software Foundation.
   9 #
  10 # This code is distributed in the hope that it will be useful, but WITHOUT
  11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  13 # version 2 for more details (a copy is included in the LICENSE file that
  14 # accompanied this code).
  15 #
  16 # You should have received a copy of the GNU General Public License version
  17 # 2 along with this work; if not, write to the Free Software Foundation,
  18 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19 #
  20 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21 # or visit www.oracle.com if you need additional information or have any
  22 # questions.
  23 #
  24 #
  25 
  26 # The common definitions for hotspot AIX builds.
  27 # Include the top level defs.make under make directory instead of this one.
  28 # This file is included into make/defs.make.
  29 
  30 SLASH_JAVA ?= /java
  31 
  32 # Need PLATFORM (os-arch combo names) for jdk and hotspot, plus libarch name
  33 #ARCH:=$(shell uname -m)
  34 PATH_SEP = :
  35 ifeq ($(LP64), 1)
  36   ARCH_DATA_MODEL ?= 64
  37 else
  38   ARCH_DATA_MODEL ?= 32
  39 endif
  40 
  41 ifeq ($(ARCH_DATA_MODEL), 64)
  42   ARCH = ppc64
  43 else
  44   ARCH = ppc
  45 endif
  46 
  47 # PPC
  48 ifeq ($(ARCH), ppc)
  49   #ARCH_DATA_MODEL = 32
  50   PLATFORM         = aix-ppc
  51   VM_PLATFORM      = aix_ppc
  52   HS_ARCH          = ppc
  53 endif
  54 
  55 # PPC64
  56 ifeq ($(ARCH), ppc64)
  57   #ARCH_DATA_MODEL = 64
  58   MAKE_ARGS       += LP64=1
  59   PLATFORM         = aix-ppc64
  60   VM_PLATFORM      = aix_ppc64
  61   HS_ARCH          = ppc
  62 endif
  63 
  64 # On 32 bit aix we build server and client, on 64 bit just server.
  65 ifeq ($(JVM_VARIANTS),)
  66   ifeq ($(ARCH_DATA_MODEL), 32)
  67     JVM_VARIANTS:=client,server
  68     JVM_VARIANT_CLIENT:=true
  69     JVM_VARIANT_SERVER:=true
  70   else
  71     JVM_VARIANTS:=server
  72     JVM_VARIANT_SERVER:=true
  73   endif
  74 endif
  75 
  76 # determine if HotSpot is being built in JDK6 or earlier version
  77 JDK6_OR_EARLIER=0
  78 ifeq "$(shell expr \( '$(JDK_MAJOR_VERSION)' != '' \& '$(JDK_MINOR_VERSION)' != '' \& '$(JDK_MICRO_VERSION)' != '' \))" "1"
  79   # if the longer variable names (newer build style) are set, then check those
  80   ifeq "$(shell expr \( $(JDK_MAJOR_VERSION) = 1 \& $(JDK_MINOR_VERSION) \< 7 \))" "1"
  81     JDK6_OR_EARLIER=1
  82   endif
  83 else
  84   # the longer variables aren't set so check the shorter variable names
  85   ifeq "$(shell expr \( '$(JDK_MAJOR_VER)' = 1 \& '$(JDK_MINOR_VER)' \< 7 \))" "1"
  86     JDK6_OR_EARLIER=1
  87   endif
  88 endif
  89 
  90 ifeq ($(JDK6_OR_EARLIER),0)
  91   # Full Debug Symbols is supported on JDK7 or newer.
  92   # The Full Debug Symbols (FDS) default for BUILD_FLAVOR == product
  93   # builds is enabled with debug info files ZIP'ed to save space. For
  94   # BUILD_FLAVOR != product builds, FDS is always enabled, after all a
  95   # debug build without debug info isn't very useful.
  96   # The ZIP_DEBUGINFO_FILES option only has meaning when FDS is enabled.
  97   #
  98   # If you invoke a build with FULL_DEBUG_SYMBOLS=0, then FDS will be
  99   # disabled for a BUILD_FLAVOR == product build.
 100   #
 101   # Note: Use of a different variable name for the FDS override option
 102   # versus the FDS enabled check is intentional (FULL_DEBUG_SYMBOLS
 103   # versus ENABLE_FULL_DEBUG_SYMBOLS). For auto build systems that pass
 104   # in options via environment variables, use of distinct variables
 105   # prevents strange behaviours. For example, in a BUILD_FLAVOR !=
 106   # product build, the FULL_DEBUG_SYMBOLS environment variable will be
 107   # 0, but the ENABLE_FULL_DEBUG_SYMBOLS make variable will be 1. If
 108   # the same variable name is used, then different values can be picked
 109   # up by different parts of the build. Just to be clear, we only need
 110   # two variable names because the incoming option value can be
 111   # overridden in some situations, e.g., a BUILD_FLAVOR != product
 112   # build.
 113 
 114   # Due to the multiple sub-make processes that occur this logic gets
 115   # executed multiple times. We reduce the noise by at least checking that
 116   # BUILD_FLAVOR has been set.
 117   ifneq ($(BUILD_FLAVOR),)
 118     ifeq ($(BUILD_FLAVOR), product)
 119       FULL_DEBUG_SYMBOLS ?= 1
 120       ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS)
 121     else
 122       # debug variants always get Full Debug Symbols (if available)
 123       ENABLE_FULL_DEBUG_SYMBOLS = 1
 124     endif
 125     _JUNK_ := $(shell \
 126       echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")
 127     # since objcopy is optional, we set ZIP_DEBUGINFO_FILES later
 128 
 129     ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 130       # Default OBJCOPY comes from GNU Binutils on Linux
 131       ifeq ($(CROSS_COMPILE_ARCH),)
 132         DEF_OBJCOPY=/usr/bin/objcopy
 133       else
 134         # Assume objcopy is part of the cross-compilation toolset
 135         ifneq ($(ALT_COMPILER_PATH),)
 136           DEF_OBJCOPY=$(ALT_COMPILER_PATH)/objcopy
 137         endif
 138       endif
 139       OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY))
 140       ifneq ($(ALT_OBJCOPY),)
 141         _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)")
 142         OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY))
 143       endif
 144 
 145       ifeq ($(OBJCOPY),)
 146         _JUNK_ := $(shell \
 147           echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files. You may need to set ALT_OBJCOPY.")
 148         ENABLE_FULL_DEBUG_SYMBOLS=0
 149         _JUNK_ := $(shell \
 150           echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")
 151       else
 152         _JUNK_ := $(shell \
 153           echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo files.")
 154 
 155         # Library stripping policies for .debuginfo configs:
 156         #   all_strip - strips everything from the library
 157         #   min_strip - strips most stuff from the library; leaves minimum symbols
 158         #   no_strip  - does not strip the library at all
 159         #
 160         # Oracle security policy requires "all_strip". A waiver was granted on
 161         # 2011.09.01 that permits using "min_strip" in the Java JDK and Java JRE.
 162         #
 163         # Currently, STRIP_POLICY is only used when Full Debug Symbols is enabled.
 164         #
 165         STRIP_POLICY ?= min_strip
 166 
 167         _JUNK_ := $(shell \
 168           echo >&2 "INFO: STRIP_POLICY=$(STRIP_POLICY)")
 169 
 170         ZIP_DEBUGINFO_FILES ?= 1
 171 
 172         _JUNK_ := $(shell \
 173           echo >&2 "INFO: ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES)")
 174       endif
 175     endif # ENABLE_FULL_DEBUG_SYMBOLS=1
 176   endif # BUILD_FLAVOR
 177 endif # JDK_6_OR_EARLIER
 178 
 179 # unused JDK_INCLUDE_SUBDIR=aix
 180 
 181 # Library suffix
 182 LIBRARY_SUFFIX=so
 183 
 184 EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html
 185 
 186 # client and server subdirectories have symbolic links to ../libjsig.so
 187 EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX)
 188 #ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 189 #  ifeq ($(ZIP_DEBUGINFO_FILES),1)
 190 #    EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.diz
 191 #  else
 192 #    EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.debuginfo
 193 #  endif
 194 #endif
 195 EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server
 196 EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client
 197 EXPORT_MINIMAL_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/minimal
 198 
 199 ifeq ($(findstring true, $(JVM_VARIANT_SERVER) $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK) $(JVM_VARIANT_CORE)), true)
 200   EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt
 201   EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.$(LIBRARY_SUFFIX)
 202 #  ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 203 #    ifeq ($(ZIP_DEBUGINFO_FILES),1)
 204 #      EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.diz
 205 #    else
 206 #      EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.debuginfo
 207 #    endif
 208 #  endif
 209 endif
 210 
 211 ifeq ($(JVM_VARIANT_CLIENT),true)
 212   EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt
 213   EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.$(LIBRARY_SUFFIX)
 214 #  ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 215 #    ifeq ($(ZIP_DEBUGINFO_FILES),1)
 216 #      EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.diz
 217 #    else
 218 #      EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.debuginfo
 219 #    endif
 220 #  endif
 221 endif
 222 
 223 # Serviceability Binaries
 224 # No SA Support for PPC or zero
 225 ADD_SA_BINARIES/ppc   =
 226 ADD_SA_BINARIES/ppc64 =
 227 ADD_SA_BINARIES/zero  =
 228 
 229 EXPORT_LIST += $(ADD_SA_BINARIES/$(HS_ARCH))
 230 
 231