1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/make/common/shared/Defs-windows.gmk Sat Dec 01 00:00:00 2007 +0000 1.3 @@ -0,0 +1,415 @@ 1.4 +# 1.5 +# Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved. 1.6 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.7 +# 1.8 +# This code is free software; you can redistribute it and/or modify it 1.9 +# under the terms of the GNU General Public License version 2 only, as 1.10 +# published by the Free Software Foundation. Sun designates this 1.11 +# particular file as subject to the "Classpath" exception as provided 1.12 +# by Sun in the LICENSE file that accompanied this code. 1.13 +# 1.14 +# This code is distributed in the hope that it will be useful, but WITHOUT 1.15 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.16 +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.17 +# version 2 for more details (a copy is included in the LICENSE file that 1.18 +# accompanied this code). 1.19 +# 1.20 +# You should have received a copy of the GNU General Public License version 1.21 +# 2 along with this work; if not, write to the Free Software Foundation, 1.22 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.23 +# 1.24 +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 1.25 +# CA 95054 USA or visit www.sun.com if you need additional information or 1.26 +# have any questions. 1.27 +# 1.28 + 1.29 +# 1.30 +# Definitions for Windows. 1.31 +# 1.32 + 1.33 +# Default for COMPILER_WARNINGS_FATAL on Windows (C++ compiler warnings) 1.34 +# Level: Default is 3, 0 means none, 4 is the most but may be unreliable 1.35 +# Some makefiles may have set this to 0 to turn off warnings completely, 1.36 +# which also effectively creates a COMPILER_WARNINGS_FATAL=false situation. 1.37 +# Program.gmk may turn this down to 2 (building .exe's). 1.38 +# Windows 64bit platforms are less likely to be warning free. 1.39 +# Historically, Windows 32bit builds should be mostly warning free. 1.40 +ifndef COMPILER_WARNING_LEVEL 1.41 + COMPILER_WARNING_LEVEL=3 1.42 +endif 1.43 +ifndef COMPILER_WARNINGS_FATAL 1.44 + COMPILER_WARNINGS_FATAL=false 1.45 +endif 1.46 + 1.47 +# Windows should use parallel compilation for best build times 1.48 +ifndef COMPILE_APPROACH 1.49 + COMPILE_APPROACH = normal 1.50 +endif 1.51 + 1.52 +# Indication that we are doing an incremental build. 1.53 +# This may trigger the creation of make depend files. 1.54 +# (This may not be working on windows yet, always force to false.) 1.55 +override INCREMENTAL_BUILD = false 1.56 + 1.57 +# WARNING: This is extremely touch stuff, between CYGWIN vs. MKS and all 1.58 +# variations of MKS and CYGWIN releases, and 32bit vs 64bit, 1.59 +# this file can give you nightmares. 1.60 +# 1.61 +# Notes: 1.62 +# Keep all paths in the windows "mixed" style except CYGWIN UNXIXCOMMAND_PATH. 1.63 +# Use of PrefixPath is critical, some variables must end with / (see NOTE). 1.64 +# Use of quotes is critical due to possible spaces in paths coming from 1.65 +# the environment variables, be careful. 1.66 +# First convert \ to / with subst, keep it quoted due to blanks, then 1.67 +# use cygpath -s or dosname -s to get the short non-blank name. 1.68 +# If the MKS is old and doesn't have a dosname -s, you will be forced 1.69 +# to set ALT variables with the short non-space directory names. 1.70 +# If dosname doesn't appear to work, we won't use it. 1.71 +# The dosname utility also wants to accept stdin if it is not supplied 1.72 +# any path on the command line, this is really dangerous when using 1.73 +# make variables that can easily become empty, so I use: 1.74 +# echo $1 | dosname -s instead of dosname -s $1 1.75 +# to prevent dosname from hanging up the make process when $1 is empty. 1.76 +# The cygpath utility does not have this problem. 1.77 +# The ALT values should never really have spaces or use \. 1.78 +# Suspect these environment variables to have spaces and/or \ characters: 1.79 +# SYSTEMROOT, SystemRoot, WINDIR, windir, PROGRAMFILES, ProgramFiles, 1.80 +# MSTOOLS, Mstools, MSSDK, MSSdk, VC71COMNTOOLS, 1.81 +# MSVCDIR, MSVCDir. 1.82 +# So use $(subst \,/,) on them first adding quotes and placing them in 1.83 +# their own variable assigned with :=, then use FullPath. 1.84 +# 1.85 + 1.86 +# Use FullPath to get C:/ style non-spaces path. Never ends with a /! 1.87 +ifdef USING_CYGWIN 1.88 +# We assume cygpath is available in the search path 1.89 +# NOTE: Use of 'pwd' with CYGWIN will not get you a mixed style path! 1.90 +CYGPATH_CMD=cygpath -a -s -m 1.91 +define FullPath 1.92 +$(shell $(CYGPATH_CMD) $1 2> $(DEV_NULL)) 1.93 +endef 1.94 +define OptFullPath 1.95 +$(shell if [ "$1" != "" -a -d "$1" ]; then $(CYGPATH_CMD) "$1"; else echo "$1"; fi) 1.96 +endef 1.97 +else 1.98 +# Temporary until we upgrade to MKS 8.7, MKS pwd returns mixed mode path 1.99 +define FullPath 1.100 +$(shell cd $1 2> $(DEV_NULL) && pwd) 1.101 +endef 1.102 +define OptFullPath 1.103 +$(shell if [ "$1" != "" -a -d "$1" ]; then (cd $1 && pwd); else echo "$1"; fi) 1.104 +endef 1.105 +endif 1.106 + 1.107 +# System drive 1.108 +ifdef SYSTEMDRIVE 1.109 + _system_drive =$(SYSTEMDRIVE) 1.110 +else 1.111 + ifdef SystemDrive 1.112 + _system_drive =$(SystemDrive) 1.113 + endif 1.114 +endif 1.115 +_system_drive:=$(call CheckValue,_system_drive,C:) 1.116 + 1.117 +# UNIXCOMMAND_PATH: path to where the most common Unix commands are. 1.118 +# NOTE: Must end with / so that it could be empty, allowing PATH usage. 1.119 +ifdef ALT_UNIXCOMMAND_PATH 1.120 + xALT_UNIXCOMMAND_PATH :="$(subst \,/,$(ALT_UNIXCOMMAND_PATH))" 1.121 + fxALT_UNIXCOMMAND_PATH :=$(call FullPath,$(xALT_UNIXCOMMAND_PATH)) 1.122 + UNIXCOMMAND_PATH :=$(call PrefixPath,$(fxALT_UNIXCOMMAND_PATH)) 1.123 +else 1.124 + ifdef USING_CYGWIN 1.125 + UNIXCOMMAND_PATH :=$(call PrefixPath,/usr/bin) 1.126 + else 1.127 + ifdef ROOTDIR 1.128 + xROOTDIR :="$(subst \,/,$(ROOTDIR))" 1.129 + _rootdir :=$(call FullPath,$(xROOTDIR)) 1.130 + else 1.131 + xROOTDIR :="$(_system_drive)/mksnt" 1.132 + _rootdir :=$(call FullPath,$(xROOTDIR)) 1.133 + endif 1.134 + ifneq ($(_rootdir),) 1.135 + UNIXCOMMAND_PATH :=$(call PrefixPath,$(_rootdir)/mksnt) 1.136 + endif 1.137 + endif 1.138 +endif 1.139 +UNIXCOMMAND_PATH:=$(call AltCheckSpaces,UNIXCOMMAND_PATH) 1.140 + 1.141 +# Get version of MKS or CYGWIN 1.142 +ifdef USING_CYGWIN 1.143 +_CYGWIN_VER :=$(shell $(UNAME)) 1.144 +CYGWIN_VER :=$(call GetVersion,$(_CYGWIN_VER)) 1.145 +else # MKS 1.146 +_MKS_VER :=$(shell $(MKSINFO) 2>&1 | $(GREP) Release | $(TAIL) -1 | $(SED) -e 's@.*\(Release.*\)@\1@') 1.147 +MKS_VER :=$(call GetVersion,$(_MKS_VER)) 1.148 +# At this point, we can re-define FullPath to use DOSNAME_CMD 1.149 +CHECK_MKS87:=$(call CheckVersions,$(MKS_VER),8.7) 1.150 +TRY_DOSNAME:=false 1.151 +ifeq ($(CHECK_MKS87),same) 1.152 +TRY_DOSNAME:=true 1.153 +endif 1.154 +# Newer should be ok 1.155 +ifeq ($(CHECK_MKS87),newer) 1.156 +TRY_DOSNAME:=true 1.157 +endif 1.158 +ifeq ($(TRY_DOSNAME),true) 1.159 +ifeq ($(shell $(UNIXCOMMAND_PATH)dosname -s $(_system_drive)/ 2> $(DEV_NULL)),$(_system_drive)/) 1.160 +_DOSNAME=$(UNIXCOMMAND_PATH)dosname 1.161 +DOSNAME_CMD:=$(_DOSNAME) -s 1.162 +define FullPath 1.163 +$(subst //,/,$(shell echo $1 | $(DOSNAME_CMD) 2> $(DEV_NULL))) 1.164 +endef 1.165 +endif # test dosname -s 1.166 +endif # TRY_DOSNAME 1.167 +endif # MKS 1.168 + 1.169 +# We try to get references to what we need via the default component 1.170 +# environment variables, or what was used historically. 1.171 + 1.172 +# Process Windows values into FullPath values, these paths may have \ chars 1.173 + 1.174 +# System root 1.175 +ifdef SYSTEMROOT 1.176 + xSYSTEMROOT :="$(subst \,/,$(SYSTEMROOT))" 1.177 + _system_root :=$(call FullPath,$(xSYSTEMROOT)) 1.178 +else 1.179 + ifdef SystemRoot 1.180 + xSYSTEMROOT :="$(subst \,/,$(SystemRoot))" 1.181 + _system_root :=$(call FullPath,$(xSYSTEMROOT)) 1.182 + else 1.183 + ifdef WINDIR 1.184 + xWINDIR :="$(subst \,/,$(WINDIR))" 1.185 + _system_root :=$(call FullPath,$(xWINDIR)) 1.186 + else 1.187 + ifdef windir 1.188 + xWINDIR :="$(subst \,/,$(windir))" 1.189 + _system_root :=$(call FullPath,$(xWINDIR)) 1.190 + endif 1.191 + endif 1.192 + endif 1.193 +endif 1.194 +_system_root:=$(call CheckValue,_system_root,$(_system_drive)/WINNT) 1.195 + 1.196 +# Program Files directory 1.197 +ifdef PROGRAMFILES 1.198 + xPROGRAMFILES :="$(subst \,/,$(PROGRAMFILES))" 1.199 +else 1.200 + ifeq ($(ARCH_DATA_MODEL), 32) 1.201 + xPROGRAMFILES :="$(_system_drive)/Program Files" 1.202 + else 1.203 + xPROGRAMFILES :="$(_system_drive)/Program Files (x86)" 1.204 + endif 1.205 +endif 1.206 +ifeq ($(ARCH_DATA_MODEL), 32) 1.207 + _program_files :=$(call FullPath,$(xPROGRAMFILES)) 1.208 +else 1.209 + ifdef PROGRAMW6432 1.210 + xPROGRAMW6432 :="$(subst \,/,$(PROGRAMW6432))" 1.211 + else 1.212 + xPROGRAMW6432 :="$(_system_drive)/Program Files" 1.213 + endif 1.214 + _program_files :=$(call FullPath,$(xPROGRAMW6432)) 1.215 + _program_files32 :=$(call FullPath,$(xPROGRAMFILES)) 1.216 + ifneq ($(word 1,$(_program_files32)),$(_program_files32)) 1.217 + _program_files32:= 1.218 + endif 1.219 +endif 1.220 +ifneq ($(word 1,$(_program_files)),$(_program_files)) 1.221 + _program_files:= 1.222 +endif 1.223 + 1.224 +# Compilers, SDK, and Visual Studio (MSDEV) [32bit is different from 64bit] 1.225 +ifeq ($(ARCH_DATA_MODEL), 32) 1.226 + # Try looking in MSVCDIR or MSVCDir area first (set by vcvars32.bat) 1.227 + ifdef MSVCDIR 1.228 + xMSVCDIR :="$(subst \,/,$(MSVCDIR))" 1.229 + _msvc_dir :=$(call FullPath,$(xMSVCDIR)) 1.230 + else 1.231 + ifdef MSVCDir 1.232 + xMSVCDIR :="$(subst \,/,$(MSVCDir))" 1.233 + _msvc_dir :=$(call FullPath,$(xMSVCDIR)) 1.234 + else 1.235 + ifneq ($(_program_files),) 1.236 + xMSVCDIR :="$(_program_files)/Microsoft Visual Studio .NET 2003/Vc7" 1.237 + _msvc_dir :=$(call FullPath,$(xMSVCDIR)) 1.238 + endif 1.239 + endif 1.240 + endif 1.241 + ifneq ($(subst MSDev98,OLDOLDOLD,$(_msvc_dir)),$(_msvc_dir)) 1.242 + _msvc_dir := 1.243 + endif 1.244 + # If we still don't have it, look for VS71COMNTOOLS, setup by installer? 1.245 + ifeq ($(_msvc_dir),) 1.246 + ifdef VS71COMNTOOLS # /Common/Tools directory, use ../../Vc7 1.247 + xVS71COMNTOOLS :="$(subst \,/,$(VS71COMNTOOLS))" 1.248 + _vs71tools :=$(call FullPath,$(xVS71COMNTOOLS)) 1.249 + endif 1.250 + ifneq ($(_vs71tools),) 1.251 + _msvc_dir :=$(_vs71tools)/../../Vc7 1.252 + endif 1.253 + endif 1.254 + ifneq ($(_msvc_dir),) 1.255 + _compiler_bin :=$(_msvc_dir)/Bin 1.256 + _redist_sdk :=$(_msvc_dir)/../SDK/v1.1/Bin 1.257 + _ms_sdk :=$(_msvc_dir)/PlatformSDK 1.258 + endif 1.259 +endif 1.260 + 1.261 +# The Microsoft Platform SDK installed by itself 1.262 +ifneq ($(_program_files),) 1.263 + xPSDK :="$(_program_files)/Microsoft Platform SDK" 1.264 + _psdk :=$(call FullPath,$(xPSDK)) 1.265 + ifeq ($(_psdk),) 1.266 + xPSDK :="$(_program_files)/Microsoft SDK" 1.267 + _psdk :=$(call FullPath,$(xMSSDK)) 1.268 + endif 1.269 +endif 1.270 + 1.271 +# If no SDK found yet, look in other places 1.272 +ifeq ($(_ms_sdk),) 1.273 + ifdef MSSDK 1.274 + xMSSDK :="$(subst \,/,$(MSSDK))" 1.275 + _ms_sdk :=$(call FullPath,$(xMSSDK)) 1.276 + else 1.277 + ifdef MSSdk 1.278 + xMSSDK :="$(subst \,/,$(MSSdk))" 1.279 + _ms_sdk :=$(call FullPath,$(xMSSDK)) 1.280 + else 1.281 + _ms_sdk :=$(_psdk) 1.282 + endif 1.283 + endif 1.284 +endif 1.285 + 1.286 +# Compilers for 64bit are from SDK 1.287 +ifeq ($(ARCH_DATA_MODEL), 64) 1.288 + ifneq ($(_ms_sdk),) 1.289 + ifeq ($(ARCH), ia64) 1.290 + _compiler_bin :=$(_ms_sdk)/Bin/Win64 1.291 + endif 1.292 + ifeq ($(ARCH), amd64) 1.293 + _compiler_bin :=$(_ms_sdk)/Bin/Win64/x86/$(ARCH) 1.294 + _redist_sdk :=$(_ms_sdk)/redist/win64/AMD64 1.295 + endif 1.296 + endif 1.297 +endif 1.298 + 1.299 +# Location on system where jdk installs might be 1.300 +ifneq ($(_program_files),) 1.301 + USRJDKINSTANCES_PATH =$(_program_files)/Java 1.302 +else 1.303 + USRJDKINSTANCES_PATH =$(_system_drive)/ 1.304 +endif 1.305 + 1.306 +# SLASH_JAVA: location of all network accessable files 1.307 +ifdef ALT_SLASH_JAVA 1.308 + xALT_SLASH_JAVA :="$(subst \,/,$(ALT_SLASH_JAVA))" 1.309 + SLASH_JAVA :=$(call FullPath,$(xALT_SLASH_JAVA)) 1.310 +else 1.311 + ifdef ALT_JDK_JAVA_DRIVE 1.312 + SLASH_JAVA =$(JDK_JAVA_DRIVE) 1.313 + else 1.314 + SLASH_JAVA =J: 1.315 + endif 1.316 +endif 1.317 +SLASH_JAVA:=$(call AltCheckSpaces,SLASH_JAVA) 1.318 +SLASH_JAVA:=$(call AltCheckValue,SLASH_JAVA) 1.319 + 1.320 +# JDK_DEVTOOLS_DIR: common path for all the java devtools 1.321 +ifdef ALT_JDK_DEVTOOLS_DIR 1.322 + xALT_JDK_DEVTOOLS_DIR :="$(subst \,/,$(ALT_JDK_DEVTOOLS_DIR))" 1.323 + JDK_DEVTOOLS_DIR :=$(call FullPath,$(xALT_JDK_DEVTOOLS_DIR)) 1.324 +else 1.325 + JDK_DEVTOOLS_DIR =$(SLASH_JAVA)/devtools 1.326 +endif 1.327 +JDK_DEVTOOLS_DIR:=$(call AltCheckSpaces,JDK_DEVTOOLS_DIR) 1.328 +JDK_DEVTOOLS_DIR:=$(call AltCheckValue,JDK_DEVTOOLS_DIR) 1.329 + 1.330 +# COMPILER_PATH: path to where the compiler and tools are installed. 1.331 +# NOTE: Must end with / so that it could be empty, allowing PATH usage. 1.332 +ifdef ALT_COMPILER_PATH 1.333 + xALT_COMPILER_PATH :="$(subst \,/,$(ALT_COMPILER_PATH))" 1.334 + fxALT_COMPILER_PATH :=$(call FullPath,$(xALT_COMPILER_PATH)) 1.335 + COMPILER_PATH :=$(call PrefixPath,$(fxALT_COMPILER_PATH)) 1.336 +else 1.337 + COMPILER_PATH :=$(call PrefixPath,$(_compiler_bin)) 1.338 +endif 1.339 +COMPILER_PATH :=$(call AltCheckSpaces,COMPILER_PATH) 1.340 + 1.341 +# MSDEVTOOLS_PATH: path to where the additional MS Compiler tools are. 1.342 +# NOTE: Must end with / so that it could be empty, allowing PATH usage. 1.343 +ifdef ALT_MSDEVTOOLS_PATH 1.344 + xALT_MSDEVTOOLS_PATH :="$(subst \,/,$(ALT_MSDEVTOOLS_PATH))" 1.345 + fxALT_MSDEVTOOLS_PATH :=$(call FullPath,$(xALT_MSDEVTOOLS_PATH)) 1.346 + MSDEVTOOLS_PATH :=$(call PrefixPath,$(fxALT_MSDEVTOOLS_PATH)) 1.347 +else 1.348 + ifeq ($(ARCH_DATA_MODEL), 64) 1.349 + ifdef MSTOOLS 1.350 + xMSTOOLS :="$(subst \,/,$(MSTOOLS))" 1.351 + _ms_tools :=$(call FullPath,$(xMSTOOLS)) 1.352 + else 1.353 + ifdef Mstools 1.354 + xMSTOOLS :="$(subst \,/,$(Mstools))" 1.355 + _ms_tools :=$(call FullPath,$(xMSTOOLS)) 1.356 + else 1.357 + _ms_tools := 1.358 + endif 1.359 + endif 1.360 + ifneq ($(_ms_tools),) 1.361 + _ms_tools_bin :=$(_ms_tools)/Bin 1.362 + else 1.363 + # Assumes compiler bin is .../Bin/win64/x86/AMD64, rc.exe is 3 levels up 1.364 + _ms_tools_bin :=$(_compiler_bin)/../../.. 1.365 + endif 1.366 + else 1.367 + _ms_tools_bin :=$(_compiler_bin) 1.368 + endif 1.369 + MSDEVTOOLS_PATH :=$(call PrefixPath,$(_ms_tools_bin)) 1.370 +endif 1.371 +MSDEVTOOLS_PATH:=$(call AltCheckSpaces,MSDEVTOOLS_PATH) 1.372 + 1.373 +# DEVTOOLS_PATH: for other tools required for building (such as zip, etc.) 1.374 +# NOTE: Must end with / so that it could be empty, allowing PATH usage. 1.375 +ifdef ALT_DEVTOOLS_PATH 1.376 + xALT_DEVTOOLS_PATH :="$(subst \,/,$(ALT_DEVTOOLS_PATH))" 1.377 + fxALT_DEVTOOLS_PATH :=$(call FullPath,$(xALT_DEVTOOLS_PATH)) 1.378 + DEVTOOLS_PATH :=$(call PrefixPath,$(fxALT_DEVTOOLS_PATH)) 1.379 +else 1.380 + ifdef USING_CYGWIN 1.381 + DEVTOOLS_PATH :=$(UNIXCOMMAND_PATH) 1.382 + else 1.383 + xDEVTOOLS_PATH :="$(_system_drive)/utils" 1.384 + fxDEVTOOLS_PATH :=$(call FullPath,$(xDEVTOOLS_PATH)) 1.385 + DEVTOOLS_PATH :=$(call PrefixPath,$(fxDEVTOOLS_PATH)) 1.386 + endif 1.387 +endif 1.388 +DEVTOOLS_PATH:=$(call AltCheckSpaces,DEVTOOLS_PATH) 1.389 + 1.390 +# _BOOTDIR1: First choice for a Bootstrap JDK, previous released JDK. 1.391 +# _BOOTDIR2: Second choice 1.392 +ifndef ALT_BOOTDIR 1.393 + _BOOTDIR1 =$(_system_drive)/jdk$(PREVIOUS_JDK_VERSION) 1.394 + _BOOTDIR2 =$(USRJDKINSTANCES_PATH)/jdk$(PREVIOUS_JDK_VERSION) 1.395 +endif 1.396 + 1.397 +# Import JDK images allow for partial builds, components not built are 1.398 +# imported (or copied from) these import areas when needed. 1.399 + 1.400 +# BUILD_JDK_IMPORT_PATH: location of JDK install trees to import for 1.401 +# multiple platforms, e.g. windows-i586, solaris-sparc, linux-586, etc. 1.402 +ifdef ALT_BUILD_JDK_IMPORT_PATH 1.403 + BUILD_JDK_IMPORT_PATH :=$(call FullPath,$(ALT_BUILD_JDK_IMPORT_PATH)) 1.404 +else 1.405 + BUILD_JDK_IMPORT_PATH = $(PROMOTED_BUILD_BINARIES) 1.406 +endif 1.407 +BUILD_JDK_IMPORT_PATH:=$(call AltCheckSpaces,BUILD_JDK_IMPORT_PATH) 1.408 +BUILD_JDK_IMPORT_PATH:=$(call AltCheckValue,BUILD_JDK_IMPORT_PATH) 1.409 + 1.410 +# JDK_IMPORT_PATH: location of previously built JDK (this version) to import 1.411 +ifdef ALT_JDK_IMPORT_PATH 1.412 + JDK_IMPORT_PATH :=$(call FullPath,$(ALT_JDK_IMPORT_PATH)) 1.413 +else 1.414 + JDK_IMPORT_PATH = $(BUILD_JDK_IMPORT_PATH)/$(PLATFORM)-$(ARCH)$(_JDK_IMPORT_VARIANT) 1.415 +endif 1.416 +JDK_IMPORT_PATH:=$(call AltCheckSpaces,JDK_IMPORT_PATH) 1.417 +JDK_IMPORT_PATH:=$(call AltCheckValue,JDK_IMPORT_PATH) 1.418 +