2796N/A# Copyright (c) 2005, 2010, Oracle
and/or its affiliates. All rights reserved.
2796N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2796N/A# This code is free software; you can redistribute it
and/or modify it
2796N/A# under the terms of the GNU General Public License version 2 only, as
2796N/A# published by the Free Software Foundation.
2796N/A# This code is distributed in the hope that it will be useful, but WITHOUT
2796N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2796N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
2796N/A# version 2 for more details (a copy is included in the LICENSE file that
2796N/A# You should have received a copy of the GNU General Public License version
2796N/A# 2 along with this work; if not, write to the Free Software Foundation,
2796N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2796N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2796N/A# libsaproc[_g].so: serviceability agent
2796N/ASAPROC_G = $(SAPROC)$(G_SUFFIX)
2796N/A LIBSAPROC = lib$(SAPROC).dylib
2796N/A LIBSAPROC_G = lib$(SAPROC_G).dylib
2796N/A LIBSAPROC = lib$(SAPROC).so
2796N/A LIBSAPROC_G = lib$(SAPROC_G).so
2796N/AAGENT_DIR = $(GAMMADIR)/agent
2842N/Aifeq ($(OS_VENDOR), FreeBSD)
2842N/A SASRCFILES = $(NON_STUB_SASRCFILES)
2842N/A SALIBS = -lutil -lthread_db
2842N/A ifeq ($(OS_VENDOR), Darwin)
2842N/A #objc compiler blows up on -march=i586, perhaps it should not be included in the macosx intel 32-bit C++ compiles?
2842N/A SAARCH = $(subst -march=i586,,$(ARCHFLAG))
2796N/ASAMAPFILE = $(SASRCDIR)/mapfile
2796N/ADEST_SAPROC = $(JDK_LIBDIR)/$(LIBSAPROC)
2796N/A# DEBUG_BINARIES overrides everything, use full -g debug information
2796N/Aifeq ($(DEBUG_BINARIES), true)
2796N/A# if $(AGENT_DIR) does not exist, we don't build SA
2796N/A# also, we don't build SA on Itanium, PPC, ARM or zero.
2796N/Aifneq ($(wildcard $(AGENT_DIR)),)
2796N/Aifneq ($(filter-out ia64 arm ppc zero,$(SRCARCH)),)
2796N/A BUILDLIBSAPROC = $(LIBSAPROC)
2796N/Aifneq ($(OS_VENDOR), Darwin)
2796N/ASA_LFLAGS = $(MAPFLAG:FILENAME=$(SAMAPFILE))
2796N/ASA_LFLAGS += $(LDFLAGS_HASH_STYLE)
2842N/A BOOT_JAVA_INCLUDES = -I$(BOOT_JAVA_HOME)/include \
2842N/A -I$(BOOT_JAVA_HOME)/include/$(shell uname -s | tr "[:upper:]" "[:lower:]") \
2842N/A BOOT_JAVA_INCLUDES = -I$(BOOT_JAVA_HOME)/include \
2842N/A -I$(BOOT_JAVA_HOME)/include/$(shell uname -s | tr "[:upper:]" "[:lower:]")
2796N/A$(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE)
2796N/A $(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \
2796N/A echo "ALT_BOOTDIR, BOOTDIR or JAVA_HOME needs to be defined to build SA"; \
2796N/A @echo Making SA debugger back-end...
2796N/A $(QUIETLY) $(CC) -D$(BUILDARCH) -D_GNU_SOURCE \
2842N/A $(SYMFLAG) $(SAARCH) $(SHARED_FLAG) $(PICFLAG) \
2796N/A $(QUIETLY) [ -f $(LIBSAPROC_G) ] || { ln -s $@ $(LIBSAPROC_G); }
2796N/Ainstall_saproc: $(BUILDLIBSAPROC)
2796N/A $(QUIETLY) if [ -e $(LIBSAPROC) ] ; then \
2796N/A echo "Copying $(LIBSAPROC) to $(DEST_SAPROC)"; \
2796N/A cp -f $(LIBSAPROC) $(DEST_SAPROC) && echo "Done"; \