Defs.gmk revision 3514
6092N/A#
6092N/A# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
6092N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6092N/A#
6092N/A# This code is free software; you can redistribute it and/or modify it
6092N/A# under the terms of the GNU General Public License version 2 only, as
6092N/A# published by the Free Software Foundation. Oracle designates this
6092N/A# particular file as subject to the "Classpath" exception as provided
6092N/A# by Oracle in the LICENSE file that accompanied this code.
6092N/A#
6092N/A# This code is distributed in the hope that it will be useful, but WITHOUT
6092N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
6092N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
6092N/A# version 2 for more details (a copy is included in the LICENSE file that
6092N/A# accompanied this code).
6092N/A#
6092N/A# You should have received a copy of the GNU General Public License version
6092N/A# 2 along with this work; if not, write to the Free Software Foundation,
6092N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
6092N/A#
6092N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
6092N/A# or visit www.oracle.com if you need additional information or have any
6092N/A# questions.
6092N/A#
6092N/A
6092N/A#
6092N/A# Definitions for all platforms.
6092N/A#
6092N/A# Normally the convention is that these alternate definitions of
6092N/A# primary make variables are never defined inside the Makefiles anywhere
6092N/A# but are defined via environment variables or set on the make command
6092N/A# line. So you should never see an ALT_* variable defined in any
6092N/A# makefiles, just used. This is the convention and there are some
6092N/A# exceptions, either mistakes or unusual circumstances.
6092N/A#
6092N/A# The naming convention for the default value of one of these variables
6092N/A# that has an ALT_* override capability is to name the default value with a
6092N/A# leading underscore (_). So for XXX you would have:
6092N/A# _XXX default value
6092N/A# ALT_XXX any override the user is providing if any
6092N/A# XXX the final value, either the default _XXX or the ALT_XXX value.
6092N/A#
6092N/A
6092N/A# On Directory names. In very rare cases should the Windows directory
6092N/A# names use the backslash, please use the C:/ style of windows paths.
6092N/A# Avoid duplicating the // characters in paths, this has known to cause
6092N/A# strange problems with jar and other utilities, e.g. /a//b/ != /a/b/.
6092N/A# Some of these variables have an explicit trailing / character, but in
6092N/A# general, they should NOT have the trailing / character.
6092N/A
6092N/A# Get shared system utilities macros defined
6092N/Ainclude $(JDK_MAKE_SHARED_DIR)/Defs-utils.gmk
6092N/A
6092N/A# Assumes ARCH, PLATFORM, ARCH_VM_SUBDIR, JDK_TOPDIR, etc. have been defined.
6092N/A
6092N/A# Simple pwd path
6092N/A# NOTE: Just use the shell's cd and pwd here, more reliable at sanity time.
6092N/Adefine PwdPath
6092N/A$(shell cd $1 2> $(DEV_NULL) && pwd)
6092N/Aendef
6092N/Adefine AbsPwdPathCheck
6092N/A$(shell cd .. 2> $(DEV_NULL) && cd $1 2> $(DEV_NULL) && pwd)
6092N/Aendef
6092N/A
6092N/A# Checks an ALT value for spaces (should be one word),
6092N/A# warns and returns Check_ALT_$1 if spaces
6092N/Adefine AltCheckSpaces
6092N/A$(if $(word 2,$($1)),$(warning "WARNING: Value of $1 contains a space: '$($1)', check or set ALT_$1")Check_ALT_$1,$($1))
6092N/Aendef
6092N/A
6092N/A# Checks an ALT value for empty, warns and returns Check_ALT_$1 if empty
6092N/Adefine AltCheckValue
6092N/A$(if $($1),$($1),$(warning "WARNING: Value of $1 cannot be empty, check or set ALT_$1")Check_ALT_$1)
6092N/Aendef
6092N/A
6092N/A# Checks any value for empty, warns and returns $2 if empty
6092N/Adefine CheckValue
6092N/A$(if $($1),$($1),$(warning "WARNING: Value of $1 cannot be empty, will use '$2'")$2)
6092N/Aendef
6092N/A
6092N/A# Prefix for a utility prefix path, if empty leave alone, otherwise end with a /
6092N/Adefine PrefixPath
6092N/A$(if $1,$(subst //,/,$1/),)
6092N/Aendef
6092N/A
6092N/A# Select a directory if it exists, or the alternate 2 or the alternate 3
6092N/Adefine DirExists
6092N/A$(shell \
6092N/A if [ -d "$1" ]; then \
6092N/A echo "$1"; \
6092N/A elif [ -d "$2" ]; then \
6092N/A echo "$2"; \
6092N/A else \
6092N/A echo "$3"; \
6092N/A fi)
6092N/Aendef
6092N/A
6092N/A# Select a directory if it exists, or the alternate 2, or the alternate 3, or the alternate 4
6092N/Adefine DirExists4
6092N/A$(shell \
6092N/A if [ -d "$1" ]; then \
6092N/A echo "$1"; \
6092N/A elif [ -d "$2" ]; then \
6092N/A echo "$2"; \
6092N/A elif [ -d "$3" ]; then \
6092N/A echo "$3"; \
6092N/A else \
6092N/A echo "$4"; \
6092N/A fi)
6092N/Aendef
6092N/A
6092N/A
6092N/A# Select a writable directory if it exists and is writable, or the alternate
6092N/Adefine WriteDirExists
6092N/A$(shell \
6092N/A if [ -d "$1" -a -w "$1" ]; then \
6092N/A echo "$1"; \
6092N/A else \
6092N/A echo "$2"; \
6092N/A fi)
6092N/Aendef
6092N/A
6092N/A# Select a file if it exists, or the alternate 1, or the alternate 2
6092N/Adefine FileExists
6092N/A$(shell \
6092N/A if [ -r "$1" ]; then \
6092N/A echo "$1"; \
6092N/A elif [ -r "$2" ]; then \
6092N/A echo "$2"; \
6092N/A else \
6092N/A echo "NO_FILE_EXISTS"; \
6092N/A fi)
6092N/Aendef
6092N/A
6092N/A# Given a line of text, get the version number from it
6092N/Adefine GetVersion
6092N/A$(shell echo $1 | sed -e 's@[^0-9]*\([0-9][0-9]*\.[0-9][.0-9]*\).*@\1@' )
6092N/Aendef
6092N/A
6092N/A# Return one part of the version numbers, watch out for non digits.
6092N/Adefine VersionWord # Number Version
6092N/A$(word $1,$(subst ., ,$(subst -, ,$2)))
6092N/Aendef
6092N/A
6092N/A# Given a major.minor.micro version, return the major, minor, or micro number
6092N/Adefine MajorVersion
6092N/A$(if $(call VersionWord,1,$1),$(call VersionWord,1,$1),0)
6092N/Aendef
6092N/Adefine MinorVersion
6092N/A$(if $(call VersionWord,2,$1),$(call VersionWord,2,$1),0)
6092N/Aendef
6092N/Adefine MicroVersion
6092N/A$(if $(call VersionWord,3,$1),$(call VersionWord,3,$1),0)
6092N/Aendef
6092N/A
6092N/A# Macro that returns missing, same, newer, or older $1=version $2=required
6092N/Adefine CheckVersions
6092N/A$(shell \
6092N/A if [ "$1" = "" -o "$2" = "" ]; then \
6092N/A echo missing; \
6092N/A elif [ "$1" = "$2" ]; then \
6092N/A echo same; \
6092N/A elif [ $(call MajorVersion,$1) -lt $(call MajorVersion,$2) ] ; then \
6092N/A echo older; \
6092N/A elif [ $(call MajorVersion,$1) -gt $(call MajorVersion,$2) ] ; then \
6092N/A echo newer; \
6092N/A elif [ $(call MinorVersion,$1) -lt $(call MinorVersion,$2) ]; then \
6092N/A echo older; \
6092N/A elif [ $(call MinorVersion,$1) -gt $(call MinorVersion,$2) ]; then \
6092N/A echo newer; \
6092N/A elif [ $(call MicroVersion,$1) -lt $(call MicroVersion,$2) ]; then \
6092N/A echo older; \
6092N/A elif [ $(call MicroVersion,$1) -gt $(call MicroVersion,$2) ]; then \
6092N/A echo newer; \
6092N/A else \
6092N/A echo same; \
6092N/A fi)
6092N/Aendef
6092N/A
6092N/A# Make sure certain variables are non-empty at this point
6092N/A_check_values:=\
6092N/A$(call CheckValue,ARCH,),\
6092N/A$(call CheckValue,ARCH_DATA_MODEL,),\
6092N/A$(call CheckValue,ARCH_VM_SUBDIR,),\
6092N/A$(call CheckValue,JDK_TOPDIR,),\
6092N/A$(call CheckValue,JDK_MAKE_SHARED_DIR,),\
6092N/A$(call CheckValue,VARIANT,),\
6092N/A$(call CheckValue,PLATFORM,)
6092N/A
6092N/A# Misc common settings for all workspaces
6092N/A# This determines the version of the product, and the previous version or boot
6092N/Aifndef JDK_MAJOR_VERSION
6092N/A JDK_MAJOR_VERSION = 1
6092N/A PREVIOUS_MAJOR_VERSION = 1
6092N/Aendif
6092N/A
6092N/Aifndef JDK_MINOR_VERSION
6092N/A JDK_MINOR_VERSION = 7
6092N/A PREVIOUS_MINOR_VERSION = 6
6092N/Aendif
6092N/A
6092N/Aifndef JDK_MICRO_VERSION
6092N/A JDK_MICRO_VERSION = 0
6092N/A PREVIOUS_MICRO_VERSION = 0
6092N/Aendif
6092N/A
6092N/Aifndef MILESTONE
6092N/A MILESTONE = internal
6092N/Aendif
6092N/A
6092N/A# Default names
6092N/Aifdef OPENJDK
6092N/A LAUNCHER_NAME = openjdk
6092N/A PRODUCT_NAME = OpenJDK
6092N/A PRODUCT_SUFFIX = Runtime Environment
6092N/A JDK_RC_PLATFORM_NAME = Platform
6092N/A COMPANY_NAME = N/A
6092N/Aelse
6092N/A LAUNCHER_NAME = java
6092N/A PRODUCT_NAME = Java(TM)
6092N/A PRODUCT_SUFFIX = SE Runtime Environment
6092N/A JDK_RC_PLATFORM_NAME = Platform SE
6092N/A COMPANY_NAME = Oracle Corporation
6092N/Aendif
6092N/A
6092N/ARUNTIME_NAME = $(PRODUCT_NAME) $(PRODUCT_SUFFIX)
6092N/A
6092N/Aifndef BUILD_NUMBER
6092N/A JDK_BUILD_NUMBER = b00
6092N/Aelse
6092N/A ifndef JDK_BUILD_NUMBER
6092N/A JDK_BUILD_NUMBER = $(BUILD_NUMBER)
6092N/A endif
6092N/Aendif
6092N/A
6092N/A# Default variant is the optimized version of everything
6092N/A# can be OPT or DBG, default is OPT
6092N/A# Determine the extra pattern to add to the release name for debug/fastdebug.
6092N/A# Determine the JDK_IMPORT_VARIANT, so we get the right VM files copied over.
6092N/A# Determine suffix for obj directory or OBJDIR, for .o files.
6092N/A# (by keeping .o files separate, just .o files, they don't clobber each
6092N/A# other, however, the library files will clobber each other).
6092N/A#
6092N/Aifeq ($(VARIANT), DBG)
6092N/A BUILD_VARIANT_RELEASE=-debug
6092N/A OBJDIRNAME_SUFFIX=_g
6092N/Aelse
6092N/A BUILD_VARIANT_RELEASE=
6092N/A OBJDIRNAME_SUFFIX=
6092N/Aendif
6092N/Aifeq ($(FASTDEBUG), true)
6092N/A VARIANT=DBG
6092N/A BUILD_VARIANT_RELEASE=-fastdebug
6092N/A OBJDIRNAME_SUFFIX=_gO
6092N/A _JDK_IMPORT_VARIANT=/fastdebug
6092N/Aendif
6092N/A
6092N/A# Depending on the flavor of the build, add a -debug or -fastdebug to the name
6092N/Aifdef DEBUG_NAME
6092N/A BUILD_VARIANT_RELEASE=-$(DEBUG_NAME)
6092N/Aendif
6092N/A
6092N/A# These default values are redefined during a release build.
6092N/A# CTE can set JDK_UPDATE_VERSION during the update release
6092N/Aifdef JDK_UPDATE_VERSION
6092N/A JDK_VERSION = $(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION)_$(JDK_UPDATE_VERSION)
6092N/A MARKETING_NUMBER := $(shell \
6092N/A $(ECHO) $(JDK_UPDATE_VERSION) | $(NAWK) '{if (substr($$0,1,1)=="0") print substr($$0, 2); else print $$0;}')
6092N/A MARKET_NAME= $(shell $(ECHO) " Update $(MARKETING_NUMBER)")
6092N/A JDK_MKTG_VERSION = $(JDK_MINOR_VERSION)u$(MARKETING_NUMBER)
6092N/Aelse
6092N/A JDK_VERSION = $(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION)
6092N/A JDK_MKTG_VERSION = $(JDK_MINOR_VERSION)
6092N/A MARKET_NAME=
6092N/Aendif
6092N/AJDK_UNDERSCORE_VERSION = $(subst .,_,$(JDK_VERSION))
6092N/AJDK_MKTG_UNDERSCORE_VERSION = $(subst .,_,$(JDK_MKTG_VERSION))
6092N/A
6092N/A# RELEASE is JDK_VERSION and -MILESTONE if MILESTONE is set
6092N/Aifneq ($(MILESTONE),fcs)
6092N/A RELEASE = $(JDK_VERSION)-$(MILESTONE)$(BUILD_VARIANT_RELEASE)
6092N/Aelse
6092N/A RELEASE = $(JDK_VERSION)$(BUILD_VARIANT_RELEASE)
6092N/Aendif
6092N/A
6092N/A# FULL_VERSION is RELEASE and -BUILD_NUMBER if BUILD_NUMBER is set
6092N/Aifdef BUILD_NUMBER
6092N/A FULL_VERSION = $(RELEASE)-$(BUILD_NUMBER)
6092N/Aelse
6092N/A BUILD_NUMBER = b00
6092N/A ifndef USER_RELEASE_SUFFIX
6092N/A BUILD_DATE := $(shell $(DATE) '+%Y_%m_%d_%H_%M')
6092N/A CLEAN_USERNAME := $(shell $(ECHO) "$(USER)" | $(TR) -d -c '[:alnum:]')
6092N/A USER_RELEASE_SUFFIX := $(shell $(ECHO) "$(CLEAN_USERNAME)_$(BUILD_DATE)" | $(TR) '[:upper:]' '[:lower:]' )
6092N/A endif
6092N/A export USER_RELEASE_SUFFIX
6092N/A FULL_VERSION = $(RELEASE)-$(USER_RELEASE_SUFFIX)-$(BUILD_NUMBER)
6092N/Aendif
6092N/A
6092N/A# Promoted build location
6092N/APROMOTED_RE_AREA = $(SLASH_JAVA)/re/jdk/$(JDK_VERSION)/promoted
6092N/APROMOTED_BUILD_LATEST = latest
6092N/APROMOTED_BUILD_BASEDIR = $(PROMOTED_RE_AREA)/$(PROMOTED_BUILD_LATEST)
6092N/APROMOTED_BUILD_DISTDIR = $(PROMOTED_BUILD_BASEDIR)/dist/$(PLATFORM)-$(ARCH)
6092N/APROMOTED_BUILD_BINARIES = $(PROMOTED_BUILD_BASEDIR)/binaries
6092N/A
6092N/A# PARALLEL_COMPILE_JOBS: is the number of compiles done in parallel.
6092N/A# If the user sets ALT_PARALLEL_COMPILE_JOBS, then COMPILE_APPROACH is set
6092N/A# to parallel.
6092N/A#
6092N/A# Recommended setting: 2 seems to be ideal for single cpu machines,
6092N/A# 2 times the number of CPU's is a basic formula,
6092N/A# but probably not more than 4 if the machine is
6092N/A# being shared by others, or the machine is limited
6092N/A# in RAM or swap.
6092N/A#
6092N/Aifdef ALT_PARALLEL_COMPILE_JOBS
6092N/A PARALLEL_COMPILE_JOBS=$(ALT_PARALLEL_COMPILE_JOBS)
6092N/Aelse
6092N/A PARALLEL_COMPILE_JOBS=2
6092N/Aendif
6092N/A
6092N/A# Previous JDK release (version of BOOTDIR version)
6092N/Aifdef ALT_PREVIOUS_JDK_VERSION
6092N/A PREVIOUS_JDK_VERSION = $(ALT_PREVIOUS_JDK_VERSION)
6092N/Aelse
6092N/A PREVIOUS_JDK_VERSION = $(PREVIOUS_MAJOR_VERSION).$(PREVIOUS_MINOR_VERSION).$(PREVIOUS_MICRO_VERSION)
6092N/Aendif
6092N/Aexport PREVIOUS_JDK_VERSION
6092N/APREVIOUS_JDK_VERSION:=$(call AltCheckSpaces,PREVIOUS_JDK_VERSION)
6092N/APREVIOUS_JDK_VERSION:=$(call AltCheckValue,PREVIOUS_JDK_VERSION)
6092N/A
6092N/A# Version with _ instead of . in number
6092N/Aifeq ($(PREVIOUS_MINOR_VERSION),5)
6092N/A PREVIOUS_JDK_UNDERSCORE_VERSION = $(subst .,_,$(PREVIOUS_JDK_VERSION))
6092N/Aelse
6092N/A PREVIOUS_JDK_UNDERSCORE_VERSION = $(PREVIOUS_MINOR_VERSION)
6092N/Aendif
6092N/A
6092N/A# Include any private definitions for this set of workspaces
6092N/A_PRIVATE_DEFS_FILE=$(JDK_MAKE_SHARED_DIR)/PrivateDefs.gmk
6092N/Aifeq ($(USING_PRIVATE_DEFS),)
6092N/A USING_PRIVATE_DEFS:=$(shell if [ -f $(_PRIVATE_DEFS_FILE) ]; then echo true; else echo false; fi)
6092N/Aendif
6092N/Aifeq ($(USING_PRIVATE_DEFS),true)
6092N/Adummy:=$(warning "WARNING: Using definitions from $(_PRIVATE_DEFS_FILE)")
6092N/Ainclude $(_PRIVATE_DEFS_FILE)
6092N/Aendif
6092N/A
6092N/A# OUTPUTDIR: Location of all output for the build
6092N/Aifdef ALT_OUTPUTDIR
6092N/A OUTPUTDIR:=$(subst \,/,$(ALT_OUTPUTDIR))
6092N/A # Assumes this is absolute (checks later)
6092N/A ABS_OUTPUTDIR:=$(OUTPUTDIR)
6092N/Aelse
6092N/A ifndef _OUTPUTDIR
6092N/A # Default: Get "build" parent directory, which should always exist
6092N/A ifndef BUILD_PARENT_DIRECTORY
6092N/A BUILD_PARENT_DIRECTORY=$(BUILDDIR)/..
6092N/A endif
6092N/A ifdef OPENJDK
6092N/A _OUTPUTDIRNAME=$(PLATFORM)-$(ARCH)$(OPENJDK_SUFFIX)
6092N/A else
6092N/A _OUTPUTDIRNAME=$(PLATFORM)-$(ARCH)
6092N/A endif
6092N/A _OUTPUTDIR=$(BUILD_PARENT_DIRECTORY)/build/$(_OUTPUTDIRNAME)
6092N/A endif
6092N/A OUTPUTDIR:=$(_OUTPUTDIR)
6092N/Aendif
6092N/A# Check for spaces and null value
6092N/AOUTPUTDIR:=$(call AltCheckSpaces,OUTPUTDIR)
6092N/AOUTPUTDIR:=$(call AltCheckValue,OUTPUTDIR)
6092N/A
6092N/A# Get platform specific settings
6092N/A# NB: OUTPUTDIR must be defined. Otherwise hotspot import detection will not work correctly
6092N/A# On other hand this must be included early as it provides platform specific defines such as FullPath
6092N/Ainclude $(JDK_MAKE_SHARED_DIR)/Defs-versions.gmk
6092N/A
6092N/A# Get platform specific settings (defines COMPILER_PATH)
6092N/Ainclude $(JDK_MAKE_SHARED_DIR)/Defs-$(PLATFORM).gmk
6092N/A
6092N/A# Components
6092N/Aifdef ALT_LANGTOOLS_DIST
6092N/A LANGTOOLS_DIST :=$(call FullPath,$(ALT_LANGTOOLS_DIST))
6092N/Aelse
6092N/A LANGTOOLS_DIST =
6092N/Aendif
6092N/Aifdef ALT_CORBA_DIST
6092N/A CORBA_DIST :=$(call FullPath,$(ALT_CORBA_DIST))
6092N/Aelse
6092N/A CORBA_DIST =
6092N/Aendif
6092N/Aifdef ALT_JAXP_DIST
6092N/A JAXP_DIST :=$(call FullPath,$(ALT_JAXP_DIST))
6092N/Aelse
6092N/A JAXP_DIST =
6092N/Aendif
6092N/Aifdef ALT_JAXWS_DIST
6092N/A JAXWS_DIST :=$(call FullPath,$(ALT_JAXWS_DIST))
6092N/Aelse
6092N/A JAXWS_DIST =
6092N/Aendif
6092N/A
6092N/A# HOTSPOT_DOCS_IMPORT_PATH: Path to hotspot docs files to import into the docs generation
6092N/Aifdef ALT_HOTSPOT_DOCS_IMPORT_PATH
6092N/A HOTSPOT_DOCS_IMPORT_PATH :=$(call FullPath,$(ALT_HOTSPOT_DOCS_IMPORT_PATH))
6092N/Aelse
6092N/A HOTSPOT_DOCS_IMPORT_PATH :=$(call DirExists,$(HOTSPOT_IMPORT_PATH)/docs,$(PROMOTED_BUILD_BASEDIR)/docs,/NO_DOCS_DIR)
6092N/Aendif
6092N/A
6092N/A# These are the same on all platforms but require the above platform include 1st
6092N/A
6092N/A# BOOTDIR: Bootstrap JDK, previous released JDK.
6092N/A# _BOOTDIR1 and _BOOTDIR2 picked by platform
6092N/A# Platform may optionally define _BOOTDIR3 as well.
6092N/Aifdef ALT_BOOTDIR
6092N/A BOOTDIR =$(ALT_BOOTDIR)
6092N/Aelse
6092N/A ifdef _BOOTDIR3
6092N/A BOOTDIR :=$(call DirExists4,$(_BOOTDIR1),$(_BOOTDIR2),$(_BOOTDIR3),/NO_BOOTDIR)
6092N/A else
6092N/A BOOTDIR :=$(call DirExists,$(_BOOTDIR1),$(_BOOTDIR2),/NO_BOOTDIR)
6092N/A endif
6092N/Aendif
6092N/Aexport BOOTDIR
6092N/ABOOTDIR:=$(call AltCheckSpaces,BOOTDIR)
6092N/ABOOTDIR:=$(call AltCheckValue,BOOTDIR)
6092N/A
6092N/A# PREVIOUS_FCS_RE_AREA: re path to where previous release binaries/bundles are
6092N/APREVIOUS_FCS_RE_AREA = $(SLASH_JAVA)/re/jdk/$(PREVIOUS_JDK_VERSION)/archive/fcs
6092N/A
6092N/A# PREVIOUS_RELEASE_IMAGE: Previous install image to compare against
6092N/Aifdef ALT_PREVIOUS_RELEASE_IMAGE
6092N/A
6092N/A # Explicit image provided, no bundle access needed
6092N/A PREVIOUS_RELEASE_IMAGE :=$(call FullPath,$(ALT_PREVIOUS_RELEASE_IMAGE))
6092N/A
6092N/Aelse
6092N/A
6092N/A # PREVIOUS_RELEASE_PATH: path to where previous release bundles are
6092N/A ifdef ALT_PREVIOUS_RELEASE_PATH
6092N/A PREVIOUS_RELEASE_PATH :=$(call OptFullPath,$(ALT_PREVIOUS_RELEASE_PATH))
6092N/A else
6092N/A PREVIOUS_RELEASE_PATH := \
6092N/A $(call DirExists,$(PREVIOUS_FCS_RE_AREA)/bundles/$(PLATFORM)-$(ARCH),,)
6092N/A endif
6092N/A
6092N/A # Depending on if we have access to these bundles
6092N/A ifeq ($(PREVIOUS_RELEASE_PATH),)
6092N/A # Use images in re area or BOOTDIR (which is normally the previous release)
6092N/A PREVIOUS_RELEASE_IMAGE := \
6092N/A $(call DirExists,$(PREVIOUS_FCS_RE_AREA)/binaries/$(PLATFORM)-$(ARCH),$(BOOTDIR),)
6092N/A else
6092N/A # Get names of and paths to bundles
6092N/A PREVIOUS_RELEASE_PATH:=$(call AltCheckSpaces,PREVIOUS_RELEASE_PATH)
6092N/A PREVIOUS_RELEASE_PATH:=$(call AltCheckValue,PREVIOUS_RELEASE_PATH)
6092N/A export PREVIOUS_RELEASE_PATH
6092N/A
6092N/A # PREVIOUS_JDK_FILE: filename of install bundle for previous JDK
6092N/A ifdef ALT_PREVIOUS_JDK_FILE
6092N/A PREVIOUS_JDK_FILE =$(ALT_PREVIOUS_JDK_FILE)
6092N/A else
6092N/A PREVIOUS_JDK_FILE = \
6092N/A jdk-$(PREVIOUS_JDK_UNDERSCORE_VERSION)-$(PLATFORM)-$(ARCH)$(BUNDLE_FILE_SUFFIX)
6092N/A endif
6092N/A export PREVIOUS_JDK_FILE
6092N/A PREVIOUS_JDK_FILE:=$(call AltCheckSpaces,PREVIOUS_JDK_FILE)
6092N/A PREVIOUS_JDK_FILE:=$(call AltCheckValue,PREVIOUS_JDK_FILE)
6092N/A
6092N/A # PREVIOUS_JRE_FILE: filename of install bundle for previous JRE
6092N/A ifdef ALT_PREVIOUS_JRE_FILE
6092N/A PREVIOUS_JRE_FILE =$(ALT_PREVIOUS_JRE_FILE)
6092N/A else
6092N/A PREVIOUS_JRE_FILE = \
6092N/A jre-$(PREVIOUS_JDK_UNDERSCORE_VERSION)-$(PLATFORM)-$(ARCH)$(BUNDLE_FILE_SUFFIX)
6092N/A endif
6092N/A export PREVIOUS_JRE_FILE
6092N/A PREVIOUS_JRE_FILE:=$(call AltCheckSpaces,PREVIOUS_JRE_FILE)
6092N/A PREVIOUS_JRE_FILE:=$(call AltCheckValue,PREVIOUS_JRE_FILE)
6092N/A
6092N/A # Paths to these bundles
6092N/A PREVIOUS_JRE_BUNDLE = $(PREVIOUS_RELEASE_PATH)/$(PREVIOUS_JRE_FILE)
6092N/A PREVIOUS_JDK_BUNDLE = $(PREVIOUS_RELEASE_PATH)/$(PREVIOUS_JDK_FILE)
6092N/A endif
6092N/A
6092N/Aendif
6092N/A
6092N/A# Indicate we are using an image comparison
6092N/Aifneq ($(PREVIOUS_RELEASE_IMAGE),)
6092N/A PREVIOUS_RELEASE_PATH = USING-PREVIOUS_RELEASE_IMAGE
6092N/A PREVIOUS_JRE_BUNDLE = USING-PREVIOUS_RELEASE_IMAGE
6092N/A PREVIOUS_JDK_BUNDLE = USING-PREVIOUS_RELEASE_IMAGE
6092N/Aendif
6092N/A
6092N/A# CACERTS_FILE: if OPENJDK is false and the internal version of the file
6092N/A# (that is, non-empty) is available, use it, otherwise use an
6092N/A# empty keystore.
6092N/A#
6092N/A# We put this variable here for sanity checks and in case another
6092N/A# components will need to know which cacerts file is being used.
6092N/A#
6092N/Aifdef ALT_CACERTS_FILE
6092N/A CACERTS_FILE = $(ALT_CACERTS_FILE)
6092N/Aelse
6092N/A CACERTS_EXT = $(SHARE_SRC)/lib/security/cacerts
6092N/A ifdef OPENJDK
6092N/A CACERTS_FILE :=$(CACERTS_EXT)
6092N/A else # (!OPENJDK)
6092N/A CACERTS_INT = $(CLOSED_SHARE_SRC)/lib/security/cacerts.internal
6092N/A CACERTS_FILE :=$(call FileExists,$(CACERTS_INT),$(CACERTS_EXT))
6092N/A endif # (OPENJDK)
6092N/Aendif
6092N/ACACERTS_FILE:=$(call AltCheckSpaces,CACERTS_FILE)
6092N/ACACERTS_FILE:=$(call AltCheckValue,CACERTS_FILE)
6092N/A
6092N/A#
6092N/A# When signing the JCE framework and provider, we could be using built
6092N/A# bits on a read-only filesystem. If so, this test will fail and crash
6092N/A# the build.
6092N/A#
6092N/Aifndef IGNORE_WRITABLE_OUTPUTDIR_TEST
6092N/A# Create the output directory and make sure it exists and is writable
6092N/A_create_outputdir:=$(shell $(MKDIR) -p "$(OUTPUTDIR)" > $(DEV_NULL) 2>&1)
6092N/Aifeq ($(call WriteDirExists,$(OUTPUTDIR),/dev/null),/dev/null)
6092N/A _outputdir_error:=$(error "ERROR: OUTPUTDIR '$(OUTPUTDIR)' not created or not writable")
6092N/Aendif
6092N/Aendif
6092N/A
6092N/A# Define absolute path if needed and check for spaces and null value
6092N/Aifndef ABS_OUTPUTDIR
6092N/A ifdef _OUTPUTDIRNAME
6092N/A #Could not define this at the same time as _OUTPUTDIRNAME as FullPath is not defined at that point
6092N/A ABS_BUILD_PARENT_DIRECTORY:=$(call FullPath,$(BUILD_PARENT_DIRECTORY))
6092N/A ABS_OUTPUTDIR:=$(ABS_BUILD_PARENT_DIRECTORY)/build/$(_OUTPUTDIRNAME)
6092N/A else
6092N/A ABS_OUTPUTDIR:=$(call FullPath,$(OUTPUTDIR))
6092N/A endif
6092N/Aendif
6092N/AABS_OUTPUTDIR:=$(call AltCheckSpaces,ABS_OUTPUTDIR)
6092N/AABS_OUTPUTDIR:=$(call AltCheckValue,ABS_OUTPUTDIR)
6092N/A# Make doubly sure this is a full path
6092N/Aifeq ($(call AbsPwdPathCheck,$(ABS_OUTPUTDIR)), )
6092N/A ifdef ALT_OUTPUTDIR
6092N/A _outputdir_error:=$(error "ERROR: Trouble with the absolute path for OUTPUTDIR '$(OUTPUTDIR)', was ALT_OUTPUTDIR '$(ALT_OUTPUTDIR)' an absolute path?")
6092N/A else
6092N/A _outputdir_error:=$(error "ERROR: Trouble with the absolute path for OUTPUTDIR '$(OUTPUTDIR)'")
6092N/A endif
6092N/Aendif
6092N/A_dir1:=$(call FullPath,$(ABS_OUTPUTDIR))
6092N/A_dir2:=$(call FullPath,$(OUTPUTDIR))
6092N/Aifneq ($(_dir1),$(_dir2))
6092N/A _outputdir_error:=$(error "ERROR: ABS_OUTPUTDIR '$(ABS_OUTPUTDIR)' is not the same directory as OUTPUTDIR '$(OUTPUTDIR)', '$(_dir1)'!='$(_dir2)'")
6092N/Aendif
6092N/A
6092N/A# Bin directory
6092N/A# NOTE: ISA_DIR is usually empty, on Solaris it might be /sparcv9 or /amd64
6092N/ABINDIR = $(OUTPUTDIR)/bin$(ISA_DIR)
6092N/A
6092N/A# MOZILLA_HEADERS_PATH: path to mozilla header files for plugin
6092N/Aifdef ALT_MOZILLA_HEADERS_PATH
6092N/A MOZILLA_HEADERS_PATH :=$(call FullPath,$(ALT_MOZILLA_HEADERS_PATH))
6092N/Aelse
6092N/A MOZILLA_HEADERS_PATH =$(JDK_DEVTOOLS_DIR)/share/plugin
6092N/Aendif
6092N/AMOZILLA_HEADERS_PATH:=$(call AltCheckSpaces,MOZILLA_HEADERS_PATH)
6092N/AMOZILLA_HEADERS_PATH:=$(call AltCheckValue,MOZILLA_HEADERS_PATH)
6092N/A
6092N/A# CUPS_HEADERS_PATH: path to Cups headers files for Unix printing
6092N/Aifneq ($(PLATFORM), windows)
6092N/AJDK_CUPS_HEADERS_PATH=$(JDK_DEVTOOLS_DIR)/share/cups/include
6092N/A ifdef ALT_CUPS_HEADERS_PATH
6092N/A CUPS_HEADERS_PATH:=$(call FullPath,$(ALT_CUPS_HEADERS_PATH))
6092N/A CUPS_HEADERS_PATH:=$(call AltCheckValue,CUPS_HEADERS_PATH)
6092N/A else
6092N/A CUPS_HEADERS_PATH:= \
6092N/A $(shell if [ -d "$(JDK_CUPS_HEADERS_PATH)" ]; then \
6092N/A echo "$(JDK_CUPS_HEADERS_PATH)"; \
6092N/A else \
6092N/A echo "$(_CUPS_HEADERS_PATH)";\
6092N/A fi)
6092N/A endif
6092N/Aendif
6092N/A
6092N/A# Utilities ant
6092N/Aifeq ($(PLATFORM), windows)
6092N/A ifeq ($(ANT_HOME),)
6092N/A ANT_HOME := $(call DirExists,$(JDK_DEVTOOLS_DIR)/share/ant/latest,,)
6092N/A endif
6092N/Aendif
6092N/A
6092N/A# There are few problems with ant we need to workaround:
6092N/A# 1) ant is using temporary directory java.io.tmpdir
6092N/A# However, this directory is not unique enough and two separate ant processes
6092N/A# can easily end up using the exact same temp directory. This may lead to weird build failures
6092N/A# To workaround this we will define tmp dir explicitly
6092N/A# 2) ant attempts to detect JDK location based on java.exe location
6092N/A# This is fragile as developer may have JRE first on the PATH.
6092N/A# To workaround this we will specify JAVA_HOME explicitly
6092N/A
6092N/AANT_TMPDIR = $(ABS_OUTPUTDIR)/tmp
6092N/AANT_WORKAROUNDS = ANT_OPTS=-Djava.io.tmpdir='$(ANT_TMPDIR)' JAVA_HOME='$(BOOTDIR)'
6092N/A
6092N/Aifeq ($(ANT_HOME),)
6092N/A ANT = $(ANT_WORKAROUNDS) ant
6092N/Aelse
6092N/A ANT = $(ANT_WORKAROUNDS) $(ANT_HOME)/bin/ant
6092N/Aendif
6092N/A
6092N/Aifdef ALT_COPYRIGHT_YEAR
6092N/A COPYRIGHT_YEAR = $(ALT_COPYRIGHT_YEAR)
6092N/Aelse
6092N/A COPYRIGHT_YEAR = $(shell $(DATE) '+%Y')
6092N/Aendif
6092N/A
6092N/A# Get the compiler specific settings (will run the compiler to find out)
6092N/A# NOTE: COMPILER_PATH must be set by this time.
6092N/A# Up until we include this file, we don't know what specific compiler
6092N/A# version is actually being used (i.e. what is in PATH or COMPILER_PATH).
6092N/Ainclude $(JDK_MAKE_SHARED_DIR)/Compiler-$(CC_VERSION).gmk
6092N/A
6092N/A