Thu, 19 Mar 2009 13:25:19 -0700
Added tag jdk7-b51 for changeset 3eb8f1047a74
1 #
2 # Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved.
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # This code is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License version 2 only, as
7 # published by the Free Software Foundation. Sun designates this
8 # particular file as subject to the "Classpath" exception as provided
9 # by Sun in the LICENSE file that accompanied this code.
10 #
11 # This code is distributed in the hope that it will be useful, but WITHOUT
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 # version 2 for more details (a copy is included in the LICENSE file that
15 # accompanied this code).
16 #
17 # You should have received a copy of the GNU General Public License version
18 # 2 along with this work; if not, write to the Free Software Foundation,
19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 #
21 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 # CA 95054 USA or visit www.sun.com if you need additional information or
23 # have any questions.
24 #
26 #
27 # Definitions for Windows.
28 #
30 # Default for COMPILER_WARNINGS_FATAL on Windows (C++ compiler warnings)
31 # Level: Default is 3, 0 means none, 4 is the most but may be unreliable
32 # Some makefiles may have set this to 0 to turn off warnings completely,
33 # which also effectively creates a COMPILER_WARNINGS_FATAL=false situation.
34 # Program.gmk may turn this down to 2 (building .exe's).
35 # Windows 64bit platforms are less likely to be warning free.
36 # Historically, Windows 32bit builds should be mostly warning free.
37 ifndef COMPILER_WARNING_LEVEL
38 COMPILER_WARNING_LEVEL=3
39 endif
40 ifndef COMPILER_WARNINGS_FATAL
41 COMPILER_WARNINGS_FATAL=false
42 endif
44 # Windows should use parallel compilation for best build times
45 ifndef COMPILE_APPROACH
46 COMPILE_APPROACH = normal
47 endif
49 # Indication that we are doing an incremental build.
50 # This may trigger the creation of make depend files.
51 # (This may not be working on windows yet, always force to false.)
52 override INCREMENTAL_BUILD = false
54 # WARNING: This is extremely touch stuff, between CYGWIN vs. MKS and all
55 # variations of MKS and CYGWIN releases, and 32bit vs 64bit,
56 # this file can give you nightmares.
57 #
58 # Notes:
59 # Keep all paths in the windows "mixed" style except CYGWIN UNXIXCOMMAND_PATH.
60 # Use of PrefixPath is critical, some variables must end with / (see NOTE).
61 # Use of quotes is critical due to possible spaces in paths coming from
62 # the environment variables, be careful.
63 # First convert \ to / with subst, keep it quoted due to blanks, then
64 # use cygpath -s or dosname -s to get the short non-blank name.
65 # If the MKS is old and doesn't have a dosname -s, you will be forced
66 # to set ALT variables with the short non-space directory names.
67 # If dosname doesn't appear to work, we won't use it.
68 # The dosname utility also wants to accept stdin if it is not supplied
69 # any path on the command line, this is really dangerous when using
70 # make variables that can easily become empty, so I use:
71 # echo $1 | dosname -s instead of dosname -s $1
72 # to prevent dosname from hanging up the make process when $1 is empty.
73 # The cygpath utility does not have this problem.
74 # The ALT values should never really have spaces or use \.
75 # Suspect these environment variables to have spaces and/or \ characters:
76 # SYSTEMROOT, SystemRoot, WINDIR, windir, PROGRAMFILES, ProgramFiles,
77 # MSTOOLS, Mstools, MSSDK, MSSdk, VC71COMNTOOLS,
78 # MSVCDIR, MSVCDir.
79 # So use $(subst \,/,) on them first adding quotes and placing them in
80 # their own variable assigned with :=, then use FullPath.
81 #
83 # Use FullPath to get C:/ style non-spaces path. Never ends with a /!
84 ifdef USING_CYGWIN
85 # We assume cygpath is available in the search path
86 # NOTE: Use of 'pwd' with CYGWIN will not get you a mixed style path!
87 CYGPATH_CMD=cygpath -a -s -m
88 define FullPath
89 $(shell $(CYGPATH_CMD) $1 2> $(DEV_NULL))
90 endef
91 define OptFullPath
92 $(shell if [ "$1" != "" -a -d "$1" ]; then $(CYGPATH_CMD) "$1"; else echo "$1"; fi)
93 endef
94 else
95 # Temporary until we upgrade to MKS 8.7, MKS pwd returns mixed mode path
96 define FullPath
97 $(shell cd $1 2> $(DEV_NULL) && pwd)
98 endef
99 define OptFullPath
100 $(shell if [ "$1" != "" -a -d "$1" ]; then (cd $1 && pwd); else echo "$1"; fi)
101 endef
102 endif
104 # System drive
105 ifdef SYSTEMDRIVE
106 _system_drive =$(SYSTEMDRIVE)
107 else
108 ifdef SystemDrive
109 _system_drive =$(SystemDrive)
110 endif
111 endif
112 _system_drive:=$(call CheckValue,_system_drive,C:)
114 # UNIXCOMMAND_PATH: path to where the most common Unix commands are.
115 # NOTE: Must end with / so that it could be empty, allowing PATH usage.
116 ifdef ALT_UNIXCOMMAND_PATH
117 xALT_UNIXCOMMAND_PATH :="$(subst \,/,$(ALT_UNIXCOMMAND_PATH))"
118 fxALT_UNIXCOMMAND_PATH :=$(call FullPath,$(xALT_UNIXCOMMAND_PATH))
119 UNIXCOMMAND_PATH :=$(call PrefixPath,$(fxALT_UNIXCOMMAND_PATH))
120 else
121 ifdef USING_CYGWIN
122 UNIXCOMMAND_PATH :=$(call PrefixPath,/usr/bin)
123 else
124 ifdef ROOTDIR
125 xROOTDIR :="$(subst \,/,$(ROOTDIR))"
126 _rootdir :=$(call FullPath,$(xROOTDIR))
127 else
128 xROOTDIR :="$(_system_drive)/mksnt"
129 _rootdir :=$(call FullPath,$(xROOTDIR))
130 endif
131 ifneq ($(_rootdir),)
132 UNIXCOMMAND_PATH :=$(call PrefixPath,$(_rootdir)/mksnt)
133 endif
134 endif
135 endif
136 UNIXCOMMAND_PATH:=$(call AltCheckSpaces,UNIXCOMMAND_PATH)
138 # Get version of MKS or CYGWIN
139 ifdef USING_CYGWIN
140 _CYGWIN_VER :=$(shell $(UNAME))
141 CYGWIN_VER :=$(call GetVersion,$(_CYGWIN_VER))
142 else # MKS
143 _MKS_VER :=$(shell $(MKSINFO) 2>&1 | $(GREP) Release | $(TAIL) -1 | $(SED) -e 's@.*\(Release.*\)@\1@')
144 MKS_VER :=$(call GetVersion,$(_MKS_VER))
145 # At this point, we can re-define FullPath to use DOSNAME_CMD
146 CHECK_MKS87:=$(call CheckVersions,$(MKS_VER),8.7)
147 TRY_DOSNAME:=false
148 ifeq ($(CHECK_MKS87),same)
149 TRY_DOSNAME:=true
150 endif
151 # Newer should be ok
152 ifeq ($(CHECK_MKS87),newer)
153 TRY_DOSNAME:=true
154 endif
155 ifeq ($(TRY_DOSNAME),true)
156 ifeq ($(shell $(UNIXCOMMAND_PATH)dosname -s $(_system_drive)/ 2> $(DEV_NULL)),$(_system_drive)/)
157 _DOSNAME=$(UNIXCOMMAND_PATH)dosname
158 DOSNAME_CMD:=$(_DOSNAME) -s
159 define FullPath
160 $(subst //,/,$(shell echo $1 | $(DOSNAME_CMD) 2> $(DEV_NULL)))
161 endef
162 endif # test dosname -s
163 endif # TRY_DOSNAME
164 endif # MKS
166 # We try to get references to what we need via the default component
167 # environment variables, or what was used historically.
169 # Process Windows values into FullPath values, these paths may have \ chars
171 # System root
172 ifdef SYSTEMROOT
173 xSYSTEMROOT :="$(subst \,/,$(SYSTEMROOT))"
174 _system_root :=$(call FullPath,$(xSYSTEMROOT))
175 else
176 ifdef SystemRoot
177 xSYSTEMROOT :="$(subst \,/,$(SystemRoot))"
178 _system_root :=$(call FullPath,$(xSYSTEMROOT))
179 else
180 ifdef WINDIR
181 xWINDIR :="$(subst \,/,$(WINDIR))"
182 _system_root :=$(call FullPath,$(xWINDIR))
183 else
184 ifdef windir
185 xWINDIR :="$(subst \,/,$(windir))"
186 _system_root :=$(call FullPath,$(xWINDIR))
187 endif
188 endif
189 endif
190 endif
191 _system_root:=$(call CheckValue,_system_root,$(_system_drive)/WINNT)
193 # Program Files directory
194 ifdef PROGRAMFILES
195 xPROGRAMFILES :="$(subst \,/,$(PROGRAMFILES))"
196 else
197 ifeq ($(ARCH_DATA_MODEL), 32)
198 xPROGRAMFILES :="$(_system_drive)/Program Files"
199 else
200 xPROGRAMFILES :="$(_system_drive)/Program Files (x86)"
201 endif
202 endif
203 ifeq ($(ARCH_DATA_MODEL), 32)
204 _program_files :=$(call FullPath,$(xPROGRAMFILES))
205 else
206 ifdef PROGRAMW6432
207 xPROGRAMW6432 :="$(subst \,/,$(PROGRAMW6432))"
208 else
209 xPROGRAMW6432 :="$(_system_drive)/Program Files"
210 endif
211 _program_files :=$(call FullPath,$(xPROGRAMW6432))
212 _program_files32 :=$(call FullPath,$(xPROGRAMFILES))
213 ifneq ($(word 1,$(_program_files32)),$(_program_files32))
214 _program_files32:=
215 endif
216 endif
217 ifneq ($(word 1,$(_program_files)),$(_program_files))
218 _program_files:=
219 endif
221 # Compilers, SDK, and Visual Studio (MSDEV) [32bit is different from 64bit]
222 ifeq ($(ARCH_DATA_MODEL), 32)
223 # Try looking in MSVCDIR or MSVCDir area first (set by vcvars32.bat)
224 ifdef MSVCDIR
225 xMSVCDIR :="$(subst \,/,$(MSVCDIR))"
226 _msvc_dir :=$(call FullPath,$(xMSVCDIR))
227 else
228 ifdef MSVCDir
229 xMSVCDIR :="$(subst \,/,$(MSVCDir))"
230 _msvc_dir :=$(call FullPath,$(xMSVCDIR))
231 else
232 ifneq ($(_program_files),)
233 xMSVCDIR :="$(_program_files)/Microsoft Visual Studio .NET 2003/Vc7"
234 _msvc_dir :=$(call FullPath,$(xMSVCDIR))
235 endif
236 endif
237 endif
238 ifneq ($(subst MSDev98,OLDOLDOLD,$(_msvc_dir)),$(_msvc_dir))
239 _msvc_dir :=
240 endif
241 # If we still don't have it, look for VS71COMNTOOLS, setup by installer?
242 ifeq ($(_msvc_dir),)
243 ifdef VS71COMNTOOLS # /Common/Tools directory, use ../../Vc7
244 xVS71COMNTOOLS :="$(subst \,/,$(VS71COMNTOOLS))"
245 _vs71tools :=$(call FullPath,$(xVS71COMNTOOLS))
246 endif
247 ifneq ($(_vs71tools),)
248 _msvc_dir :=$(_vs71tools)/../../Vc7
249 endif
250 endif
251 ifneq ($(_msvc_dir),)
252 _compiler_bin :=$(_msvc_dir)/Bin
253 _redist_sdk :=$(_msvc_dir)/../SDK/v1.1/Bin
254 _ms_sdk :=$(_msvc_dir)/PlatformSDK
255 endif
256 endif
258 # The Microsoft Platform SDK installed by itself
259 ifneq ($(_program_files),)
260 xPSDK :="$(_program_files)/Microsoft Platform SDK"
261 _psdk :=$(call FullPath,$(xPSDK))
262 ifeq ($(_psdk),)
263 xPSDK :="$(_program_files)/Microsoft SDK"
264 _psdk :=$(call FullPath,$(xMSSDK))
265 endif
266 endif
268 # If no SDK found yet, look in other places
269 ifeq ($(_ms_sdk),)
270 ifdef MSSDK
271 xMSSDK :="$(subst \,/,$(MSSDK))"
272 _ms_sdk :=$(call FullPath,$(xMSSDK))
273 else
274 ifdef MSSdk
275 xMSSDK :="$(subst \,/,$(MSSdk))"
276 _ms_sdk :=$(call FullPath,$(xMSSDK))
277 else
278 _ms_sdk :=$(_psdk)
279 endif
280 endif
281 endif
283 # Compilers for 64bit are from SDK
284 ifeq ($(ARCH_DATA_MODEL), 64)
285 xMSSDK61 :="C:/Program Files/Microsoft SDKs/Windows/v6.1/"
286 MSSDK61 :=$(call FullPath,$(xMSSDK61))
287 xVS2008 :="C:/Program Files (x86)/Microsoft Visual Studio 9.0/"
288 _vs2008 :=$(call FullPath,$(xVS2008))
289 ifneq ($(_vs2008),)
290 ifeq ($(ARCH), ia64)
291 _compiler_bin :=$(_vs2008)/VC/Bin/x86_ia64
292 endif
293 ifeq ($(ARCH), amd64)
294 _compiler_bin :=$(_vs2008)/VC/Bin/$(ARCH)
295 _redist_sdk :=$(MSSDK61)/VC/redist
296 endif
297 else
298 ifneq ($(_ms_sdk),)
299 ifeq ($(ARCH), ia64)
300 _compiler_bin :=$(_ms_sdk)/Bin/Win64
301 endif
302 ifeq ($(ARCH), amd64)
303 _compiler_bin :=$(_ms_sdk)/Bin/Win64/x86/$(ARCH)
304 _redist_sdk :=$(_ms_sdk)/redist/win64/AMD64
305 endif
306 endif
307 endif
308 endif
310 # Location on system where jdk installs might be
311 ifneq ($(_program_files),)
312 USRJDKINSTANCES_PATH =$(_program_files)/Java
313 else
314 USRJDKINSTANCES_PATH =$(_system_drive)/
315 endif
317 # SLASH_JAVA: location of all network accessable files
318 ifdef ALT_SLASH_JAVA
319 xALT_SLASH_JAVA :="$(subst \,/,$(ALT_SLASH_JAVA))"
320 SLASH_JAVA :=$(call FullPath,$(xALT_SLASH_JAVA))
321 else
322 ifdef ALT_JDK_JAVA_DRIVE
323 SLASH_JAVA =$(JDK_JAVA_DRIVE)
324 else
325 SLASH_JAVA =J:
326 endif
327 endif
328 SLASH_JAVA:=$(call AltCheckSpaces,SLASH_JAVA)
329 SLASH_JAVA:=$(call AltCheckValue,SLASH_JAVA)
331 # JDK_DEVTOOLS_DIR: common path for all the java devtools
332 ifdef ALT_JDK_DEVTOOLS_DIR
333 xALT_JDK_DEVTOOLS_DIR :="$(subst \,/,$(ALT_JDK_DEVTOOLS_DIR))"
334 JDK_DEVTOOLS_DIR :=$(call FullPath,$(xALT_JDK_DEVTOOLS_DIR))
335 else
336 JDK_DEVTOOLS_DIR =$(SLASH_JAVA)/devtools
337 endif
338 JDK_DEVTOOLS_DIR:=$(call AltCheckSpaces,JDK_DEVTOOLS_DIR)
339 JDK_DEVTOOLS_DIR:=$(call AltCheckValue,JDK_DEVTOOLS_DIR)
341 # COMPILER_PATH: path to where the compiler and tools are installed.
342 # NOTE: Must end with / so that it could be empty, allowing PATH usage.
343 ifdef ALT_COMPILER_PATH
344 xALT_COMPILER_PATH :="$(subst \,/,$(ALT_COMPILER_PATH))"
345 fxALT_COMPILER_PATH :=$(call FullPath,$(xALT_COMPILER_PATH))
346 COMPILER_PATH :=$(call PrefixPath,$(fxALT_COMPILER_PATH))
347 else
348 COMPILER_PATH :=$(call PrefixPath,$(_compiler_bin))
349 endif
350 COMPILER_PATH :=$(call AltCheckSpaces,COMPILER_PATH)
352 # MSDEVTOOLS_PATH: path to where the additional MS Compiler tools are.
353 # NOTE: Must end with / so that it could be empty, allowing PATH usage.
354 ifdef ALT_MSDEVTOOLS_PATH
355 xALT_MSDEVTOOLS_PATH :="$(subst \,/,$(ALT_MSDEVTOOLS_PATH))"
356 fxALT_MSDEVTOOLS_PATH :=$(call FullPath,$(xALT_MSDEVTOOLS_PATH))
357 MSDEVTOOLS_PATH :=$(call PrefixPath,$(fxALT_MSDEVTOOLS_PATH))
358 else
359 ifeq ($(ARCH_DATA_MODEL), 64)
360 ifdef MSTOOLS
361 xMSTOOLS :="$(subst \,/,$(MSTOOLS))"
362 _ms_tools :=$(call FullPath,$(xMSTOOLS))
363 else
364 ifdef Mstools
365 xMSTOOLS :="$(subst \,/,$(Mstools))"
366 _ms_tools :=$(call FullPath,$(xMSTOOLS))
367 else
368 _ms_tools :=
369 endif
370 endif
371 ifneq ($(_ms_tools),)
372 _ms_tools_bin :=$(_ms_tools)/Bin
373 else
374 # Assumes compiler bin is .../Bin/win64/x86/AMD64, rc.exe is 3 levels up
375 _ms_tools_bin :=$(_compiler_bin)/../../..
376 endif
377 else
378 _ms_tools_bin :=$(_compiler_bin)
379 endif
380 MSDEVTOOLS_PATH :=$(call PrefixPath,$(_ms_tools_bin))
381 endif
382 MSDEVTOOLS_PATH:=$(call AltCheckSpaces,MSDEVTOOLS_PATH)
384 # DEVTOOLS_PATH: for other tools required for building (such as zip, etc.)
385 # NOTE: Must end with / so that it could be empty, allowing PATH usage.
386 ifdef ALT_DEVTOOLS_PATH
387 xALT_DEVTOOLS_PATH :="$(subst \,/,$(ALT_DEVTOOLS_PATH))"
388 fxALT_DEVTOOLS_PATH :=$(call FullPath,$(xALT_DEVTOOLS_PATH))
389 DEVTOOLS_PATH :=$(call PrefixPath,$(fxALT_DEVTOOLS_PATH))
390 else
391 ifdef USING_CYGWIN
392 DEVTOOLS_PATH :=$(UNIXCOMMAND_PATH)
393 else
394 xDEVTOOLS_PATH :="$(_system_drive)/utils"
395 fxDEVTOOLS_PATH :=$(call FullPath,$(xDEVTOOLS_PATH))
396 DEVTOOLS_PATH :=$(call PrefixPath,$(fxDEVTOOLS_PATH))
397 endif
398 endif
399 DEVTOOLS_PATH:=$(call AltCheckSpaces,DEVTOOLS_PATH)
401 # _BOOTDIR1: First choice for a Bootstrap JDK, previous released JDK.
402 # _BOOTDIR2: Second choice
403 ifndef ALT_BOOTDIR
404 _BOOTDIR1 =$(_system_drive)/jdk$(PREVIOUS_JDK_VERSION)
405 _BOOTDIR2 =$(USRJDKINSTANCES_PATH)/jdk$(PREVIOUS_JDK_VERSION)
406 endif
408 # Import JDK images allow for partial builds, components not built are
409 # imported (or copied from) these import areas when needed.
411 # BUILD_JDK_IMPORT_PATH: location of JDK install trees to import for
412 # multiple platforms, e.g. windows-i586, solaris-sparc, linux-586, etc.
413 ifdef ALT_BUILD_JDK_IMPORT_PATH
414 BUILD_JDK_IMPORT_PATH :=$(call FullPath,$(ALT_BUILD_JDK_IMPORT_PATH))
415 else
416 BUILD_JDK_IMPORT_PATH = $(PROMOTED_BUILD_BINARIES)
417 endif
418 BUILD_JDK_IMPORT_PATH:=$(call AltCheckSpaces,BUILD_JDK_IMPORT_PATH)
419 BUILD_JDK_IMPORT_PATH:=$(call AltCheckValue,BUILD_JDK_IMPORT_PATH)
421 # JDK_IMPORT_PATH: location of previously built JDK (this version) to import
422 ifdef ALT_JDK_IMPORT_PATH
423 JDK_IMPORT_PATH :=$(call FullPath,$(ALT_JDK_IMPORT_PATH))
424 else
425 JDK_IMPORT_PATH = $(BUILD_JDK_IMPORT_PATH)/$(PLATFORM)-$(ARCH)$(_JDK_IMPORT_VARIANT)
426 endif
427 JDK_IMPORT_PATH:=$(call AltCheckSpaces,JDK_IMPORT_PATH)
428 JDK_IMPORT_PATH:=$(call AltCheckValue,JDK_IMPORT_PATH)