Defs-windows.gmk revision 1365
# Makefile to specify compiler flags for programs and libraries # targeted to Windows builds. Should not contain any rules. # WARNING: This file is shared with other workspaces. # So when it includes other files, it must use JDK_TOPDIR. # Get shared JDK settings # CC compiler object code output directive flag value # The suffix applied to the library name for FDLIBM # The suffix applied to scripts (.bat for windows, nothing for unix) # LIB_LOCATION, which for windows identifies where .exe files go, may be # set by each GNUmakefile. The default is BINDIR. # Platform specific closed sources # for backwards compatability, the old "win32" is used here instead of # the more proper "windows" # The following DLL's are considered MS runtime libraries and should # C Compiler flag definitions # Visual Studio .NET 2003 or VS2003 compiler option definitions: # -O1 Favors reduced size over speed (-Og -Os -Oy -Ob2 -Gs -GF -Gy) # -O2 Favors speed over reduced size (-Og -Oi -Ot -Oy -Ob2 -Gs -GF -Gy) # -Ox Full optimization (use -O2) (-Og -Oi -Ot -Oy -Ob2) # (Removed in Visual Studio 2005 or VS2005) # -Ob2 More aggressive inlining # -Og Global optimizations # -Oi Replace some functions with intrinsic or special forms # -Op Improve floating point calculations (disables some optimizations) # (Replaced with -fp:precise in VS2005, /Op is default now) # -Oy Frame pointer omission # -GB Optimize for pentium (old VC6 option?) # -G6 VS2003 version of -GB? # -GF Pool strings in read-only memory # -Gf Pool strings in read-write memory (the default) # -Gs Controls stack probess # -GS Adds buffer overflow checks on stacks # -GX Enables exception handling # (Replaced with /EHsc in VS2005) # -Gy Function level linking only # NOTE: With VC6, -Ox included -Gs. # NOTE: With VC6, -Ox, -O1, and -O2 used -Ob1, not -Ob2. # NOTE: With VC6, -O1 and -O2 used -Gf, not -GF. # VC6 (6.2) msvc compiler (the way Tiger and early Mustang were built) # Automatic precompiled header option to use (if COMPILE_APPROACH=batch) # Automatic precompiled header option to use (if COMPILE_APPROACH=batch) # Also known as VC7 compiler # Lowered opt level to try and reduce footprint, dll size especially. # Automatic precompiled header option to use (if COMPILE_APPROACH=batch) # VS2005 compiler, only with Platform SDK right now? # Automatic precompiled header option to use (if COMPILE_APPROACH=batch) # GCC not supported, but left for historical reference... # Select the runtime support library carefully, need to be consistent # VS2003 compiler option definitions: # -MD Use dynamic multi-threaded runtime library # -MDd Use debug version (don't use, doesn't mix with -MD DLL's) # -MT Use static multi-threaded runtime library (-ML is going away) # -MTd Use static debug version (better than -MDd, no runtime issues) # -D_DEBUG Change use of malloc/free/etc to use special debug ones (-MTd) # NOTE: We also will use /D _STATIC_CPPLIB so we don't need msvcpnn.dll # If MS_RUNTIME_STATIC is requested, use -MT only with VS2003. # The _DEBUG macro option (changes things like malloc to use debug version) # Externally set environment variable can force any build to use the debug vers # This MS debugging flag forces a dependence on the debug # version of the runtime library (MSVCRTD.DLL), as does -MDd. # We cannot re-distribute this debug runtime. # Always add _STATIC_CPPLIB definition # VS2003 compiler option definitions: # -Zi Cause *.pdb file to be created, full debug information # -Z7 Full debug inside the .obj, no .pdb # -Zd Basic debug, no local variables? In the .obj # -Zl Don't add runtime library name to obj file? # -Od Turns off optimization and speeds compilation # -YX -Fp/.../foobar.pch Use precompiled headers (try someday?) # -nologo Don't print out startup message # Use static link for the C++ runtime (so msvcpnn.dll not needed) # Starting from VS2005 the wchar_t is handled as a built-in C/C++ data type # by default. However, we expect the wchar_t to be a typedef to the # unsigned short data type. The -Zc:wchar_t- option restores the old # behavior (as seen in VS2003) to avoid massive code modifications. # When/if our code will be "C/C++ Standard"-compliant (at least in the area # of handling the wchar_t type), the option won't be necessary. # The 64bit Platform SDK we use (April 2005) doesn't like this option # All builds get the same runtime setting # The new Platform SDK and VS2005 has /GS as a default and requires # we get missing __security_check_cookie externals at link time. # VS2008 has bufferoverflow baked in: # LFLAGS are the flags given to $(LINK) and used to build the actual DLL file # VS2005, VS2008, and beyond: ask LINK to generate manifests for .dll & .exe # Preprocessor macro definitions # Output options (use specific filenames to avoid parallel compile errors) # Use -wdNNNN to disable warning NNNN. # C4800 is a warning about bool performance casts (can't make go away) # Treat compiler warnings as errors, if requested # Turn off security warnings about using the standard C library function strcpy # Path and option to link against the VM, if you have to. # not supported, but left for historical reference... # Settings for the JDI - Serviceability Agent binding. # SA will never be supported here. # Settings for the VERSIONINFO tap on windows. # If the update version contains non-numeric characters, we need # to massage it into a numeric format. # We use the following formula: # JDK_UPDATE_VER = JDK_UPDATE_VERSION * 10 + EXCEPTION_VERSION # Here are some examples: # 1.5.0_10 b01 -> 5,0,100,1 # 1.4.2_02 b01 -> 4,2,20,1 # 1.4.2_02a b01 -> 4,2,21,1 # 1.4.2_02b b01 -> 4,2,22,1 # Values for the RC variables defined in RC_FLAGS # Enable 7-Zip LZMA file (de)compression for Java Kernel if it is available # This is a hack to use until 7-Zip (and UPX) bundles can be put # Uncomment this block to cause build failure if above assumption false #DCHK = $(shell if [ ! -d $(DEPLOY_TOPDIR) ] ; then \ # $(ECHO) deploy_not_a_peer_of_j2se ; \ #ifeq ($(DCHK), deploy_not_a_peer_of_j2se) # If a build failure points to control coming here it means # it means deploy is not in the same directory # as j2se. Java Kernel can't tolerate that for the time being. # or indirectly. But it does include this file, so redundantly declare # the sake of the Java Kernel part of the deploy build. Whew!