comparison make/common/Defs-windows.gmk @ 2324:7bbb5f3b6eed

6931180: Migration to recent versions of MS Platform SDK 6944048: VS2010 build failure in make/com/sun/java/pack: missing unpack200.exe.manifest 6944015: VS2010 build failure in awt_TextArea.cpp: ambiguous call to abs() 6936319: JDK build fails in awt_DnDDS.cpp with Visual Studio 2008/Platform SDK 7 6944516: Windows L&F is broken in SwingSet2, when JDK is built with the recent Windows SDK Summary: Changes to enable building JDK7 with Microsoft Visual Studio 2010 Reviewed-by: ohair, art, ccheung, dcubed
author prr
date Tue, 11 May 2010 14:36:10 -0700
parents 53b27ac4f706
children 00cd9dc3c2b5
comparison
equal deleted inserted replaced
13:f04faf5b9fda 14:e28b6827dfed
84 ifeq ($(COMPILER_VERSION), VS2008) 84 ifeq ($(COMPILER_VERSION), VS2008)
85 MSVCRNN_DLL = msvcr90.dll 85 MSVCRNN_DLL = msvcr90.dll
86 MSVCPNN_DLL = msvcp90.dll 86 MSVCPNN_DLL = msvcp90.dll
87 MS_RUNTIME_LIBRARIES += $(MSVCRNN_DLL) 87 MS_RUNTIME_LIBRARIES += $(MSVCRNN_DLL)
88 endif 88 endif
89 ifeq ($(COMPILER_VERSION), VS2010)
90 MSVCRNN_DLL = msvcr100.dll
91 MSVCPNN_DLL = msvcp100.dll
92 MS_RUNTIME_LIBRARIES += $(MSVCRNN_DLL)
93 endif
89 endif 94 endif
90 95
91 ifeq ($(ARCH_DATA_MODEL), 64) 96 ifeq ($(ARCH_DATA_MODEL), 64)
92 ifeq ($(COMPILER_VERSION), VS2008) 97 ifeq ($(COMPILER_VERSION), VS2008)
93 MSVCRNN_DLL = msvcr90.dll 98 MSVCRNN_DLL = msvcr90.dll
94 MSVCPNN_DLL = msvcp90.dll 99 MSVCPNN_DLL = msvcp90.dll
100 MS_RUNTIME_LIBRARIES += $(MSVCRNN_DLL)
101 endif
102 ifeq ($(COMPILER_VERSION), VS2010)
103 MSVCRNN_DLL = msvcr100.dll
104 MSVCPNN_DLL = msvcp100.dll
95 MS_RUNTIME_LIBRARIES += $(MSVCRNN_DLL) 105 MS_RUNTIME_LIBRARIES += $(MSVCRNN_DLL)
96 endif 106 endif
97 endif 107 endif
98 108
99 EXTRA_LFLAGS += /LIBPATH:$(DXSDK_LIB_PATH) 109 EXTRA_LFLAGS += /LIBPATH:$(DXSDK_LIB_PATH)
153 ifeq ($(COMPILER_VERSION), VC6) 163 ifeq ($(COMPILER_VERSION), VC6)
154 # VC6 (6.2) msvc compiler (the way Tiger and early Mustang were built) 164 # VC6 (6.2) msvc compiler (the way Tiger and early Mustang were built)
155 # Automatic precompiled header option to use (if COMPILE_APPROACH=batch) 165 # Automatic precompiled header option to use (if COMPILE_APPROACH=batch)
156 AUTOMATIC_PCH_OPTION = 166 AUTOMATIC_PCH_OPTION =
157 GX_OPTION = -GX 167 GX_OPTION = -GX
168 GZ_OPTION = -GZ
158 ifeq ($(ARCH_DATA_MODEL), 32) 169 ifeq ($(ARCH_DATA_MODEL), 32)
159 CC_OPT/HIGHEST = -Ox -Gy -Os -GB 170 CC_OPT/HIGHEST = -Ox -Gy -Os -GB
160 CC_OPT/HIGHER = -Ox -Gy -Os -GB 171 CC_OPT/HIGHER = -Ox -Gy -Os -GB
161 CC_OPT/LOWER = -Ox -Gy -Os -GB 172 CC_OPT/LOWER = -Ox -Gy -Os -GB
162 else 173 else
169 ifeq ($(COMPILER_VERSION), VS2003) 180 ifeq ($(COMPILER_VERSION), VS2003)
170 # Automatic precompiled header option to use (if COMPILE_APPROACH=batch) 181 # Automatic precompiled header option to use (if COMPILE_APPROACH=batch)
171 AUTOMATIC_PCH_OPTION = -YX 182 AUTOMATIC_PCH_OPTION = -YX
172 # Also known as VC7 compiler 183 # Also known as VC7 compiler
173 GX_OPTION = -GX 184 GX_OPTION = -GX
185 GZ_OPTION = -GZ
174 ifeq ($(ARCH_DATA_MODEL), 32) 186 ifeq ($(ARCH_DATA_MODEL), 32)
175 # Lowered opt level to try and reduce footprint, dll size especially. 187 # Lowered opt level to try and reduce footprint, dll size especially.
176 # Was: CC_OPT/HIGHEST = -O2 -G6 188 # Was: CC_OPT/HIGHEST = -O2 -G6
177 # Was: CC_OPT/HIGHER = -O2 189 # Was: CC_OPT/HIGHER = -O2
178 CC_OPT/HIGHEST = -O2 190 CC_OPT/HIGHEST = -O2
188 ifeq ($(COMPILER_VERSION), VS2005) 200 ifeq ($(COMPILER_VERSION), VS2005)
189 # Automatic precompiled header option to use (if COMPILE_APPROACH=batch) 201 # Automatic precompiled header option to use (if COMPILE_APPROACH=batch)
190 AUTOMATIC_PCH_OPTION = 202 AUTOMATIC_PCH_OPTION =
191 # VS2005 compiler, only with Platform SDK right now? 203 # VS2005 compiler, only with Platform SDK right now?
192 GX_OPTION = -EHsc 204 GX_OPTION = -EHsc
205 GZ_OPTION = -RTC1
193 ifeq ($(ARCH_DATA_MODEL), 32) 206 ifeq ($(ARCH_DATA_MODEL), 32)
194 CC_OPT/HIGHEST = -O2 207 CC_OPT/HIGHEST = -O2
195 CC_OPT/HIGHER = -O1 208 CC_OPT/HIGHER = -O1
196 CC_OPT/LOWER = -O1 209 CC_OPT/LOWER = -O1
197 else 210 else
202 endif 215 endif
203 ifeq ($(COMPILER_VERSION), VS2008) 216 ifeq ($(COMPILER_VERSION), VS2008)
204 # Automatic precompiled header option to use (if COMPILE_APPROACH=batch) 217 # Automatic precompiled header option to use (if COMPILE_APPROACH=batch)
205 AUTOMATIC_PCH_OPTION = 218 AUTOMATIC_PCH_OPTION =
206 GX_OPTION = -EHsc 219 GX_OPTION = -EHsc
220 GZ_OPTION = -RTC1
221 ifeq ($(ARCH_DATA_MODEL), 32)
222 CC_OPT/HIGHEST = -O2
223 CC_OPT/HIGHER = -O1
224 CC_OPT/LOWER = -O1
225 else
226 CC_OPT/HIGHEST = -O2
227 CC_OPT/HIGHER = -O1
228 CC_OPT/LOWER = -O1
229 endif
230 endif
231
232 ifeq ($(COMPILER_VERSION), VS2010)
233 # Automatic precompiled header option to use (if COMPILE_APPROACH=batch)
234 AUTOMATIC_PCH_OPTION =
235 GX_OPTION = -EHsc
236 GZ_OPTION = -RTC1
207 ifeq ($(ARCH_DATA_MODEL), 32) 237 ifeq ($(ARCH_DATA_MODEL), 32)
208 CC_OPT/HIGHEST = -O2 238 CC_OPT/HIGHEST = -O2
209 CC_OPT/HIGHER = -O1 239 CC_OPT/HIGHER = -O1
210 CC_OPT/LOWER = -O1 240 CC_OPT/LOWER = -O1
211 else 241 else
280 # 310 #
281 CFLAGS_COMMON += -Zi -nologo 311 CFLAGS_COMMON += -Zi -nologo
282 CFLAGS_OPT = $(CC_OPT) 312 CFLAGS_OPT = $(CC_OPT)
283 CFLAGS_DBG = -Od $(MS_RUNTIME_DEBUG_OPTION) 313 CFLAGS_DBG = -Od $(MS_RUNTIME_DEBUG_OPTION)
284 314
315 # REMIND: I don't see where CFLAGS_VS2005 is used. I suspect its
316 # pulled in as a combined "CFLAGS_$(COMPILER_VERSION)" string
317 # but the lack of this isn't causing any apparent build problems
318 # with VS 2010 but it could be causing compiler warnings.
319 # For now, I will add it for all cases :
320 CFLAGS_VS2010 += -Zc:wchar_t-
321 #
285 # Starting from VS2005 the wchar_t is handled as a built-in C/C++ data type 322 # Starting from VS2005 the wchar_t is handled as a built-in C/C++ data type
286 # by default. However, we expect the wchar_t to be a typedef to the 323 # by default. However, we expect the wchar_t to be a typedef to the
287 # unsigned short data type. The -Zc:wchar_t- option restores the old 324 # unsigned short data type. The -Zc:wchar_t- option restores the old
288 # behavior (as seen in VS2003) to avoid massive code modifications. 325 # behavior (as seen in VS2003) to avoid massive code modifications.
289 # When/if our code will be "C/C++ Standard"-compliant (at least in the area 326 # When/if our code will be "C/C++ Standard"-compliant (at least in the area
315 # Always add bufferoverflowU.lib to VS2005 link commands (pack uses LDDFLAGS) 352 # Always add bufferoverflowU.lib to VS2005 link commands (pack uses LDDFLAGS)
316 LFLAGS_VS2005 = $(BUFFEROVERFLOWLIB) 353 LFLAGS_VS2005 = $(BUFFEROVERFLOWLIB)
317 354
318 # VS2008 has bufferoverflow baked in: 355 # VS2008 has bufferoverflow baked in:
319 LFLAGS_VS2008 = 356 LFLAGS_VS2008 =
357 LFLAGS_VS2010 =
320 358
321 # LFLAGS are the flags given to $(LINK) and used to build the actual DLL file 359 # LFLAGS are the flags given to $(LINK) and used to build the actual DLL file
322 BASELFLAGS = -nologo /opt:REF /incremental:no 360 BASELFLAGS = -nologo /opt:REF /incremental:no
323 ifdef MT 361 ifdef MT
324 # VS2005, VS2008, and beyond: ask LINK to generate manifests for .dll & .exe 362 # VS2005, VS2008, and beyond: ask LINK to generate manifests for .dll & .exe