1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/make/windows/makefiles/sa.make Wed Apr 09 14:22:48 2008 -0400 1.3 @@ -0,0 +1,110 @@ 1.4 +# 1.5 +# Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. 1.6 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.7 +# 1.8 +# This code is free software; you can redistribute it and/or modify it 1.9 +# under the terms of the GNU General Public License version 2 only, as 1.10 +# published by the Free Software Foundation. 1.11 +# 1.12 +# This code is distributed in the hope that it will be useful, but WITHOUT 1.13 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.14 +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.15 +# version 2 for more details (a copy is included in the LICENSE file that 1.16 +# accompanied this code). 1.17 +# 1.18 +# You should have received a copy of the GNU General Public License version 1.19 +# 2 along with this work; if not, write to the Free Software Foundation, 1.20 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.21 +# 1.22 +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 1.23 +# CA 95054 USA or visit www.sun.com if you need additional information or 1.24 +# have any questions. 1.25 +# 1.26 +# 1.27 + 1.28 +# This makefile is used to build Serviceability Agent code 1.29 +# and generate JNI header file for native methods. 1.30 + 1.31 +AGENT_DIR = $(WorkSpace)/agent 1.32 +checkAndBuildSA:: 1.33 + 1.34 +!if "$(BUILD_WIN_SA)" != "1" 1.35 +# Already warned about this in build.make 1.36 +!else 1.37 + 1.38 +# This first part is used to build sa-jdi.jar 1.39 +!include $(WorkSpace)/make/windows/makefiles/rules.make 1.40 +!include $(WorkSpace)/make/sa.files 1.41 + 1.42 +GENERATED = ..\generated 1.43 + 1.44 +# tools.jar is needed by the JDI - SA binding 1.45 +SA_CLASSPATH = $(BOOT_JAVA_HOME)\lib\tools.jar 1.46 + 1.47 +SA_CLASSDIR = $(GENERATED)\saclasses 1.48 + 1.49 +SA_BUILD_VERSION_PROP = sun.jvm.hotspot.runtime.VM.saBuildVersion=$(SA_BUILD_VERSION) 1.50 + 1.51 +SA_PROPERTIES = $(SA_CLASSDIR)\sa.properties 1.52 + 1.53 +default:: $(GENERATED)\sa-jdi.jar 1.54 + 1.55 +$(GENERATED)\sa-jdi.jar: $(AGENT_ALLFILES:/=\) 1.56 + @if not exist $(SA_CLASSDIR) mkdir $(SA_CLASSDIR) 1.57 + @echo ...Building sa-jdi.jar 1.58 + @echo ...$(COMPILE_JAVAC) -source 1.4 -classpath $(SA_CLASSPATH) -g -d $(SA_CLASSDIR) .... 1.59 + @$(COMPILE_JAVAC) -source 1.4 -classpath $(SA_CLASSPATH) -g -d $(SA_CLASSDIR) $(AGENT_ALLFILES:/=\) 1.60 + $(COMPILE_RMIC) -classpath $(SA_CLASSDIR) -d $(SA_CLASSDIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer 1.61 + $(QUIETLY) echo $(SA_BUILD_VERSION_PROP) > $(SA_PROPERTIES) 1.62 + $(RUN_JAR) cf $@ -C saclasses . 1.63 + $(RUN_JAR) uf $@ -C $(AGENT_SRC_DIR:/=\) META-INF\services\com.sun.jdi.connect.Connector 1.64 + $(RUN_JAVAH) -classpath $(SA_CLASSDIR) -jni sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal 1.65 + $(RUN_JAVAH) -classpath $(SA_CLASSDIR) -jni sun.jvm.hotspot.debugger.x86.X86ThreadContext 1.66 + $(RUN_JAVAH) -classpath $(SA_CLASSDIR) -jni sun.jvm.hotspot.debugger.ia64.IA64ThreadContext 1.67 + $(RUN_JAVAH) -classpath $(SA_CLASSDIR) -jni sun.jvm.hotspot.debugger.amd64.AMD64ThreadContext 1.68 + 1.69 + 1.70 + 1.71 +# This second part is used to build sawindbg.dll 1.72 +# We currently build it the same way for product, debug, and fastdebug. 1.73 + 1.74 +SAWINDBG=sawindbg.dll 1.75 + 1.76 +checkAndBuildSA:: $(SAWINDBG) 1.77 + 1.78 +# These do not need to be optimized (don't run a lot of code) and it 1.79 +# will be useful to have the assertion checks in place 1.80 + 1.81 +!if "$(BUILDARCH)" == "ia64" 1.82 +SA_CFLAGS = /nologo $(MS_RUNTIME_OPTION) /W3 $(GX_OPTION) /Od /D "WIN32" /D "WIN64" /D "_WINDOWS" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c 1.83 +!elseif "$(BUILDARCH)" == "amd64" 1.84 +SA_CFLAGS = /nologo $(MS_RUNTIME_OPTION) /W3 $(GX_OPTION) /Od /D "WIN32" /D "WIN64" /D "_WINDOWS" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c 1.85 +# On amd64, VS2005 compiler requires bufferoverflowU.lib on the link command line, 1.86 +# otherwise we get missing __security_check_cookie externals at link time. 1.87 +SA_LINK_FLAGS = bufferoverflowU.lib 1.88 +!else 1.89 +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 1.90 +!endif 1.91 + 1.92 +SASRCFILE = $(AGENT_DIR)/src/os/win32/windbg/sawindbg.cpp 1.93 +SA_LFLAGS = $(SA_LINK_FLAGS) /nologo /subsystem:console /map /debug /machine:$(MACHINE) 1.94 + 1.95 +# Note that we do not keep sawindbj.obj around as it would then 1.96 +# get included in the dumpbin command in build_vm_def.sh 1.97 + 1.98 +$(SAWINDBG): $(SASRCFILE) 1.99 + set INCLUDE=$(SA_INCLUDE)$(INCLUDE) 1.100 + $(CPP) @<< 1.101 + /I"$(BootStrapDir)/include" /I"$(BootStrapDir)/include/win32" 1.102 + /I"$(GENERATED)" $(SA_CFLAGS) 1.103 + $(SASRCFILE) 1.104 + /out:sawindbg.obj 1.105 +<< 1.106 + set LIB=$(SA_LIB)$(LIB) 1.107 + $(LINK) /out:$@ /DLL sawindbg.obj dbgeng.lib $(SA_LFLAGS) 1.108 + -@rm -f sawindbg.obj 1.109 + 1.110 +cleanall : 1.111 + rm -rf $(GENERATED:\=/)/saclasses 1.112 + rm -rf $(GENERATED:\=/)/sa-jdi.jar 1.113 +!endif