make/common/shared/Defs-windows.gmk

Tue, 28 Dec 2010 15:52:36 -0800

author
ohair
date
Tue, 28 Dec 2010 15:52:36 -0800
changeset 240
f90b3e014e83
parent 194
0f60cf26c5b5
child 406
0a5931be9176
permissions
-rw-r--r--

6962318: Update copyright year
Reviewed-by: xdono

duke@1 1 #
ohair@240 2 # Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
duke@1 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@1 4 #
duke@1 5 # This code is free software; you can redistribute it and/or modify it
duke@1 6 # under the terms of the GNU General Public License version 2 only, as
ohair@158 7 # published by the Free Software Foundation. Oracle designates this
duke@1 8 # particular file as subject to the "Classpath" exception as provided
ohair@158 9 # by Oracle in the LICENSE file that accompanied this code.
duke@1 10 #
duke@1 11 # This code is distributed in the hope that it will be useful, but WITHOUT
duke@1 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@1 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@1 14 # version 2 for more details (a copy is included in the LICENSE file that
duke@1 15 # accompanied this code).
duke@1 16 #
duke@1 17 # You should have received a copy of the GNU General Public License version
duke@1 18 # 2 along with this work; if not, write to the Free Software Foundation,
duke@1 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@1 20 #
ohair@158 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@158 22 # or visit www.oracle.com if you need additional information or have any
ohair@158 23 # questions.
duke@1 24 #
duke@1 25
duke@1 26 #
duke@1 27 # Definitions for Windows.
duke@1 28 #
duke@1 29
duke@1 30 # Default for COMPILER_WARNINGS_FATAL on Windows (C++ compiler warnings)
duke@1 31 # Level: Default is 3, 0 means none, 4 is the most but may be unreliable
duke@1 32 # Some makefiles may have set this to 0 to turn off warnings completely,
duke@1 33 # which also effectively creates a COMPILER_WARNINGS_FATAL=false situation.
duke@1 34 # Windows 64bit platforms are less likely to be warning free.
duke@1 35 # Historically, Windows 32bit builds should be mostly warning free.
duke@1 36 ifndef COMPILER_WARNING_LEVEL
duke@1 37 COMPILER_WARNING_LEVEL=3
duke@1 38 endif
duke@1 39 ifndef COMPILER_WARNINGS_FATAL
duke@1 40 COMPILER_WARNINGS_FATAL=false
duke@1 41 endif
duke@1 42
duke@1 43 # Windows should use parallel compilation for best build times
duke@1 44 ifndef COMPILE_APPROACH
duke@1 45 COMPILE_APPROACH = normal
duke@1 46 endif
duke@1 47
duke@1 48 # Indication that we are doing an incremental build.
duke@1 49 # This may trigger the creation of make depend files.
duke@1 50 # (This may not be working on windows yet, always force to false.)
duke@1 51 override INCREMENTAL_BUILD = false
duke@1 52
duke@1 53 # WARNING: This is extremely touch stuff, between CYGWIN vs. MKS and all
duke@1 54 # variations of MKS and CYGWIN releases, and 32bit vs 64bit,
duke@1 55 # this file can give you nightmares.
duke@1 56 #
duke@1 57 # Notes:
duke@1 58 # Keep all paths in the windows "mixed" style except CYGWIN UNXIXCOMMAND_PATH.
duke@1 59 # Use of PrefixPath is critical, some variables must end with / (see NOTE).
duke@1 60 # Use of quotes is critical due to possible spaces in paths coming from
duke@1 61 # the environment variables, be careful.
duke@1 62 # First convert \ to / with subst, keep it quoted due to blanks, then
duke@1 63 # use cygpath -s or dosname -s to get the short non-blank name.
duke@1 64 # If the MKS is old and doesn't have a dosname -s, you will be forced
duke@1 65 # to set ALT variables with the short non-space directory names.
duke@1 66 # If dosname doesn't appear to work, we won't use it.
duke@1 67 # The dosname utility also wants to accept stdin if it is not supplied
duke@1 68 # any path on the command line, this is really dangerous when using
duke@1 69 # make variables that can easily become empty, so I use:
duke@1 70 # echo $1 | dosname -s instead of dosname -s $1
duke@1 71 # to prevent dosname from hanging up the make process when $1 is empty.
duke@1 72 # The cygpath utility does not have this problem.
duke@1 73 # The ALT values should never really have spaces or use \.
duke@1 74 # Suspect these environment variables to have spaces and/or \ characters:
duke@1 75 # SYSTEMROOT, SystemRoot, WINDIR, windir, PROGRAMFILES, ProgramFiles,
ohair@194 76 # VC71COMNTOOLS,
duke@1 77 # MSVCDIR, MSVCDir.
duke@1 78 # So use $(subst \,/,) on them first adding quotes and placing them in
duke@1 79 # their own variable assigned with :=, then use FullPath.
duke@1 80 #
duke@1 81
duke@1 82 # Use FullPath to get C:/ style non-spaces path. Never ends with a /!
duke@1 83 ifdef USING_CYGWIN
duke@1 84 # We assume cygpath is available in the search path
duke@1 85 # NOTE: Use of 'pwd' with CYGWIN will not get you a mixed style path!
duke@1 86 CYGPATH_CMD=cygpath -a -s -m
duke@1 87 define FullPath
duke@1 88 $(shell $(CYGPATH_CMD) $1 2> $(DEV_NULL))
duke@1 89 endef
duke@1 90 define OptFullPath
duke@1 91 $(shell if [ "$1" != "" -a -d "$1" ]; then $(CYGPATH_CMD) "$1"; else echo "$1"; fi)
duke@1 92 endef
duke@1 93 else
duke@1 94 # Temporary until we upgrade to MKS 8.7, MKS pwd returns mixed mode path
duke@1 95 define FullPath
duke@1 96 $(shell cd $1 2> $(DEV_NULL) && pwd)
duke@1 97 endef
duke@1 98 define OptFullPath
duke@1 99 $(shell if [ "$1" != "" -a -d "$1" ]; then (cd $1 && pwd); else echo "$1"; fi)
duke@1 100 endef
duke@1 101 endif
duke@1 102
duke@1 103 # System drive
duke@1 104 ifdef SYSTEMDRIVE
duke@1 105 _system_drive =$(SYSTEMDRIVE)
duke@1 106 else
duke@1 107 ifdef SystemDrive
duke@1 108 _system_drive =$(SystemDrive)
duke@1 109 endif
duke@1 110 endif
duke@1 111 _system_drive:=$(call CheckValue,_system_drive,C:)
duke@1 112
duke@1 113 # UNIXCOMMAND_PATH: path to where the most common Unix commands are.
duke@1 114 # NOTE: Must end with / so that it could be empty, allowing PATH usage.
ohair@114 115 ifndef UNIXCOMMAND_PATH
ohair@114 116 ifdef ALT_UNIXCOMMAND_PATH
ohair@114 117 xALT_UNIXCOMMAND_PATH :="$(subst \,/,$(ALT_UNIXCOMMAND_PATH))"
ohair@114 118 fxALT_UNIXCOMMAND_PATH :=$(call FullPath,$(xALT_UNIXCOMMAND_PATH))
ohair@114 119 UNIXCOMMAND_PATH :=$(call PrefixPath,$(fxALT_UNIXCOMMAND_PATH))
duke@1 120 else
ohair@114 121 ifdef USING_CYGWIN
ohair@114 122 UNIXCOMMAND_PATH :=$(call PrefixPath,/usr/bin)
duke@1 123 else
ohair@114 124 ifdef ROOTDIR
ohair@114 125 xROOTDIR :="$(subst \,/,$(ROOTDIR))"
ohair@114 126 _rootdir :=$(call FullPath,$(xROOTDIR))
ohair@114 127 else
ohair@114 128 xROOTDIR :="$(_system_drive)/mksnt"
ohair@114 129 _rootdir :=$(call FullPath,$(xROOTDIR))
ohair@114 130 endif
ohair@114 131 ifneq ($(_rootdir),)
ohair@114 132 UNIXCOMMAND_PATH :=$(call PrefixPath,$(_rootdir)/mksnt)
ohair@114 133 endif
duke@1 134 endif
duke@1 135 endif
ohair@114 136 UNIXCOMMAND_PATH:=$(call AltCheckSpaces,UNIXCOMMAND_PATH)
ohair@114 137 export UNIXCOMMAND_PATH
duke@1 138 endif
duke@1 139
duke@1 140 # Get version of MKS or CYGWIN
duke@1 141 ifdef USING_CYGWIN
ohair@114 142 ifndef CYGWIN_VER
ohair@114 143 _CYGWIN_VER :=$(shell $(UNAME))
ohair@114 144 CYGWIN_VER :=$(call GetVersion,$(_CYGWIN_VER))
ohair@114 145 export CYGWIN_VER
ohair@114 146 endif
duke@1 147 else # MKS
duke@1 148 _MKS_VER :=$(shell $(MKSINFO) 2>&1 | $(GREP) Release | $(TAIL) -1 | $(SED) -e 's@.*\(Release.*\)@\1@')
duke@1 149 MKS_VER :=$(call GetVersion,$(_MKS_VER))
duke@1 150 # At this point, we can re-define FullPath to use DOSNAME_CMD
duke@1 151 CHECK_MKS87:=$(call CheckVersions,$(MKS_VER),8.7)
duke@1 152 TRY_DOSNAME:=false
duke@1 153 ifeq ($(CHECK_MKS87),same)
duke@1 154 TRY_DOSNAME:=true
duke@1 155 endif
duke@1 156 # Newer should be ok
duke@1 157 ifeq ($(CHECK_MKS87),newer)
duke@1 158 TRY_DOSNAME:=true
duke@1 159 endif
duke@1 160 ifeq ($(TRY_DOSNAME),true)
duke@1 161 ifeq ($(shell $(UNIXCOMMAND_PATH)dosname -s $(_system_drive)/ 2> $(DEV_NULL)),$(_system_drive)/)
duke@1 162 _DOSNAME=$(UNIXCOMMAND_PATH)dosname
duke@1 163 DOSNAME_CMD:=$(_DOSNAME) -s
duke@1 164 define FullPath
duke@1 165 $(subst //,/,$(shell echo $1 | $(DOSNAME_CMD) 2> $(DEV_NULL)))
duke@1 166 endef
duke@1 167 endif # test dosname -s
duke@1 168 endif # TRY_DOSNAME
duke@1 169 endif # MKS
duke@1 170
duke@1 171 # We try to get references to what we need via the default component
duke@1 172 # environment variables, or what was used historically.
duke@1 173
duke@1 174 # Process Windows values into FullPath values, these paths may have \ chars
duke@1 175
ohair@114 176 # Program Files directory
ohair@114 177 ifndef SHORTPROGRAMFILES
ohair@114 178 ifdef PROGRAMFILES
ohair@114 179 xPROGRAMFILES :="$(subst \,/,$(PROGRAMFILES))"
duke@1 180 else
ohair@114 181 ifeq ($(ARCH_DATA_MODEL), 32)
ohair@114 182 xPROGRAMFILES :="$(_system_drive)/Program Files"
duke@1 183 else
ohair@114 184 xPROGRAMFILES :="$(_system_drive)/Program Files (x86)"
duke@1 185 endif
duke@1 186 endif
duke@1 187 ifeq ($(ARCH_DATA_MODEL), 32)
ohair@114 188 SHORTPROGRAMFILES :=$(call FullPath,$(xPROGRAMFILES))
duke@1 189 else
ohair@114 190 ifdef PROGRAMW6432
ohair@114 191 xPROGRAMW6432 :="$(subst \,/,$(PROGRAMW6432))"
ohair@114 192 else
ohair@114 193 xPROGRAMW6432 :="$(_system_drive)/Program Files"
ohair@114 194 endif
ohair@114 195 SHORTPROGRAMFILES :=$(call FullPath,$(xPROGRAMW6432))
duke@1 196 endif
ohair@114 197 ifneq ($(word 1,$(SHORTPROGRAMFILES)),$(SHORTPROGRAMFILES))
ohair@114 198 SHORTPROGRAMFILES :=
duke@1 199 endif
ohair@114 200 export SHORTPROGRAMFILES
duke@1 201 endif
duke@1 202
duke@1 203 # Location on system where jdk installs might be
ohair@114 204 ifneq ($(SHORTPROGRAMFILES),)
ohair@114 205 USRJDKINSTANCES_PATH =$(SHORTPROGRAMFILES)/Java
duke@1 206 else
duke@1 207 USRJDKINSTANCES_PATH =$(_system_drive)/
duke@1 208 endif
duke@1 209
duke@1 210 # SLASH_JAVA: location of all network accessable files
ohair@114 211 ifndef SLASH_JAVA
ohair@114 212 ifdef ALT_SLASH_JAVA
ohair@114 213 xALT_SLASH_JAVA :="$(subst \,/,$(ALT_SLASH_JAVA))"
ohair@114 214 SLASH_JAVA :=$(call FullPath,$(xALT_SLASH_JAVA))
duke@1 215 else
ohair@114 216 ifdef ALT_JDK_JAVA_DRIVE
ohair@114 217 SLASH_JAVA =$(JDK_JAVA_DRIVE)
ohair@114 218 else
ohair@114 219 SLASH_JAVA =J:
ohair@114 220 endif
duke@1 221 endif
ohair@114 222 SLASH_JAVA:=$(call AltCheckSpaces,SLASH_JAVA)
ohair@114 223 SLASH_JAVA:=$(call AltCheckValue,SLASH_JAVA)
ohair@114 224 export SLASH_JAVA
duke@1 225 endif
duke@1 226
duke@1 227 # JDK_DEVTOOLS_DIR: common path for all the java devtools
ohair@114 228 ifndef JDK_DEVTOOLS_DIR
ohair@114 229 ifdef ALT_JDK_DEVTOOLS_DIR
ohair@114 230 xALT_JDK_DEVTOOLS_DIR :="$(subst \,/,$(ALT_JDK_DEVTOOLS_DIR))"
ohair@114 231 JDK_DEVTOOLS_DIR :=$(call FullPath,$(xALT_JDK_DEVTOOLS_DIR))
ohair@114 232 else
ohair@114 233 JDK_DEVTOOLS_DIR =$(SLASH_JAVA)/devtools
ohair@114 234 endif
ohair@114 235 JDK_DEVTOOLS_DIR:=$(call AltCheckSpaces,JDK_DEVTOOLS_DIR)
ohair@114 236 JDK_DEVTOOLS_DIR:=$(call AltCheckValue,JDK_DEVTOOLS_DIR)
ohair@114 237 export JDK_DEVTOOLS_DIR
duke@1 238 endif
duke@1 239
duke@1 240 # DEVTOOLS_PATH: for other tools required for building (such as zip, etc.)
duke@1 241 # NOTE: Must end with / so that it could be empty, allowing PATH usage.
ohair@114 242 ifndef DEVTOOLS_PATH
ohair@114 243 ifdef ALT_DEVTOOLS_PATH
ohair@114 244 xALT_DEVTOOLS_PATH :="$(subst \,/,$(ALT_DEVTOOLS_PATH))"
ohair@114 245 fxALT_DEVTOOLS_PATH :=$(call FullPath,$(xALT_DEVTOOLS_PATH))
ohair@114 246 DEVTOOLS_PATH :=$(call PrefixPath,$(fxALT_DEVTOOLS_PATH))
duke@1 247 else
ohair@114 248 ifdef USING_CYGWIN
ohair@114 249 DEVTOOLS_PATH :=$(UNIXCOMMAND_PATH)
ohair@114 250 else
ohair@114 251 xDEVTOOLS_PATH :="$(_system_drive)/utils"
ohair@114 252 fxDEVTOOLS_PATH :=$(call FullPath,$(xDEVTOOLS_PATH))
ohair@114 253 DEVTOOLS_PATH :=$(call PrefixPath,$(fxDEVTOOLS_PATH))
ohair@114 254 endif
duke@1 255 endif
ohair@114 256 DEVTOOLS_PATH:=$(call AltCheckSpaces,DEVTOOLS_PATH)
ohair@114 257 export DEVTOOLS_PATH
duke@1 258 endif
duke@1 259
duke@1 260 # _BOOTDIR1: First choice for a Bootstrap JDK, previous released JDK.
duke@1 261 # _BOOTDIR2: Second choice
duke@1 262 ifndef ALT_BOOTDIR
duke@1 263 _BOOTDIR1 =$(_system_drive)/jdk$(PREVIOUS_JDK_VERSION)
duke@1 264 _BOOTDIR2 =$(USRJDKINSTANCES_PATH)/jdk$(PREVIOUS_JDK_VERSION)
duke@1 265 endif
duke@1 266
duke@1 267 # Import JDK images allow for partial builds, components not built are
duke@1 268 # imported (or copied from) these import areas when needed.
duke@1 269
duke@1 270 # BUILD_JDK_IMPORT_PATH: location of JDK install trees to import for
duke@1 271 # multiple platforms, e.g. windows-i586, solaris-sparc, linux-586, etc.
ohair@114 272 ifndef BUILD_JDK_IMPORT_PATH
ohair@114 273 ifdef ALT_BUILD_JDK_IMPORT_PATH
ohair@114 274 BUILD_JDK_IMPORT_PATH :=$(call FullPath,$(ALT_BUILD_JDK_IMPORT_PATH))
ohair@114 275 else
ohair@114 276 BUILD_JDK_IMPORT_PATH = $(PROMOTED_BUILD_BINARIES)
ohair@114 277 endif
ohair@114 278 BUILD_JDK_IMPORT_PATH:=$(call AltCheckSpaces,BUILD_JDK_IMPORT_PATH)
ohair@114 279 BUILD_JDK_IMPORT_PATH:=$(call AltCheckValue,BUILD_JDK_IMPORT_PATH)
ohair@114 280 export BUILD_JDK_IMPORT_PATH
duke@1 281 endif
duke@1 282
duke@1 283 # JDK_IMPORT_PATH: location of previously built JDK (this version) to import
ohair@114 284 ifndef JDK_IMPORT_PATH
ohair@114 285 ifdef ALT_JDK_IMPORT_PATH
ohair@114 286 JDK_IMPORT_PATH :=$(call FullPath,$(ALT_JDK_IMPORT_PATH))
ohair@114 287 else
ohair@114 288 JDK_IMPORT_PATH = $(BUILD_JDK_IMPORT_PATH)/$(PLATFORM)-$(ARCH)$(_JDK_IMPORT_VARIANT)
ohair@114 289 endif
ohair@114 290 JDK_IMPORT_PATH:=$(call AltCheckSpaces,JDK_IMPORT_PATH)
ohair@114 291 JDK_IMPORT_PATH:=$(call AltCheckValue,JDK_IMPORT_PATH)
ohair@114 292 export JDK_IMPORT_PATH
duke@1 293 endif
duke@1 294

mercurial