1178N/A# Copyright (c) 2005, 2012, Oracle
and/or its affiliates. All rights reserved.
1178N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1178N/A# This code is free software; you can redistribute it
and/or modify it
1178N/A# under the terms of the GNU General Public License version 2 only, as
1178N/A# published by the Free Software Foundation.
1178N/A# This code is distributed in the hope that it will be useful, but WITHOUT
1178N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1178N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1178N/A# version 2 for more details (a copy is included in the LICENSE file that
1178N/A# You should have received a copy of the GNU General Public License version
1178N/A# 2 along with this work; if not, write to the Free Software Foundation,
1178N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2362N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
0N/A# libsaproc[_g].so: serviceability agent
0N/ASAPROC_G = $(SAPROC)$(G_SUFFIX)
1178N/ALIBSAPROC_G = lib$(SAPROC_G).so
1178N/ALIBSAPROC_DEBUGINFO = lib$(SAPROC).debuginfo
1178N/ALIBSAPROC_DIZ = lib$(SAPROC).diz
4033N/ALIBSAPROC_G_DEBUGINFO = lib$(SAPROC_G).debuginfo
0N/ALIBSAPROC_G_DIZ = lib$(SAPROC_G).diz
4033N/AAGENT_DIR = $(GAMMADIR)/agent
1178N/ASAMAPFILE = $(SASRCDIR)/mapfile
1178N/ADEST_SAPROC = $(JDK_LIBDIR)/$(LIBSAPROC)
1178N/ADEST_SAPROC_DEBUGINFO = $(JDK_LIBDIR)/$(LIBSAPROC_DEBUGINFO)
1178N/ADEST_SAPROC_DIZ = $(JDK_LIBDIR)/$(LIBSAPROC_DIZ)
1178N/A# DEBUG_BINARIES overrides everything, use full -g debug information
1178N/Aifeq ($(DEBUG_BINARIES), true)
1178N/A# if $(AGENT_DIR) does not exist, we don't build SA
1178N/A# also, we don't build SA on Itanium, PPC, ARM or zero.
1178N/Aifneq ($(wildcard $(AGENT_DIR)),)
1178N/Aifneq ($(filter-out ia64 arm ppc zero,$(SRCARCH)),)
4935N/A BUILDLIBSAPROC = $(LIBSAPROC)
1178N/ASA_LFLAGS = $(MAPFLAG:FILENAME=$(SAMAPFILE)) $(LDFLAGS_HASH_STYLE)
4033N/A$(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE)
1178N/A $(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \
1178N/A echo "ALT_BOOTDIR, BOOTDIR or JAVA_HOME needs to be defined to build SA"; \
1178N/A @echo Making SA debugger back-end...
1178N/A $(QUIETLY) $(CC) -D$(BUILDARCH) -D_GNU_SOURCE \
1178N/A $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \
1178N/A -I$(BOOT_JAVA_HOME)/include \
1178N/A -I$(BOOT_JAVA_HOME)/include/$(Platform_os_family) \
1178N/A $(QUIETLY) [ -f $(LIBSAPROC_G) ] || { ln -s $@ $(LIBSAPROC_G); }
4935N/Aifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
1178N/A $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBSAPROC_DEBUGINFO)
1178N/A $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBSAPROC_DEBUGINFO) $@
4935N/A ifeq ($(STRIP_POLICY),all_strip)
4935N/A ifeq ($(STRIP_POLICY),min_strip)
4033N/A # implied else here is no stripping at all
0N/A [ -f $(LIBSAPROC_G_DEBUGINFO) ] || { ln -s $(LIBSAPROC_DEBUGINFO) $(LIBSAPROC_G_DEBUGINFO); }
1178N/A ifeq ($(ZIP_DEBUGINFO_FILES),1)
1178N/A $(ZIPEXE) -q -y $(LIBSAPROC_DIZ) $(LIBSAPROC_DEBUGINFO) $(LIBSAPROC_G_DEBUGINFO)
1178N/A $(RM) $(LIBSAPROC_DEBUGINFO) $(LIBSAPROC_G_DEBUGINFO)
1178N/A [ -f $(LIBSAPROC_G_DIZ) ] || { ln -s $(LIBSAPROC_DIZ) $(LIBSAPROC_G_DIZ); }
1178N/Ainstall_saproc: $(BUILDLIBSAPROC)
0N/A $(QUIETLY) if [ -e $(LIBSAPROC) ] ; then \
1178N/A echo "Copying $(LIBSAPROC) to $(DEST_SAPROC)"; \
1178N/A test -f $(LIBSAPROC_DEBUGINFO) && \
1178N/A cp -f $(LIBSAPROC_DEBUGINFO) $(DEST_SAPROC_DEBUGINFO); \
1178N/A test -f $(LIBSAPROC_DIZ) && \
1178N/A cp -f $(LIBSAPROC_DIZ) $(DEST_SAPROC_DIZ); \
1178N/A cp -f $(LIBSAPROC) $(DEST_SAPROC) && echo "Done"; \
0N/A.PHONY: install_saproc