diff make/windows/makefiles/sa.make @ 6020:d652a62d6e03

7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris Summary: Add support for ENABLE_FULL_DEBUG_SYMBOLS and ZIP_DEBUGINFO_FILES build flags. Add support for .diz files. Reviewed-by: dholmes, ohair, sspitsyn
author dcubed
date Fri, 23 Mar 2012 11:50:33 -0700
parents 719f7007c8e8
children 0d8e265ba727
line wrap: on
line diff
--- a/make/windows/makefiles/sa.make	Mon Feb 20 22:32:30 2012 -0800
+++ b/make/windows/makefiles/sa.make	Fri Mar 23 11:50:33 2012 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -94,13 +94,19 @@
 SA_LD_FLAGS = bufferoverflowU.lib
 !endif
 !else
-SA_CFLAGS = /nologo $(MS_RUNTIME_OPTION) /W3 /Gm $(GX_OPTION) /ZI /Od /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+SA_CFLAGS = /nologo $(MS_RUNTIME_OPTION) /W3 /Gm $(GX_OPTION) /Od /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+!if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1"
+SA_CFLAGS = $(SA_CFLAGS) /ZI
+!endif
 !endif
 !if "$(MT)" != ""
 SA_LD_FLAGS = /manifest $(SA_LD_FLAGS)
 !endif
 SASRCFILE = $(AGENT_DIR)/src/os/win32/windbg/sawindbg.cpp
-SA_LFLAGS = $(SA_LD_FLAGS) /nologo /subsystem:console /map /debug /machine:$(MACHINE)
+SA_LFLAGS = $(SA_LD_FLAGS) /nologo /subsystem:console /machine:$(MACHINE)
+!if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1"
+SA_LFLAGS = $(SA_LFLAGS) /map /debug
+!endif
 
 # Note that we do not keep sawindbj.obj around as it would then
 # get included in the dumpbin command in build_vm_def.sh
@@ -114,14 +120,20 @@
 	  /I"$(BootStrapDir)/include" /I"$(BootStrapDir)/include/win32" 
 	  /I"$(GENERATED)" $(SA_CFLAGS)
 	  $(SASRCFILE)
-	  /out:sawindbg.obj
+	  /out:$*.obj
 <<
 	set LIB=$(SA_LIB)$(LIB)
-	$(LD) /out:$@ /DLL sawindbg.obj dbgeng.lib $(SA_LFLAGS)
+	$(LD) /out:$@ /DLL $*.obj dbgeng.lib $(SA_LFLAGS)
 !if "$(MT)" != ""
 	$(MT) /manifest $(@F).manifest /outputresource:$(@F);#2
 !endif
-	-@rm -f sawindbg.obj
+!if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1"
+!if "$(ZIP_DEBUGINFO_FILES)" == "1"
+	$(ZIPEXE) -q $*.diz $*.map $*.pdb
+	$(RM) $*.map $*.pdb
+!endif
+!endif
+	-@rm -f $*.obj
 
 cleanall :
 	rm -rf $(GENERATED:\=/)/saclasses