1 # 2 # Copyright 2005-2008 Sun Microsystems, Inc. All Rights Reserved. 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 # 5 # This code is free software; you can redistribute it and/or modify it 6 # under the terms of the GNU General Public License version 2 only, as 7 # published by the Free Software Foundation. 8 # 9 # This code is distributed in the hope that it will be useful, but WITHOUT 10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 # version 2 for more details (a copy is included in the LICENSE file that 13 # accompanied this code). 14 # 15 # You should have received a copy of the GNU General Public License version 16 # 2 along with this work; if not, write to the Free Software Foundation, 17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 # 19 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 20 # CA 95054 USA or visit www.sun.com if you need additional information or 21 # have any questions. 22 # 23 # 24 25 # Rules to build serviceability agent library, used by vm.make 26 27 # libsaproc[_g].so: serviceability agent 28 SAPROC = saproc$(G_SUFFIX) 29 LIBSAPROC = lib$(SAPROC).so 30 31 AGENT_DIR = $(GAMMADIR)/agent 32 33 SASRCDIR = $(AGENT_DIR)/src/os/$(Platform_os_family) 34 35 SASRCFILES = $(SASRCDIR)/salibelf.c \ 36 $(SASRCDIR)/symtab.c \ 37 $(SASRCDIR)/libproc_impl.c \ 38 $(SASRCDIR)/ps_proc.c \ 39 $(SASRCDIR)/ps_core.c \ 40 $(SASRCDIR)/LinuxDebuggerLocal.c 41 42 SAMAPFILE = $(SASRCDIR)/mapfile 43 44 DEST_SAPROC = $(JDK_LIBDIR)/$(LIBSAPROC) 45 46 # if $(AGENT_DIR) does not exist, we don't build SA 47 # also, we don't build SA on Itanium. 48 49 checkAndBuildSA: 50 $(QUIETLY) if [ -d $(AGENT_DIR) -a "$(SRCARCH)" != "ia64" ] ; then \ 51 $(MAKE) -f vm.make $(LIBSAPROC); \ 52 fi 53 54 SA_LFLAGS = $(MAPFLAG:FILENAME=$(SAMAPFILE)) 55 56 $(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE) 57 $(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \ 58 echo "ALT_BOOTDIR, BOOTDIR or JAVA_HOME needs to be defined to build SA"; \ 59 exit 1; \ 60 fi 61 @echo Making SA debugger back-end... 62 $(QUIETLY) $(CC) -D$(BUILDARCH) -D_GNU_SOURCE \ 63 $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \ 64 -I$(SASRCDIR) \ 65 -I$(GENERATED) \ 66 -I$(BOOT_JAVA_HOME)/include \ 67 -I$(BOOT_JAVA_HOME)/include/$(Platform_os_family) \ 68 $(SASRCFILES) \ 69 $(SA_LFLAGS) \ 70 -o $@ \ 71 -lthread_db 72 73 install_saproc: checkAndBuildSA 74 $(QUIETLY) if [ -e $(LIBSAPROC) ] ; then \ 75 echo "Copying $(LIBSAPROC) to $(DEST_SAPROC)"; \ 76 cp -f $(LIBSAPROC) $(DEST_SAPROC) && echo "Done"; \ 77 fi 78 79 .PHONY: checkAndBuildSA install_saproc