#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
#
# Definitions for Windows.
#
# Default for COMPILER_WARNINGS_FATAL on Windows (C++ compiler warnings)
# Level: Default is 3, 0 means none, 4 is the most but may be unreliable
# Some makefiles may have set this to 0 to turn off warnings completely,
# which also effectively creates a COMPILER_WARNINGS_FATAL=false situation.
# Program.gmk may turn this down to 2 (building .exe's).
# Windows 64bit platforms are less likely to be warning free.
# Historically, Windows 32bit builds should be mostly warning free.
# VS2010 introduced a large number of security warnings that are off by
# default but will be turned back on with SHOW_ALL_WARNINGS=true.
COMPILER_WARNINGS_FATAL=false
SHOW_ALL_WARNINGS = false
# Windows should use parallel compilation for best build times
# Indication that we are doing an incremental build.
# This may trigger the creation of make depend files.
# (This may not be working on windows yet, always force to false.)
override INCREMENTAL_BUILD = false
# WARNING: This is extremely touch stuff, between CYGWIN vs. MKS and all
# variations of MKS and CYGWIN releases, and 32bit vs 64bit,
# this file can give you nightmares.
#
# Notes:
# Keep all paths in the windows "mixed" style except CYGWIN UNXIXCOMMAND_PATH.
# Use of PrefixPath is critical, some variables must end with / (see NOTE).
# Use of quotes is critical due to possible spaces in paths coming from
# the environment variables, be careful.
# First convert \ to / with subst, keep it quoted due to blanks, then
# use cygpath -s or dosname -s to get the short non-blank name.
# If the MKS is old and doesn't have a dosname -s, you will be forced
# to set ALT variables with the short non-space directory names.
# If dosname doesn't appear to work, we won't use it.
# The dosname utility also wants to accept stdin if it is not supplied
# any path on the command line, this is really dangerous when using
# make variables that can easily become empty, so I use:
# echo $1 | dosname -s instead of dosname -s $1
# to prevent dosname from hanging up the make process when $1 is empty.
# The cygpath utility does not have this problem.
# The ALT values should never really have spaces or use \.
# SYSTEMROOT, SystemRoot, WINDIR, windir, PROGRAMFILES, ProgramFiles,
# DXSDK_DIR, MSTOOLS, Mstools, MSSDK, MSSdk, VCnnCOMNTOOLS,
# MSVCDIR, MSVCDir.
# So use $(subst \,/,) on them first adding quotes and placing them in
# their own variable assigned with :=, then use FullPath.
#
# Macro to effectively do a toupper without an exec
# All possible drive letters
drives=a b c d e f g h i j k l m n o p q r s t v u w x y z
# Convert /cygdrive/ paths to the mixed style without an exec of cygpath
# and letter:/ is always uppercase coming from cygpath.
$(patsubst /%,$(CYGWIN_HOME)/%,$(sort $(filter-out /cygdrive/%,$(foreach drive,$(drives),$(patsubst /cygdrive/$(drive)/%,$(call ToUpper,$(drive)):/%,$1)))))
# Use FullPath to get C:/ style non-spaces path. Never ends with a /!
# We assume cygpath is available in the search path
# NOTE: Use of 'pwd' with CYGWIN will not get you a mixed style path!
$(if $(word 2,$1),$(shell $(CYGPATH_CMD) $1 2> $(DEV_NULL)),$(call MixedPath,$(realpath $(subst ",,$1))))
endef
define OptFullPath
endef
else
# Temporary until we upgrade to MKS 8.7, MKS pwd returns mixed mode path
define FullPath
endef
define OptFullPath
endef
endif
# System drive
ifdef SYSTEMDRIVE
_system_drive =$(SYSTEMDRIVE)
else
ifdef SystemDrive
_system_drive =$(SystemDrive)
endif
endif
_system_drive:=$(call CheckValue,_system_drive,C:)
# UNIXCOMMAND_PATH: path to where the most common Unix commands are.
# NOTE: Must end with / so that it could be empty, allowing PATH usage.
# With cygwin, just use this as is don't use FullPath on it.
ifdef ALT_UNIXCOMMAND_PATH
ifdef USING_CYGWIN
else
endif
else
ifdef USING_CYGWIN
UNIXCOMMAND_PATH :=$(call PrefixPath,/usr/bin)
else
ifdef ROOTDIR
else
endif
endif
endif
endif
UNIXCOMMAND_PATH:=$(call AltCheckSpaces,UNIXCOMMAND_PATH)
# Get version of MKS or CYGWIN
ifndef USING_CYGWIN
_MKS_VER :=$(shell $(MKSINFO) 2>&1 | $(GREP) Release | $(TAIL) -1 | $(SED) -e 's@.*\(Release.*\)@\1@')
# At this point, we can re-define FullPath to use DOSNAME_CMD
TRY_DOSNAME:=false
TRY_DOSNAME:=true
endif
# Newer should be ok
TRY_DOSNAME:=true
endif
define FullPath
endef
endif # test dosname -s
endif # TRY_DOSNAME
endif # MKS
# We try to get references to what we need via the default component
# environment variables, or what was used historically.
# Process Windows values into FullPath values, these paths may have \ chars
# System root
ifdef SYSTEMROOT
else
ifdef SystemRoot
else
ifdef WINDIR
else
ifdef windir
endif
endif
endif
endif
# Program Files directory
ifdef PROGRAMFILES
else
else
endif
endif
_program_files32 :=$(_program_files)
else
ifdef PROGRAMW6432
else
endif
_program_files32:=
endif
endif
_program_files:=
endif
# DirectX SDK
ifdef ALT_DXSDK_DRIVE
else
ifdef DXSDK_DIR
else
endif
endif
# Use of the Visual Studio compilers requires certain env variables be set:
# PATH should include the path to cl.exe
# INCLUDE should be defined
# LIB should be defined
# LIBPATH should be defined
# VS100COMNTOOLS should be defined
# WINDOWSSDKDIR should be defined
# The 7.0a path is from VS2010 Pro, the 7.1 path is the standalone SDK.
# For 64bit either will work for us.
# If a developer chooses to install the standalone SDK in some other
# location, then they need to set WINDOWSSDKDIR.
#
# Compilers for 64bit may be from the free SDK, or Visual Studio Professional.
# The free Express compilers don't contain 64 bit compilers, which is why
# you instead need the SDK.
# Release enginering will use VS2010 Pro, so the frequency of testing of
# SDK based builds will depend entirely on individual usage.
# We only need to do this once
ifndef VS2010_EXISTS
# The 2 key paths we need are WINDOWSSDKDIR and VS100COMNTOOLS.
# If not defined try to see if default location exists.
# If defined make sure that the path has no spaces.
# Finally, export path with no spaces so logic minimizes FullPath calls.
ifndef WINDOWSSDKDIR
# The 7.0a SDK is the second choice.
# The 7.1 SDK is the second choice.
endif
else
else
fWINDOWSSDKDIR :=$(WINDOWSSDKDIR)
endif
endif
endif
ifndef VS100COMNTOOLS
else
else
fVS100COMNTOOLS :=$(xVS100COMNTOOLS)
endif
endif
endif
# Check to see that both exist
_vs2010_message := No WINDOWSSDKDIR found on system. $(_vs2010_message)
VS2010_EXISTS := false
endif
_vs2010_message := No VS100COMNTOOLS found on system. $(_vs2010_message)
VS2010_EXISTS := false
endif
VS100COMNTOOLS :=
WINDOWSSDKDIR :=
else
VS2010_EXISTS := true
endif
export VS2010_EXISTS
export VS100COMNTOOLS
export WINDOWSSDKDIR
endif
endif
# VS2010 Compiler root directory
# SDK root directory
_ms_sdk :=$(WINDOWSSDKDIR)
# Compiler bin directory and redist directory
endif
endif
endif
# Location on system where jdk installs might be
else
endif
# SLASH_JAVA: location of all network accessable files
# NOTE: Do not use FullPath on this because it's often a drive letter and
# plain drive letters are ambiguous, so just use this 'as is'.
ifdef ALT_SLASH_JAVA
SLASH_JAVA :=$(xALT_SLASH_JAVA)
else
ifdef ALT_JDK_JAVA_DRIVE
SLASH_JAVA =$(JDK_JAVA_DRIVE)
else
SLASH_JAVA =J:
endif
endif
SLASH_JAVA:=$(call AltCheckSpaces,SLASH_JAVA)
SLASH_JAVA:=$(call AltCheckValue,SLASH_JAVA)
# JDK_DEVTOOLS_DIR: common path for all the java devtools
ifdef ALT_JDK_DEVTOOLS_DIR
else
endif
JDK_DEVTOOLS_DIR:=$(call AltCheckSpaces,JDK_DEVTOOLS_DIR)
JDK_DEVTOOLS_DIR:=$(call AltCheckValue,JDK_DEVTOOLS_DIR)
# COMPILER_PATH: path to where the compiler and tools are installed.
# NOTE: Must end with / so that it could be empty, allowing PATH usage.
ifdef ALT_COMPILER_PATH
else
endif
COMPILER_PATH :=$(call AltCheckSpaces,COMPILER_PATH)
# MSDEVTOOLS_PATH: path to where the additional MS Compiler tools are.
# NOTE: Must end with / so that it could be empty, allowing PATH usage.
ifdef ALT_MSDEVTOOLS_PATH
else
ifdef MSTOOLS
else
ifdef Mstools
else
_ms_tools :=
endif
endif
else
endif
else
_ms_tools_bin :=$(_compiler_bin)
endif
endif
MSDEVTOOLS_PATH:=$(call AltCheckSpaces,MSDEVTOOLS_PATH)
# DEVTOOLS_PATH: for other tools required for building (such as zip, etc.)
# NOTE: Must end with / so that it could be empty, allowing PATH usage.
ifdef ALT_DEVTOOLS_PATH
else
ifdef USING_CYGWIN
DEVTOOLS_PATH :=$(UNIXCOMMAND_PATH)
else
endif
endif
DEVTOOLS_PATH:=$(call AltCheckSpaces,DEVTOOLS_PATH)
# _BOOTDIR1: First choice for a Bootstrap JDK, previous released JDK.
# _BOOTDIR2: Second choice
# The _BOOTDIR3 is defind optionally.
ifndef ALT_BOOTDIR
endif
# Everybody needs the MSVCRNN runtime starting with VS2010
_NEEDS_MSVCRNN = true
# MSVCRNN_DLL_PATH: location of msvcrnn.dll that will be re-distributed
ifdef ALT_MSVCRNN_DLL_PATH
else
MSVCRNN_DLL_PATH :=$(_redist_sdk)
endif
MSVCRNN_DLL_PATH :=$(call AltCheckSpaces,MSVCRNN_DLL_PATH)
MSVCRNN_DLL_PATH:=$(call AltCheckValue,MSVCRNN_DLL_PATH)
endif
# DXSDK_PATH: path to Microsoft DirectX SDK Include and Lib
ifdef ALT_DXSDK_PATH
else
_DXSDK_PATH1 :=$(_dx_sdk_dir)
endif
DXSDK_PATH :=$(call AltCheckSpaces,DXSDK_PATH)
DXSDK_PATH:=$(call AltCheckValue,DXSDK_PATH)
# DXSDK_INCLUDE_PATH: path to Microsoft DirectX SDK Include
ifdef ALT_DXSDK_INCLUDE_PATH
else
endif
# DXSDK_LIB_PATH: path to Microsoft DirectX SDK Lib
ifdef ALT_DXSDK_LIB_PATH
else
else
endif
endif
# DEPLOY_MSSDK: Microsoft SDK for this platform (for deploy)
ifdef ALT_DEPLOY_MSSDK
else
DEPLOY_MSSDK :=$(_ms_sdk)
endif
DEPLOY_MSSDK:=$(call AltCheckSpaces,DEPLOY_MSSDK)
# INSTALL_MSSDK: Microsoft Installer SDK for this platform (for install)
ifdef ALT_INSTALL_MSSDK
else
INSTALL_MSSDK :=$(_ms_sdk)
endif
INSTALL_MSSDK:=$(call AltCheckSpaces,INSTALL_MSSDK)
# WSCRIPT: path to wscript.exe (used in creating install bundles)
ifdef ALT_WSCRIPT
WSCRIPT =$(xALT_WSCRIPT)
else
endif
WSCRIPT:=$(call AltCheckSpaces,WSCRIPT)
# batch mode no modal dialogs on errors, please.
WSCRIPT += -B
# CSCRIPT: path to cscript.exe (used in creating install bundles)
ifdef ALT_CSCRIPT
CSCRIPT =$(xALT_CSCRIPT)
else
endif
CSCRIPT:=$(call AltCheckSpaces,CSCRIPT)
# CABARC: path to cabarc.exe (used in creating install bundles)
ifdef ALT_CABARC
CABARC =$(xALT_CABARC)
else
endif
CABARC:=$(call AltCheckSpaces,CABARC)
# MSICERT: path to msicert.exe (used in creating install bundles)
ifdef ALT_MSICERT
MSICERT =$(xALT_MSICERT)
else
endif
MSICERT:=$(call AltCheckSpaces,MSICERT)
# Import JDK images allow for partial builds, components not built are
# imported (or copied from) these import areas when needed.
# BUILD_JDK_IMPORT_PATH: location of JDK install trees to import for
# multiple platforms, e.g. windows-i586, solaris-sparc, linux-586, etc.
ifdef ALT_BUILD_JDK_IMPORT_PATH
else
BUILD_JDK_IMPORT_PATH = $(PROMOTED_BUILD_BINARIES)
endif
BUILD_JDK_IMPORT_PATH:=$(call AltCheckSpaces,BUILD_JDK_IMPORT_PATH)
BUILD_JDK_IMPORT_PATH:=$(call AltCheckValue,BUILD_JDK_IMPORT_PATH)
# JDK_IMPORT_PATH: location of previously built JDK (this version) to import
ifdef ALT_JDK_IMPORT_PATH
else
endif
JDK_IMPORT_PATH:=$(call AltCheckSpaces,JDK_IMPORT_PATH)
JDK_IMPORT_PATH:=$(call AltCheckValue,JDK_IMPORT_PATH)
# HOTSPOT_IMPORT_PATH: location of hotspot pre-built files
ifdef ALT_HOTSPOT_IMPORT_PATH
else
# Default locations include the current $OUTPUTDIR, RE Promotions,
# and a JDK. Please be aware the JDK does not include a Kernel VM.
_HOTSPOT_IMPORT_PATH3 = $(JDK_IMPORT_PATH)
HOTSPOT_IMPORT_PATH := $(call DirExists,$(_HOTSPOT_IMPORT_PATH1),$(_HOTSPOT_IMPORT_PATH2),$(_HOTSPOT_IMPORT_PATH3))
endif
HOTSPOT_IMPORT_PATH:=$(call AltCheckSpaces,HOTSPOT_IMPORT_PATH)
HOTSPOT_IMPORT_PATH:=$(call AltCheckValue,HOTSPOT_IMPORT_PATH)
# HOTSPOT_CLIENT_PATH: location of client jvm library file.
ifdef ALT_HOTSPOT_CLIENT_PATH
else
endif
HOTSPOT_CLIENT_PATH:=$(call AltCheckSpaces,HOTSPOT_CLIENT_PATH)
HOTSPOT_CLIENT_PATH:=$(call AltCheckValue,HOTSPOT_CLIENT_PATH)
endif
# HOTSPOT_SERVER_PATH: location of server jvm library file.
ifdef ALT_HOTSPOT_SERVER_PATH
else
endif
HOTSPOT_SERVER_PATH:=$(call AltCheckSpaces,HOTSPOT_SERVER_PATH)
HOTSPOT_SERVER_PATH:=$(call AltCheckValue,HOTSPOT_SERVER_PATH)
# HOTSPOT_LIB_PATH: location of jvm.lib file.
ifdef ALT_HOTSPOT_LIB_PATH
else
endif
HOTSPOT_LIB_PATH:=$(call AltCheckSpaces,HOTSPOT_LIB_PATH)
HOTSPOT_LIB_PATH:=$(call AltCheckValue,HOTSPOT_LIB_PATH)
# Special define for checking the binaries
# All windows dll and exe files should have been built with /NXCOMPAT
# and be setup for dynamic base addresses.
# In addition, we should not be dependent on certain dll files that
# we do not or cannot redistribute.
# List of filenames we should NOT be dependent on
BANNED_DLLS=msvcp100[.]dll
else
BANNED_DLLS=msvcp100[.]dll|msvcr100d[.]dll|msvcrtd[.]dll
endif
# Check for /safeseh (only used on 32bit)
define binary_file_safeseh_verification # binary_file
( \
exit 6 ; \
fi ; \
)
endef
# Check for /NXCOMPAT usage
define binary_file_nxcompat_verification # binary_file
( \
exit 7 ; \
fi ; \
)
endef
# Check for /DYNAMICBASE usage
define binary_file_dynamicbase_verification # binary_file
( \
exit 8 ; \
fi ; \
)
endef
# Check for banned dll usage
define binary_file_dll_verification # binary_file
( \
exit 9 ; \
fi ; \
)
endef
# Macro to check it's input file for properly built executables.
# Relies on process exit code. Different for 32bit vs 64bit.
define binary_file_verification # binary_file
( \
)
endef
else
define binary_file_verification # binary_file
( \
)
endef
endif