1 #
   2 # Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
   3 # Copyright (c) 2012, 2013 SAP SE. 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 define print_info
  33   ifneq ($$(LOG_LEVEL), warn)
  34     $$(shell echo >&2 "INFO: $1")
  35   endif
  36 endef
  37 
  38 # Need PLATFORM (os-arch combo names) for jdk and hotspot, plus libarch name
  39 #ARCH:=$(shell uname -m)
  40 PATH_SEP = :
  41 ifeq ($(LP64), 1)
  42   ARCH_DATA_MODEL ?= 64
  43 else
  44   ARCH_DATA_MODEL ?= 32
  45 endif
  46 
  47 ifeq ($(ARCH_DATA_MODEL), 64)
  48   ARCH = ppc64
  49 else
  50   ARCH = ppc
  51 endif
  52 
  53 # PPC
  54 ifeq ($(ARCH), ppc)
  55   #ARCH_DATA_MODEL = 32
  56   PLATFORM         = aix-ppc
  57   VM_PLATFORM      = aix_ppc
  58   HS_ARCH          = ppc
  59 endif
  60 
  61 # PPC64
  62 ifeq ($(ARCH), ppc64)
  63   #ARCH_DATA_MODEL = 64
  64   MAKE_ARGS       += LP64=1
  65   PLATFORM         = aix-ppc64
  66   VM_PLATFORM      = aix_ppc64
  67   HS_ARCH          = ppc
  68 endif
  69 
  70 # On 32 bit aix we build server and client, on 64 bit just server.
  71 ifeq ($(JVM_VARIANTS),)
  72   ifeq ($(ARCH_DATA_MODEL), 32)
  73     JVM_VARIANTS:=client,server
  74     JVM_VARIANT_CLIENT:=true
  75     JVM_VARIANT_SERVER:=true
  76   else
  77     JVM_VARIANTS:=server
  78     JVM_VARIANT_SERVER:=true
  79   endif
  80 endif
  81 
  82 # The Full Debug Symbols (FDS) default for BUILD_FLAVOR == product
  83 # builds is enabled with debug info files ZIP'ed to save space. For
  84 # BUILD_FLAVOR != product builds, FDS is always enabled, after all a
  85 # debug build without debug info isn't very useful.
  86 # The ZIP_DEBUGINFO_FILES option only has meaning when FDS is enabled.
  87 #
  88 # If you invoke a build with FULL_DEBUG_SYMBOLS=0, then FDS will be
  89 # disabled for a BUILD_FLAVOR == product build.
  90 #
  91 # Note: Use of a different variable name for the FDS override option
  92 # versus the FDS enabled check is intentional (FULL_DEBUG_SYMBOLS
  93 # versus ENABLE_FULL_DEBUG_SYMBOLS). For auto build systems that pass
  94 # in options via environment variables, use of distinct variables
  95 # prevents strange behaviours. For example, in a BUILD_FLAVOR !=
  96 # product build, the FULL_DEBUG_SYMBOLS environment variable will be
  97 # 0, but the ENABLE_FULL_DEBUG_SYMBOLS make variable will be 1. If
  98 # the same variable name is used, then different values can be picked
  99 # up by different parts of the build. Just to be clear, we only need
 100 # two variable names because the incoming option value can be
 101 # overridden in some situations, e.g., a BUILD_FLAVOR != product
 102 # build.
 103 
 104 # Due to the multiple sub-make processes that occur this logic gets
 105 # executed multiple times. We reduce the noise by at least checking that
 106 # BUILD_FLAVOR has been set.
 107 ifneq ($(BUILD_FLAVOR),)
 108   ifeq ($(BUILD_FLAVOR), product)
 109     FULL_DEBUG_SYMBOLS ?= 1
 110     ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS)
 111   else
 112     # debug variants always get Full Debug Symbols (if available)
 113     ENABLE_FULL_DEBUG_SYMBOLS = 1
 114   endif
 115   $(eval $(call print_info, "ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)"))
 116   # since objcopy is optional, we set ZIP_DEBUGINFO_FILES later
 117 
 118   ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 119     # Default OBJCOPY comes from GNU Binutils on Linux
 120     ifeq ($(CROSS_COMPILE_ARCH),)
 121       DEF_OBJCOPY=/usr/bin/objcopy
 122     else
 123       # Assume objcopy is part of the cross-compilation toolset
 124       ifneq ($(ALT_COMPILER_PATH),)
 125         DEF_OBJCOPY=$(ALT_COMPILER_PATH)/objcopy
 126       endif
 127     endif
 128     OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY))
 129     ifneq ($(ALT_OBJCOPY),)
 130       $(eval $(call print_info, "ALT_OBJCOPY=$(ALT_OBJCOPY)"))
 131       OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY))
 132     endif
 133 
 134     ifeq ($(OBJCOPY),)
 135       $(eval $(call print_info, "no objcopy cmd found so cannot create .debuginfo files. You may need to set ALT_OBJCOPY."))
 136       ENABLE_FULL_DEBUG_SYMBOLS=0
 137       $(eval $(call print_info, "ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)"))
 138     else
 139       $(eval $(call print_info, "$(OBJCOPY) cmd found so will create .debuginfo files."))
 140 
 141       # Library stripping policies for .debuginfo configs:
 142       #   all_strip - strips everything from the library
 143       #   min_strip - strips most stuff from the library; leaves minimum symbols
 144       #   no_strip  - does not strip the library at all
 145       #
 146       # Oracle security policy requires "all_strip". A waiver was granted on
 147       # 2011.09.01 that permits using "min_strip" in the Java JDK and Java JRE.
 148       #
 149       # Currently, STRIP_POLICY is only used when Full Debug Symbols is enabled.
 150       #
 151       STRIP_POLICY ?= min_strip
 152 
 153       $(eval $(call print_info, "STRIP_POLICY=$(STRIP_POLICY)"))
 154 
 155       ZIP_DEBUGINFO_FILES ?= 1
 156 
 157       $(eval $(call print_info, "ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES)"))
 158     endif
 159   endif # ENABLE_FULL_DEBUG_SYMBOLS=1
 160 endif # BUILD_FLAVOR
 161 
 162 # unused JDK_INCLUDE_SUBDIR=aix
 163 
 164 # Library suffix
 165 LIBRARY_SUFFIX=so
 166 
 167 EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html
 168 
 169 # client and server subdirectories have symbolic links to ../libjsig.so
 170 EXPORT_LIST += $(EXPORT_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX)
 171 #ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 172 #  ifeq ($(ZIP_DEBUGINFO_FILES),1)
 173 #    EXPORT_LIST += $(EXPORT_LIB_ARCH_DIR)/libjsig.diz
 174 #  else
 175 #    EXPORT_LIST += $(EXPORT_LIB_ARCH_DIR)/libjsig.debuginfo
 176 #  endif
 177 #endif
 178 EXPORT_SERVER_DIR = $(EXPORT_LIB_ARCH_DIR)/server
 179 EXPORT_CLIENT_DIR = $(EXPORT_LIB_ARCH_DIR)/client
 180 EXPORT_MINIMAL_DIR = $(EXPORT_LIB_ARCH_DIR)/minimal
 181 
 182 ifeq ($(findstring true, $(JVM_VARIANT_SERVER) $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK) $(JVM_VARIANT_CORE)), true)
 183   EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt
 184   EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.$(LIBRARY_SUFFIX)
 185 #  ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 186 #    ifeq ($(ZIP_DEBUGINFO_FILES),1)
 187 #      EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.diz
 188 #    else
 189 #      EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.debuginfo
 190 #    endif
 191 #  endif
 192 endif
 193 
 194 ifeq ($(JVM_VARIANT_CLIENT),true)
 195   EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt
 196   EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.$(LIBRARY_SUFFIX)
 197 #  ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 198 #    ifeq ($(ZIP_DEBUGINFO_FILES),1)
 199 #      EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.diz
 200 #    else
 201 #      EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.debuginfo
 202 #    endif
 203 #  endif
 204 endif