0N/A#
239N/A# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
0N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A#
0N/A# This code is free software; you can redistribute it and/or modify it
0N/A# under the terms of the GNU General Public License version 2 only, as
157N/A# published by the Free Software Foundation. Oracle designates this
0N/A# particular file as subject to the "Classpath" exception as provided
157N/A# by Oracle in the LICENSE file that accompanied this code.
0N/A#
0N/A# This code is distributed in the hope that it will be useful, but WITHOUT
0N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A# version 2 for more details (a copy is included in the LICENSE file that
0N/A# accompanied this code).
0N/A#
0N/A# You should have received a copy of the GNU General Public License version
0N/A# 2 along with this work; if not, write to the Free Software Foundation,
0N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A#
157N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
157N/A# or visit www.oracle.com if you need additional information or have any
157N/A# questions.
0N/A#
0N/A
0N/A#
0N/A# Definitions for Windows.
0N/A#
0N/A
0N/A# Default for COMPILER_WARNINGS_FATAL on Windows (C++ compiler warnings)
0N/A# Level: Default is 3, 0 means none, 4 is the most but may be unreliable
0N/A# Some makefiles may have set this to 0 to turn off warnings completely,
0N/A# which also effectively creates a COMPILER_WARNINGS_FATAL=false situation.
0N/A# Windows 64bit platforms are less likely to be warning free.
0N/A# Historically, Windows 32bit builds should be mostly warning free.
0N/Aifndef COMPILER_WARNING_LEVEL
0N/A COMPILER_WARNING_LEVEL=3
0N/Aendif
0N/Aifndef COMPILER_WARNINGS_FATAL
0N/A COMPILER_WARNINGS_FATAL=false
0N/Aendif
0N/A
0N/A# Windows should use parallel compilation for best build times
0N/Aifndef COMPILE_APPROACH
0N/A COMPILE_APPROACH = normal
0N/Aendif
0N/A
0N/A# Indication that we are doing an incremental build.
0N/A# This may trigger the creation of make depend files.
0N/A# (This may not be working on windows yet, always force to false.)
0N/Aoverride INCREMENTAL_BUILD = false
0N/A
0N/A# WARNING: This is extremely touch stuff, between CYGWIN vs. MKS and all
0N/A# variations of MKS and CYGWIN releases, and 32bit vs 64bit,
0N/A# this file can give you nightmares.
0N/A#
0N/A# Notes:
0N/A# Keep all paths in the windows "mixed" style except CYGWIN UNXIXCOMMAND_PATH.
0N/A# Use of PrefixPath is critical, some variables must end with / (see NOTE).
0N/A# Use of quotes is critical due to possible spaces in paths coming from
0N/A# the environment variables, be careful.
0N/A# First convert \ to / with subst, keep it quoted due to blanks, then
0N/A# use cygpath -s or dosname -s to get the short non-blank name.
0N/A# If the MKS is old and doesn't have a dosname -s, you will be forced
0N/A# to set ALT variables with the short non-space directory names.
0N/A# If dosname doesn't appear to work, we won't use it.
0N/A# The dosname utility also wants to accept stdin if it is not supplied
0N/A# any path on the command line, this is really dangerous when using
0N/A# make variables that can easily become empty, so I use:
0N/A# echo $1 | dosname -s instead of dosname -s $1
0N/A# to prevent dosname from hanging up the make process when $1 is empty.
0N/A# The cygpath utility does not have this problem.
0N/A# The ALT values should never really have spaces or use \.
0N/A# Suspect these environment variables to have spaces and/or \ characters:
0N/A# SYSTEMROOT, SystemRoot, WINDIR, windir, PROGRAMFILES, ProgramFiles,
193N/A# VC71COMNTOOLS,
0N/A# MSVCDIR, MSVCDir.
0N/A# So use $(subst \,/,) on them first adding quotes and placing them in
0N/A# their own variable assigned with :=, then use FullPath.
0N/A#
0N/A
0N/A# Use FullPath to get C:/ style non-spaces path. Never ends with a /!
0N/Aifdef USING_CYGWIN
0N/A# We assume cygpath is available in the search path
0N/A# NOTE: Use of 'pwd' with CYGWIN will not get you a mixed style path!
0N/ACYGPATH_CMD=cygpath -a -s -m
0N/Adefine FullPath
0N/A$(shell $(CYGPATH_CMD) $1 2> $(DEV_NULL))
0N/Aendef
0N/Adefine OptFullPath
0N/A$(shell if [ "$1" != "" -a -d "$1" ]; then $(CYGPATH_CMD) "$1"; else echo "$1"; fi)
0N/Aendef
0N/Aelse
0N/A# Temporary until we upgrade to MKS 8.7, MKS pwd returns mixed mode path
0N/Adefine FullPath
0N/A$(shell cd $1 2> $(DEV_NULL) && pwd)
0N/Aendef
0N/Adefine OptFullPath
0N/A$(shell if [ "$1" != "" -a -d "$1" ]; then (cd $1 && pwd); else echo "$1"; fi)
0N/Aendef
0N/Aendif
0N/A
0N/A# System drive
0N/Aifdef SYSTEMDRIVE
0N/A _system_drive =$(SYSTEMDRIVE)
0N/Aelse
0N/A ifdef SystemDrive
0N/A _system_drive =$(SystemDrive)
0N/A endif
0N/Aendif
0N/A_system_drive:=$(call CheckValue,_system_drive,C:)
0N/A
0N/A# UNIXCOMMAND_PATH: path to where the most common Unix commands are.
0N/A# NOTE: Must end with / so that it could be empty, allowing PATH usage.
113N/Aifndef UNIXCOMMAND_PATH
113N/A ifdef ALT_UNIXCOMMAND_PATH
113N/A xALT_UNIXCOMMAND_PATH :="$(subst \,/,$(ALT_UNIXCOMMAND_PATH))"
113N/A fxALT_UNIXCOMMAND_PATH :=$(call FullPath,$(xALT_UNIXCOMMAND_PATH))
113N/A UNIXCOMMAND_PATH :=$(call PrefixPath,$(fxALT_UNIXCOMMAND_PATH))
0N/A else
113N/A ifdef USING_CYGWIN
113N/A UNIXCOMMAND_PATH :=$(call PrefixPath,/usr/bin)
0N/A else
113N/A ifdef ROOTDIR
113N/A xROOTDIR :="$(subst \,/,$(ROOTDIR))"
113N/A _rootdir :=$(call FullPath,$(xROOTDIR))
113N/A else
113N/A xROOTDIR :="$(_system_drive)/mksnt"
113N/A _rootdir :=$(call FullPath,$(xROOTDIR))
113N/A endif
113N/A ifneq ($(_rootdir),)
113N/A UNIXCOMMAND_PATH :=$(call PrefixPath,$(_rootdir)/mksnt)
113N/A endif
0N/A endif
0N/A endif
113N/A UNIXCOMMAND_PATH:=$(call AltCheckSpaces,UNIXCOMMAND_PATH)
113N/A export UNIXCOMMAND_PATH
0N/Aendif
0N/A
0N/A# Get version of MKS or CYGWIN
0N/Aifdef USING_CYGWIN
113N/A ifndef CYGWIN_VER
113N/A _CYGWIN_VER :=$(shell $(UNAME))
113N/A CYGWIN_VER :=$(call GetVersion,$(_CYGWIN_VER))
113N/A export CYGWIN_VER
113N/A endif
0N/Aelse # MKS
0N/A_MKS_VER :=$(shell $(MKSINFO) 2>&1 | $(GREP) Release | $(TAIL) -1 | $(SED) -e 's@.*\(Release.*\)@\1@')
0N/AMKS_VER :=$(call GetVersion,$(_MKS_VER))
0N/A# At this point, we can re-define FullPath to use DOSNAME_CMD
0N/ACHECK_MKS87:=$(call CheckVersions,$(MKS_VER),8.7)
0N/ATRY_DOSNAME:=false
0N/Aifeq ($(CHECK_MKS87),same)
0N/ATRY_DOSNAME:=true
0N/Aendif
0N/A# Newer should be ok
0N/Aifeq ($(CHECK_MKS87),newer)
0N/ATRY_DOSNAME:=true
0N/Aendif
0N/Aifeq ($(TRY_DOSNAME),true)
0N/Aifeq ($(shell $(UNIXCOMMAND_PATH)dosname -s $(_system_drive)/ 2> $(DEV_NULL)),$(_system_drive)/)
0N/A_DOSNAME=$(UNIXCOMMAND_PATH)dosname
0N/ADOSNAME_CMD:=$(_DOSNAME) -s
0N/Adefine FullPath
0N/A$(subst //,/,$(shell echo $1 | $(DOSNAME_CMD) 2> $(DEV_NULL)))
0N/Aendef
0N/Aendif # test dosname -s
0N/Aendif # TRY_DOSNAME
0N/Aendif # MKS
0N/A
0N/A# We try to get references to what we need via the default component
0N/A# environment variables, or what was used historically.
0N/A
0N/A# Process Windows values into FullPath values, these paths may have \ chars
0N/A
113N/A# Program Files directory
113N/Aifndef SHORTPROGRAMFILES
113N/A ifdef PROGRAMFILES
113N/A xPROGRAMFILES :="$(subst \,/,$(PROGRAMFILES))"
0N/A else
113N/A ifeq ($(ARCH_DATA_MODEL), 32)
113N/A xPROGRAMFILES :="$(_system_drive)/Program Files"
0N/A else
113N/A xPROGRAMFILES :="$(_system_drive)/Program Files (x86)"
0N/A endif
0N/A endif
0N/A ifeq ($(ARCH_DATA_MODEL), 32)
113N/A SHORTPROGRAMFILES :=$(call FullPath,$(xPROGRAMFILES))
0N/A else
113N/A ifdef PROGRAMW6432
113N/A xPROGRAMW6432 :="$(subst \,/,$(PROGRAMW6432))"
113N/A else
113N/A xPROGRAMW6432 :="$(_system_drive)/Program Files"
113N/A endif
113N/A SHORTPROGRAMFILES :=$(call FullPath,$(xPROGRAMW6432))
0N/A endif
113N/A ifneq ($(word 1,$(SHORTPROGRAMFILES)),$(SHORTPROGRAMFILES))
113N/A SHORTPROGRAMFILES :=
0N/A endif
113N/A export SHORTPROGRAMFILES
0N/Aendif
0N/A
0N/A# Location on system where jdk installs might be
113N/Aifneq ($(SHORTPROGRAMFILES),)
113N/A USRJDKINSTANCES_PATH =$(SHORTPROGRAMFILES)/Java
0N/Aelse
0N/A USRJDKINSTANCES_PATH =$(_system_drive)/
0N/Aendif
0N/A
0N/A# SLASH_JAVA: location of all network accessable files
113N/Aifndef SLASH_JAVA
113N/A ifdef ALT_SLASH_JAVA
113N/A xALT_SLASH_JAVA :="$(subst \,/,$(ALT_SLASH_JAVA))"
113N/A SLASH_JAVA :=$(call FullPath,$(xALT_SLASH_JAVA))
0N/A else
113N/A ifdef ALT_JDK_JAVA_DRIVE
113N/A SLASH_JAVA =$(JDK_JAVA_DRIVE)
113N/A else
113N/A SLASH_JAVA =J:
113N/A endif
0N/A endif
113N/A SLASH_JAVA:=$(call AltCheckSpaces,SLASH_JAVA)
113N/A SLASH_JAVA:=$(call AltCheckValue,SLASH_JAVA)
113N/A export SLASH_JAVA
0N/Aendif
0N/A
0N/A# JDK_DEVTOOLS_DIR: common path for all the java devtools
113N/Aifndef JDK_DEVTOOLS_DIR
113N/A ifdef ALT_JDK_DEVTOOLS_DIR
113N/A xALT_JDK_DEVTOOLS_DIR :="$(subst \,/,$(ALT_JDK_DEVTOOLS_DIR))"
113N/A JDK_DEVTOOLS_DIR :=$(call FullPath,$(xALT_JDK_DEVTOOLS_DIR))
113N/A else
113N/A JDK_DEVTOOLS_DIR =$(SLASH_JAVA)/devtools
113N/A endif
113N/A JDK_DEVTOOLS_DIR:=$(call AltCheckSpaces,JDK_DEVTOOLS_DIR)
113N/A JDK_DEVTOOLS_DIR:=$(call AltCheckValue,JDK_DEVTOOLS_DIR)
113N/A export JDK_DEVTOOLS_DIR
0N/Aendif
0N/A
0N/A# DEVTOOLS_PATH: for other tools required for building (such as zip, etc.)
0N/A# NOTE: Must end with / so that it could be empty, allowing PATH usage.
113N/Aifndef DEVTOOLS_PATH
113N/A ifdef ALT_DEVTOOLS_PATH
113N/A xALT_DEVTOOLS_PATH :="$(subst \,/,$(ALT_DEVTOOLS_PATH))"
113N/A fxALT_DEVTOOLS_PATH :=$(call FullPath,$(xALT_DEVTOOLS_PATH))
113N/A DEVTOOLS_PATH :=$(call PrefixPath,$(fxALT_DEVTOOLS_PATH))
0N/A else
113N/A ifdef USING_CYGWIN
113N/A DEVTOOLS_PATH :=$(UNIXCOMMAND_PATH)
113N/A else
113N/A xDEVTOOLS_PATH :="$(_system_drive)/utils"
113N/A fxDEVTOOLS_PATH :=$(call FullPath,$(xDEVTOOLS_PATH))
113N/A DEVTOOLS_PATH :=$(call PrefixPath,$(fxDEVTOOLS_PATH))
113N/A endif
0N/A endif
113N/A DEVTOOLS_PATH:=$(call AltCheckSpaces,DEVTOOLS_PATH)
113N/A export DEVTOOLS_PATH
0N/Aendif
0N/A
0N/A# _BOOTDIR1: First choice for a Bootstrap JDK, previous released JDK.
0N/A# _BOOTDIR2: Second choice
0N/Aifndef ALT_BOOTDIR
0N/A _BOOTDIR1 =$(_system_drive)/jdk$(PREVIOUS_JDK_VERSION)
0N/A _BOOTDIR2 =$(USRJDKINSTANCES_PATH)/jdk$(PREVIOUS_JDK_VERSION)
0N/Aendif
0N/A
0N/A# Import JDK images allow for partial builds, components not built are
0N/A# imported (or copied from) these import areas when needed.
0N/A
0N/A# BUILD_JDK_IMPORT_PATH: location of JDK install trees to import for
0N/A# multiple platforms, e.g. windows-i586, solaris-sparc, linux-586, etc.
113N/Aifndef BUILD_JDK_IMPORT_PATH
113N/A ifdef ALT_BUILD_JDK_IMPORT_PATH
113N/A BUILD_JDK_IMPORT_PATH :=$(call FullPath,$(ALT_BUILD_JDK_IMPORT_PATH))
113N/A else
113N/A BUILD_JDK_IMPORT_PATH = $(PROMOTED_BUILD_BINARIES)
113N/A endif
113N/A BUILD_JDK_IMPORT_PATH:=$(call AltCheckSpaces,BUILD_JDK_IMPORT_PATH)
113N/A BUILD_JDK_IMPORT_PATH:=$(call AltCheckValue,BUILD_JDK_IMPORT_PATH)
113N/A export BUILD_JDK_IMPORT_PATH
0N/Aendif
0N/A
0N/A# JDK_IMPORT_PATH: location of previously built JDK (this version) to import
113N/Aifndef JDK_IMPORT_PATH
113N/A ifdef ALT_JDK_IMPORT_PATH
113N/A JDK_IMPORT_PATH :=$(call FullPath,$(ALT_JDK_IMPORT_PATH))
113N/A else
113N/A JDK_IMPORT_PATH = $(BUILD_JDK_IMPORT_PATH)/$(PLATFORM)-$(ARCH)$(_JDK_IMPORT_VARIANT)
113N/A endif
113N/A JDK_IMPORT_PATH:=$(call AltCheckSpaces,JDK_IMPORT_PATH)
113N/A JDK_IMPORT_PATH:=$(call AltCheckValue,JDK_IMPORT_PATH)
113N/A export JDK_IMPORT_PATH
0N/Aendif
0N/A