annotate 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
rev   line source
duke@0 1 #
herrick@1365 2 # Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved.
duke@0 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@0 4 #
duke@0 5 # This code is free software; you can redistribute it and/or modify it
duke@0 6 # under the terms of the GNU General Public License version 2 only, as
duke@0 7 # published by the Free Software Foundation. Sun designates this
duke@0 8 # particular file as subject to the "Classpath" exception as provided
duke@0 9 # by Sun in the LICENSE file that accompanied this code.
duke@0 10 #
duke@0 11 # This code is distributed in the hope that it will be useful, but WITHOUT
duke@0 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@0 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@0 14 # version 2 for more details (a copy is included in the LICENSE file that
duke@0 15 # accompanied this code).
duke@0 16 #
duke@0 17 # You should have received a copy of the GNU General Public License version
duke@0 18 # 2 along with this work; if not, write to the Free Software Foundation,
duke@0 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@0 20 #
duke@0 21 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
duke@0 22 # CA 95054 USA or visit www.sun.com if you need additional information or
duke@0 23 # have any questions.
duke@0 24 #
duke@0 25
duke@0 26 #
duke@0 27 # Makefile to specify compiler flags for programs and libraries
duke@0 28 # targeted to Windows builds. Should not contain any rules.
duke@0 29 #
duke@0 30 # WARNING: This file is shared with other workspaces.
duke@0 31 # So when it includes other files, it must use JDK_TOPDIR.
duke@0 32 #
duke@0 33
duke@0 34 # Get shared JDK settings
duke@0 35 include $(JDK_MAKE_SHARED_DIR)/Defs.gmk
duke@0 36
duke@0 37 # CC compiler object code output directive flag value
duke@0 38 CC_OBJECT_OUTPUT_FLAG = -Fo
duke@0 39 CC_PROGRAM_OUTPUT_FLAG = -Fe
duke@0 40
duke@0 41 # The suffix applied to the library name for FDLIBM
duke@0 42 FDDLIBM_SUFFIX = lib
duke@0 43 # The suffix applied to scripts (.bat for windows, nothing for unix)
duke@0 44 SCRIPT_SUFFIX = .bat
duke@0 45
duke@0 46 HPIS = windows
duke@0 47 # LIB_LOCATION, which for windows identifies where .exe files go, may be
duke@0 48 # set by each GNUmakefile. The default is BINDIR.
duke@0 49 ifndef LIB_LOCATION
duke@0 50 LIB_LOCATION = $(BINDIR)
duke@0 51 endif # LIB_LOCATION
duke@0 52
duke@0 53 ifndef PLATFORM_SRC
ohair@7 54 PLATFORM_SRC = $(BUILDDIR)/../src/windows
duke@0 55 endif # PLATFORM_SRC
duke@0 56
duke@0 57 # Platform specific closed sources
duke@0 58 ifndef OPENJDK
duke@0 59 ifndef CLOSED_PLATFORM_SRC
ohair@7 60 CLOSED_PLATFORM_SRC = $(BUILDDIR)/../src/closed/windows
duke@0 61 endif
duke@0 62 endif
duke@0 63
duke@0 64 # for backwards compatability, the old "win32" is used here instead of
duke@0 65 # the more proper "windows"
duke@0 66 PLATFORM_INCLUDE_NAME = win32
duke@0 67 PLATFORM_INCLUDE = $(INCLUDEDIR)/$(PLATFORM_INCLUDE_NAME)
duke@0 68
duke@0 69 # The following DLL's are considered MS runtime libraries and should
duke@0 70 # not to be REBASEd, see deploy/make/common/Release.gmk.
tbell@795 71 # msvcrt.dll, msvcrnn.dll [msvcr71 or msvcr80 or msvcr90] : Microsoft runtimes
duke@0 72 MS_RUNTIME_LIBRARIES = msvcrt.dll
duke@0 73 ifeq ($(ARCH_DATA_MODEL), 32)
duke@0 74 ifeq ($(COMPILER_VERSION), VS2003)
tbell@795 75 MSVCRNN_DLL = msvcr71.dll
tbell@795 76 MSVCPNN_DLL = msvcp71.dll
tbell@795 77 MS_RUNTIME_LIBRARIES += $(MSVCRNN_DLL)
tbell@795 78 endif
tbell@795 79 ifeq ($(COMPILER_VERSION), VS2005)
tbell@795 80 MSVCRNN_DLL = msvcr80.dll
tbell@795 81 MSVCPNN_DLL = msvcp80.dll
tbell@795 82 MS_RUNTIME_LIBRARIES += $(MSVCRNN_DLL)
tbell@795 83 endif
tbell@795 84 ifeq ($(COMPILER_VERSION), VS2008)
tbell@795 85 MSVCRNN_DLL = msvcr90.dll
tbell@795 86 MSVCPNN_DLL = msvcp90.dll
tbell@795 87 MS_RUNTIME_LIBRARIES += $(MSVCRNN_DLL)
duke@0 88 endif
prr@2324 89 ifeq ($(COMPILER_VERSION), VS2010)
prr@2324 90 MSVCRNN_DLL = msvcr100.dll
prr@2324 91 MSVCPNN_DLL = msvcp100.dll
prr@2324 92 MS_RUNTIME_LIBRARIES += $(MSVCRNN_DLL)
prr@2324 93 endif
duke@0 94 endif
duke@0 95
ohair@942 96 ifeq ($(ARCH_DATA_MODEL), 64)
ohair@942 97 ifeq ($(COMPILER_VERSION), VS2008)
ohair@942 98 MSVCRNN_DLL = msvcr90.dll
ohair@942 99 MSVCPNN_DLL = msvcp90.dll
ohair@942 100 MS_RUNTIME_LIBRARIES += $(MSVCRNN_DLL)
ohair@942 101 endif
prr@2324 102 ifeq ($(COMPILER_VERSION), VS2010)
prr@2324 103 MSVCRNN_DLL = msvcr100.dll
prr@2324 104 MSVCPNN_DLL = msvcp100.dll
prr@2324 105 MS_RUNTIME_LIBRARIES += $(MSVCRNN_DLL)
prr@2324 106 endif
ohair@942 107 endif
duke@0 108
duke@0 109 EXTRA_LFLAGS += /LIBPATH:$(DXSDK_LIB_PATH)
duke@0 110
duke@0 111 # C Compiler flag definitions
duke@0 112
duke@0 113 #
duke@0 114 # Default optimization
duke@0 115 #
ohair@460 116
ohair@460 117 ifndef OPTIMIZATION_LEVEL
ohair@460 118 ifeq ($(PRODUCT), java)
ohair@460 119 OPTIMIZATION_LEVEL = HIGHER
ohair@460 120 else
ohair@460 121 OPTIMIZATION_LEVEL = LOWER
ohair@460 122 endif
ohair@460 123 endif
ohair@1006 124 ifndef FASTDEBUG_OPTIMIZATION_LEVEL
ohair@1006 125 FASTDEBUG_OPTIMIZATION_LEVEL = LOWER
ohair@1006 126 endif
ohair@460 127
duke@0 128 ifeq ($(CC_VERSION),msvc)
duke@0 129 # Visual Studio .NET 2003 or VS2003 compiler option definitions:
duke@0 130 # -O1 Favors reduced size over speed (-Og -Os -Oy -Ob2 -Gs -GF -Gy)
duke@0 131 # -O2 Favors speed over reduced size (-Og -Oi -Ot -Oy -Ob2 -Gs -GF -Gy)
duke@0 132 # -Ox Full optimization (use -O2) (-Og -Oi -Ot -Oy -Ob2)
duke@0 133 # (Removed in Visual Studio 2005 or VS2005)
duke@0 134 # -Ob2 More aggressive inlining
duke@0 135 # -Og Global optimizations
duke@0 136 # -Oi Replace some functions with intrinsic or special forms
duke@0 137 # -Op Improve floating point calculations (disables some optimizations)
duke@0 138 # (Replaced with -fp:precise in VS2005, /Op is default now)
duke@0 139 # -Os Favor small code
duke@0 140 # -Ot Favor faster code
duke@0 141 # -Oy Frame pointer omission
duke@0 142 # -GB Optimize for pentium (old VC6 option?)
duke@0 143 # -G6 VS2003 version of -GB?
duke@0 144 # -GF Pool strings in read-only memory
duke@0 145 # -Gf Pool strings in read-write memory (the default)
duke@0 146 # -Gs Controls stack probess
duke@0 147 # -GS Adds buffer overflow checks on stacks
duke@0 148 # (Default in VS2005)
duke@0 149 # -GX Enables exception handling
duke@0 150 # (Replaced with /EHsc in VS2005)
duke@0 151 # -Gy Function level linking only
duke@0 152 #
duke@0 153 # NOTE: With VC6, -Ox included -Gs.
duke@0 154 # NOTE: With VC6, -Ox, -O1, and -O2 used -Ob1, not -Ob2.
duke@0 155 # NOTE: With VC6, -O1 and -O2 used -Gf, not -GF.
duke@0 156 #
ohair@460 157
ohair@460 158 CC_OPT/NONE = -Od
ohair@460 159 CC_OPT/LOWER = -O2
ohair@460 160 CC_OPT/HIGHER = -O3
ohair@460 161 CC_OPT/HIGHEST = -O3
ohair@460 162
duke@0 163 ifeq ($(COMPILER_VERSION), VC6)
duke@0 164 # VC6 (6.2) msvc compiler (the way Tiger and early Mustang were built)
duke@0 165 # Automatic precompiled header option to use (if COMPILE_APPROACH=batch)
duke@0 166 AUTOMATIC_PCH_OPTION =
duke@0 167 GX_OPTION = -GX
prr@2324 168 GZ_OPTION = -GZ
duke@0 169 ifeq ($(ARCH_DATA_MODEL), 32)
ohair@460 170 CC_OPT/HIGHEST = -Ox -Gy -Os -GB
ohair@460 171 CC_OPT/HIGHER = -Ox -Gy -Os -GB
ohair@460 172 CC_OPT/LOWER = -Ox -Gy -Os -GB
duke@0 173 else
ohair@460 174 CC_OPT/HIGHEST = -Ox -Gy -Op
ohair@460 175 CC_OPT/HIGHER = -Ox -Gy -Op
ohair@460 176 CC_OPT/LOWER = -Ox -Gy -Op
duke@0 177 endif
duke@0 178 endif
ohair@460 179
duke@0 180 ifeq ($(COMPILER_VERSION), VS2003)
duke@0 181 # Automatic precompiled header option to use (if COMPILE_APPROACH=batch)
duke@0 182 AUTOMATIC_PCH_OPTION = -YX
duke@0 183 # Also known as VC7 compiler
duke@0 184 GX_OPTION = -GX
prr@2324 185 GZ_OPTION = -GZ
duke@0 186 ifeq ($(ARCH_DATA_MODEL), 32)
duke@0 187 # Lowered opt level to try and reduce footprint, dll size especially.
ohair@460 188 # Was: CC_OPT/HIGHEST = -O2 -G6
ohair@460 189 # Was: CC_OPT/HIGHER = -O2
ohair@460 190 CC_OPT/HIGHEST = -O2
ohair@460 191 CC_OPT/HIGHER = -O1
ohair@460 192 CC_OPT/LOWER = -O1
duke@0 193 else
ohair@460 194 CC_OPT/HIGHEST = -O2 -Op
ohair@460 195 CC_OPT/HIGHER = -O2 -Op
ohair@460 196 CC_OPT/LOWER = -O1 -Op
duke@0 197 endif
duke@0 198 endif
ohair@460 199
duke@0 200 ifeq ($(COMPILER_VERSION), VS2005)
duke@0 201 # Automatic precompiled header option to use (if COMPILE_APPROACH=batch)
duke@0 202 AUTOMATIC_PCH_OPTION =
duke@0 203 # VS2005 compiler, only with Platform SDK right now?
duke@0 204 GX_OPTION = -EHsc
prr@2324 205 GZ_OPTION = -RTC1
duke@0 206 ifeq ($(ARCH_DATA_MODEL), 32)
ohair@460 207 CC_OPT/HIGHEST = -O2
ohair@460 208 CC_OPT/HIGHER = -O1
ohair@460 209 CC_OPT/LOWER = -O1
duke@0 210 else
ohair@460 211 CC_OPT/HIGHEST = -O2
ohair@460 212 CC_OPT/HIGHER = -O1
ohair@460 213 CC_OPT/LOWER = -O1
duke@0 214 endif
duke@0 215 endif
tbell@795 216 ifeq ($(COMPILER_VERSION), VS2008)
tbell@795 217 # Automatic precompiled header option to use (if COMPILE_APPROACH=batch)
tbell@795 218 AUTOMATIC_PCH_OPTION =
tbell@795 219 GX_OPTION = -EHsc
prr@2324 220 GZ_OPTION = -RTC1
prr@2324 221 ifeq ($(ARCH_DATA_MODEL), 32)
prr@2324 222 CC_OPT/HIGHEST = -O2
prr@2324 223 CC_OPT/HIGHER = -O1
prr@2324 224 CC_OPT/LOWER = -O1
prr@2324 225 else
prr@2324 226 CC_OPT/HIGHEST = -O2
prr@2324 227 CC_OPT/HIGHER = -O1
prr@2324 228 CC_OPT/LOWER = -O1
prr@2324 229 endif
prr@2324 230 endif
prr@2324 231
prr@2324 232 ifeq ($(COMPILER_VERSION), VS2010)
prr@2324 233 # Automatic precompiled header option to use (if COMPILE_APPROACH=batch)
prr@2324 234 AUTOMATIC_PCH_OPTION =
prr@2324 235 GX_OPTION = -EHsc
prr@2324 236 GZ_OPTION = -RTC1
tbell@795 237 ifeq ($(ARCH_DATA_MODEL), 32)
tbell@795 238 CC_OPT/HIGHEST = -O2
tbell@795 239 CC_OPT/HIGHER = -O1
tbell@795 240 CC_OPT/LOWER = -O1
tbell@795 241 else
tbell@795 242 CC_OPT/HIGHEST = -O2
tbell@795 243 CC_OPT/HIGHER = -O1
tbell@795 244 CC_OPT/LOWER = -O1
tbell@795 245 endif
tbell@795 246 endif
ohair@460 247
duke@0 248 else # CC_VERSION
duke@0 249 # GCC not supported, but left for historical reference...
ohair@460 250 CC_OPT/NONE =
ohair@460 251 CC_OPT/LOWER = -O2
ohair@460 252 CC_OPT/HIGHER = -O2
ohair@460 253 CC_OPT/HIGHEST = -O3
ohair@460 254
duke@0 255 endif
duke@0 256
ohair@460 257 CC_OPT = $(CC_OPT/$(OPTIMIZATION_LEVEL))
duke@0 258
duke@0 259 # Select the runtime support library carefully, need to be consistent
duke@0 260 #
duke@0 261 # VS2003 compiler option definitions:
duke@0 262 # -MD Use dynamic multi-threaded runtime library
duke@0 263 # -MDd Use debug version (don't use, doesn't mix with -MD DLL's)
duke@0 264 # -MT Use static multi-threaded runtime library (-ML is going away)
duke@0 265 # -MTd Use static debug version (better than -MDd, no runtime issues)
duke@0 266 # -D_DEBUG Change use of malloc/free/etc to use special debug ones (-MTd)
duke@0 267 #
tbell@795 268 # NOTE: We also will use /D _STATIC_CPPLIB so we don't need msvcpnn.dll
duke@0 269 #
tbell@795 270 # If MS_RUNTIME_STATIC is requested, use -MT only with VS2003.
duke@0 271 ifeq ($(MS_RUNTIME_STATIC),true)
tbell@795 272 ifeq ($(COMPILER_VERSION), VS2003)
tbell@795 273 MS_RUNTIME_OPTION=-MT
tbell@795 274 endif
duke@0 275 else
duke@0 276 MS_RUNTIME_OPTION=-MD
duke@0 277 endif
duke@0 278 # The _DEBUG macro option (changes things like malloc to use debug version)
duke@0 279 MS_RUNTIME_DEBUG_OPTION=
duke@0 280 MS_RC_DEBUG_OPTION=
duke@0 281 # Externally set environment variable can force any build to use the debug vers
duke@0 282 ifeq ($(MFC_DEBUG), true)
duke@0 283 ifeq ($(MS_RUNTIME_STATIC),true)
duke@0 284 MS_RUNTIME_OPTION=-MTd
duke@0 285 else
duke@0 286 # This MS debugging flag forces a dependence on the debug
duke@0 287 # version of the runtime library (MSVCRTD.DLL), as does -MDd.
duke@0 288 # We cannot re-distribute this debug runtime.
duke@0 289 MS_RUNTIME_OPTION=-MDd
duke@0 290 endif
duke@0 291 MS_RUNTIME_DEBUG_OPTION= -D_DEBUG
duke@0 292 MS_RC_DEBUG_OPTION= -d _DEBUG
duke@0 293 endif
duke@0 294
duke@0 295 # Always add _STATIC_CPPLIB definition
duke@0 296 STATIC_CPPLIB_OPTION = /D _STATIC_CPPLIB
duke@0 297 MS_RUNTIME_OPTION += $(STATIC_CPPLIB_OPTION)
duke@0 298
duke@0 299 ifeq ($(CC_VERSION),msvc)
duke@0 300 # VS2003 compiler option definitions:
duke@0 301 # -Zi Cause *.pdb file to be created, full debug information
duke@0 302 # -Z7 Full debug inside the .obj, no .pdb
duke@0 303 # -Zd Basic debug, no local variables? In the .obj
duke@0 304 # -Zl Don't add runtime library name to obj file?
duke@0 305 # -Od Turns off optimization and speeds compilation
duke@0 306 # -YX -Fp/.../foobar.pch Use precompiled headers (try someday?)
duke@0 307 # -nologo Don't print out startup message
duke@0 308 # /D _STATIC_CPPLIB
tbell@795 309 # Use static link for the C++ runtime (so msvcpnn.dll not needed)
duke@0 310 #
duke@0 311 CFLAGS_COMMON += -Zi -nologo
ohair@460 312 CFLAGS_OPT = $(CC_OPT)
duke@0 313 CFLAGS_DBG = -Od $(MS_RUNTIME_DEBUG_OPTION)
duke@0 314
prr@2324 315 # REMIND: I don't see where CFLAGS_VS2005 is used. I suspect its
prr@2324 316 # pulled in as a combined "CFLAGS_$(COMPILER_VERSION)" string
prr@2324 317 # but the lack of this isn't causing any apparent build problems
prr@2324 318 # with VS 2010 but it could be causing compiler warnings.
prr@2324 319 # For now, I will add it for all cases :
prr@2324 320 CFLAGS_VS2010 += -Zc:wchar_t-
prr@2324 321 #
duke@0 322 # Starting from VS2005 the wchar_t is handled as a built-in C/C++ data type
duke@0 323 # by default. However, we expect the wchar_t to be a typedef to the
duke@0 324 # unsigned short data type. The -Zc:wchar_t- option restores the old
duke@0 325 # behavior (as seen in VS2003) to avoid massive code modifications.
duke@0 326 # When/if our code will be "C/C++ Standard"-compliant (at least in the area
duke@0 327 # of handling the wchar_t type), the option won't be necessary.
duke@0 328 ifeq ($(ARCH_DATA_MODEL), 32)
duke@0 329 CFLAGS_VS2005 += -Zc:wchar_t-
duke@0 330 else
duke@0 331 # The 64bit Platform SDK we use (April 2005) doesn't like this option
duke@0 332 ifneq ($(CC_VER), 14.00.40310.41)
duke@0 333 CFLAGS_VS2005 += -Zc:wchar_t-
duke@0 334 endif
duke@0 335 endif
duke@0 336
duke@0 337 # All builds get the same runtime setting
duke@0 338 CFLAGS_COMMON += $(MS_RUNTIME_OPTION) $(CFLAGS_$(COMPILER_VERSION))
duke@0 339
duke@0 340
duke@0 341 LDEBUG = /debug
duke@0 342
duke@0 343 ifeq ($(VTUNE_SUPPORT), true)
duke@0 344 OTHER_CFLAGS = -Z7 -Ox
duke@0 345 LDEBUG += /pdb:NONE
duke@0 346 endif
duke@0 347
duke@0 348 # The new Platform SDK and VS2005 has /GS as a default and requires
duke@0 349 # bufferoverflowU.lib on the link command line, otherwise
duke@0 350 # we get missing __security_check_cookie externals at link time.
duke@0 351 BUFFEROVERFLOWLIB = bufferoverflowU.lib
duke@0 352 # Always add bufferoverflowU.lib to VS2005 link commands (pack uses LDDFLAGS)
duke@0 353 LFLAGS_VS2005 = $(BUFFEROVERFLOWLIB)
duke@0 354
tbell@795 355 # VS2008 has bufferoverflow baked in:
tbell@795 356 LFLAGS_VS2008 =
prr@2324 357 LFLAGS_VS2010 =
tbell@795 358
duke@0 359 # LFLAGS are the flags given to $(LINK) and used to build the actual DLL file
duke@0 360 BASELFLAGS = -nologo /opt:REF /incremental:no
tbell@795 361 ifdef MT
tbell@795 362 # VS2005, VS2008, and beyond: ask LINK to generate manifests for .dll & .exe
tbell@795 363 BASELFLAGS += /manifest
tbell@795 364 endif
tbell@795 365
duke@0 366 LFLAGS = $(BASELFLAGS) $(LDEBUG) $(EXTRA_LFLAGS) $(LFLAGS_$(COMPILER_VERSION))
duke@0 367 LDDFLAGS += $(LFLAGS_$(COMPILER_VERSION))
duke@0 368
duke@0 369 endif
duke@0 370
duke@0 371 #
duke@0 372 # Preprocessor macro definitions
duke@0 373 #
duke@0 374 CPPFLAGS_COMMON = -DWIN32 -DIAL -D_LITTLE_ENDIAN
duke@0 375 ifeq ($(ARCH), amd64)
duke@0 376 CPPFLAGS_COMMON += -D_AMD64_ -Damd64
duke@0 377 else
ohair@422 378 CPPFLAGS_COMMON += -D_X86_ -Dx86
duke@0 379 endif
duke@0 380 CPPFLAGS_COMMON += -DWIN32_LEAN_AND_MEAN
duke@0 381
duke@0 382 #
duke@0 383 # Output options (use specific filenames to avoid parallel compile errors)
duke@0 384 #
duke@0 385 CFLAGS_COMMON += -Fd$(OBJDIR)/$(basename $(@F)).pdb -Fm$(OBJDIR)/$(basename $(@F)).map
duke@0 386
duke@0 387 #
ohair@422 388 # Use -wdNNNN to disable warning NNNN.
ohair@422 389 # C4800 is a warning about bool performance casts (can't make go away)
ohair@422 390 #
ohair@422 391 COMPILER_WARNINGS_TO_IGNORE = 4800
ohair@422 392 CFLAGS_COMMON += $(COMPILER_WARNINGS_TO_IGNORE:%=-wd%)
ohair@422 393
ohair@422 394 #
duke@0 395 # Treat compiler warnings as errors, if requested
duke@0 396 #
ohair@422 397 CFLAGS_COMMON += -W$(COMPILER_WARNING_LEVEL)
ohair@942 398 # Turn off security warnings about using the standard C library function strcpy
ohair@942 399 CFLAGS_COMMON += -D _CRT_SECURE_NO_DEPRECATE
duke@0 400 ifeq ($(COMPILER_WARNINGS_FATAL),true)
duke@0 401 CFLAGS_COMMON += -WX
duke@0 402 endif
duke@0 403
ohair@1388 404 CPPFLAGS_OPT = -DNDEBUG
duke@0 405 CPPFLAGS_DBG = -DDEBUG -DLOGGING
duke@0 406
duke@0 407 CXXFLAGS_COMMON = $(CFLAGS_COMMON)
duke@0 408 CXXFLAGS_OPT = $(CFLAGS_OPT)
duke@0 409 CXXFLAGS_DBG = $(CFLAGS_DBG)
duke@0 410
duke@0 411 ifneq ($(LIBRARY),fdlibm)
duke@0 412 EXTRA_LIBS += advapi32.lib
duke@0 413 endif
duke@0 414
duke@0 415 #
duke@0 416 # Path and option to link against the VM, if you have to.
duke@0 417 #
duke@0 418 JVMLIB = $(LIBDIR)/jvm.lib
duke@0 419 JAVALIB = $(LIBDIR)/java.lib
duke@0 420
duke@0 421 ifeq ($(CC_VERSION), msvc)
duke@0 422 CC_DEPEND = -FD
duke@0 423 CC_DEPEND_FILTER =
duke@0 424 else # CC_VERSION
duke@0 425 # not supported, but left for historical reference...
duke@0 426 CC_DEPEND = -MM
duke@0 427 CC_DEPEND_FILTER = $(SED) -e 's!$*\.$(OBJECT_SUFFIX)!$(dir $@)&!g'
duke@0 428 endif # CC_VERSION
duke@0 429
duke@0 430 LIBRARY_SUFFIX = dll
duke@0 431 LIB_SUFFIX = lib
duke@0 432
duke@0 433 # Settings for the JDI - Serviceability Agent binding.
duke@0 434 HOTSPOT_SALIB_PATH = $(HOTSPOT_IMPORT_PATH)/jre/bin
duke@0 435 SALIB_NAME = $(LIB_PREFIX)sawindbg.$(LIBRARY_SUFFIX)
duke@0 436 SAMAP_NAME = $(LIB_PREFIX)sawindbg.map
duke@0 437 SAPDB_NAME = $(LIB_PREFIX)sawindbg.pdb
duke@0 438
duke@0 439 ifeq ($(ARCH), ia64)
duke@0 440 # SA will never be supported here.
duke@0 441 INCLUDE_SA = false
duke@0 442 else
poonam@891 443 INCLUDE_SA = true
duke@0 444 endif
duke@0 445
duke@0 446 # Settings for the VERSIONINFO tap on windows.
ohair@7 447 VERSIONINFO_RESOURCE = $(BUILDDIR)/../src/windows/resource/version.rc
duke@0 448
duke@0 449 ifneq ($(JDK_BUILD_NUMBER),)
duke@0 450 COOKED_BUILD_NUMBER = $(shell $(ECHO) $(JDK_BUILD_NUMBER) | $(SED) -e 's/^b//' -e 's/^0//')
duke@0 451 else
duke@0 452 COOKED_BUILD_NUMBER = 0
duke@0 453 endif
duke@0 454
duke@0 455 # If the update version contains non-numeric characters, we need
duke@0 456 # to massage it into a numeric format.
duke@0 457 # We use the following formula:
duke@0 458 # JDK_UPDATE_VER = JDK_UPDATE_VERSION * 10 + EXCEPTION_VERSION
duke@0 459 #
duke@0 460 # Here are some examples:
duke@0 461 # 1.5.0 b01 -> 5,0,0,1
duke@0 462 # 1.5.0_10 b01 -> 5,0,100,1
duke@0 463 # 1.4.2 b01 -> 4,2,0,1
duke@0 464 # 1.4.2_02 b01 -> 4,2,20,1
duke@0 465 # 1.4.2_02a b01 -> 4,2,21,1
duke@0 466 # 1.4.2_02b b01 -> 4,2,22,1
duke@0 467 ifdef JDK_UPDATE_VERSION
duke@0 468 VTMP := $(shell $(ECHO) $(JDK_UPDATE_VERSION) | $(TR) "abcde" "12345")
duke@0 469 CAB_CHAR1 := $(shell $(ECHO) $(VTMP) | $(NAWK) '{print substr($$1, 1, 1);}')
duke@0 470 CAB_CHAR2 := $(shell $(ECHO) $(VTMP) | $(NAWK) '{print substr($$1, 2, 1);}')
duke@0 471 CAB_CHAR3 := $(shell $(ECHO) $(VTMP) | $(NAWK) '{print substr($$1, 3, 1);}')
duke@0 472 JDK_UPDATE_META_TAG := U$(MARKETING_NUMBER)
duke@0 473 ifeq ($(CAB_CHAR3),)
duke@0 474 CAB_CHAR3 := 0
duke@0 475 endif
duke@0 476 ifeq ($(CAB_CHAR1), 0)
duke@0 477 JDK_UPDATE_VER := $(CAB_CHAR2)$(CAB_CHAR3)
duke@0 478 else
duke@0 479 JDK_UPDATE_VER := $(CAB_CHAR1)$(CAB_CHAR2)$(CAB_CHAR3)
duke@0 480 endif
duke@0 481 else
duke@0 482 JDK_UPDATE_VER := 0
duke@0 483 endif
duke@0 484
duke@0 485 RC_FLAGS = /l 0x409 /r
duke@0 486
duke@0 487 ifeq ($(VARIANT), OPT)
duke@0 488 RC_FLAGS += -d NDEBUG
duke@0 489 else
duke@0 490 RC_FLAGS += $(MS_RC_DEBUG_OPTION)
duke@0 491 endif
duke@0 492
ohair@420 493 # Values for the RC variables defined in RC_FLAGS
ohair@420 494 JDK_RC_BUILD_ID = $(FULL_VERSION)
ohair@420 495 JDK_RC_COMPANY = $(COMPANY_NAME)
ohair@420 496 JDK_RC_COMPONENT = $(PRODUCT_NAME) $(JDK_RC_PLATFORM_NAME) binary
ohair@420 497 JDK_RC_VER = \
ohair@420 498 $(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION).$(JDK_UPDATE_VER).$(COOKED_BUILD_NUMBER)
ohair@420 499 JDK_RC_COPYRIGHT = Copyright \xA9 $(COPYRIGHT_YEAR)
ohair@420 500 JDK_RC_NAME = \
ohair@420 501 $(PRODUCT_NAME) $(JDK_RC_PLATFORM_NAME) $(JDK_MINOR_VERSION) $(JDK_UPDATE_META_TAG)
ohair@420 502 JDK_RC_FVER = \
ohair@420 503 $(JDK_MINOR_VERSION),$(JDK_MICRO_VERSION),$(JDK_UPDATE_VER),$(COOKED_BUILD_NUMBER)
duke@0 504
herrick@1365 505 # JDK name required here
herrick@1365 506 RC_FLAGS += -d "JDK_BUILD_ID=$(JDK_RC_BUILD_ID)" \
herrick@1365 507 -d "JDK_COMPANY=$(JDK_RC_COMPANY)" \
herrick@1365 508 -d "JDK_COMPONENT=$(JDK_RC_COMPONENT)" \
herrick@1365 509 -d "JDK_VER=$(JDK_RC_VER)" \
herrick@1365 510 -d "JDK_COPYRIGHT=$(JDK_RC_COPYRIGHT)" \
herrick@1365 511 -d "JDK_NAME=$(JDK_RC_NAME)" \
herrick@1365 512 -d "JDK_FVER=$(JDK_RC_FVER)"
herrick@1365 513
herrick@1365 514 # Enable 7-Zip LZMA file (de)compression for Java Kernel if it is available
herrick@1365 515 ifeq ($(ARCH_DATA_MODEL), 32)
herrick@1365 516 ifneq ($(KERNEL), off)
herrick@1365 517 # This is a hack to use until 7-Zip (and UPX) bundles can be put
herrick@1365 518 # under /java/devtools.
herrick@1365 519 ifndef DEPLOY_TOPDIR
herrick@1365 520 DEPLOY_TOPDIR=$(JDK_TOPDIR)/../deploy
herrick@1365 521 endif
herrick@1365 522 # Uncomment this block to cause build failure if above assumption false
herrick@1365 523 #DCHK = $(shell if [ ! -d $(DEPLOY_TOPDIR) ] ; then \
herrick@1365 524 # $(ECHO) deploy_not_a_peer_of_j2se ; \
herrick@1365 525 #fi )
herrick@1365 526 #ifeq ($(DCHK), deploy_not_a_peer_of_j2se)
herrick@1365 527 # If a build failure points to control coming here it means
herrick@1365 528 # it means deploy is not in the same directory
herrick@1365 529 # as j2se. Java Kernel can't tolerate that for the time being.
herrick@1365 530 #endif
herrick@1365 531 EC_TMP = $(shell if [ -d $(DEPLOY_TOPDIR)/make/lzma ] ; then \
herrick@1365 532 $(ECHO) true ; \
herrick@1365 533 else \
herrick@1365 534 $(ECHO) false ; \
herrick@1365 535 fi )
herrick@1365 536 ifeq ($(EC_TMP), true)
herrick@1365 537 EXTRA_COMP_INSTALL_PATH = lib\\\\deploy\\\\lzma.dll
herrick@1365 538 # Crazy but true: deploy/make/plugin/jinstall/Makefile.jkernel does
herrick@1365 539 # not include deploy/make/common/Defs-windows.gmk, either directly
herrick@1365 540 # or indirectly. But it does include this file, so redundantly declare
herrick@1365 541 # these variables that are in deploy/make/common/Defs-windows.gmk for
herrick@1365 542 # the sake of the Java Kernel part of the deploy build. Whew!
herrick@1365 543 EXTRA_COMP_LIB_NAME = lzma.dll
herrick@1365 544 EXTRA_COMP_PATH = $(OUTPUTDIR)/tmp/deploy/lzma/win32/obj
herrick@1365 545 EXTRA_COMP_CMD_PATH = $(EXTRA_COMP_PATH)/lzma.exe
herrick@1365 546 EXTRA_COMP_LIB_PATH = $(EXTRA_COMP_PATH)/$(EXTRA_COMP_LIB_NAME)
herrick@1365 547 endif
herrick@1365 548 endif
herrick@1365 549 endif