make/solaris/makefiles/saproc.make

Wed, 11 May 2011 08:59:46 -0700

author
dcubed
date
Wed, 11 May 2011 08:59:46 -0700
changeset 2886
357d1f583599
parent 2838
405c634f4aaa
child 3044
4aa5974a06dd
permissions
-rw-r--r--

7043298: 4/4 fix for 7028172 causes "Label too long: ..." error message
Summary: Use '-e' version of sed expressions. Clarify and fix comments
Reviewed-by: never, acorn

duke@435 1 #
dcubed@2838 2 # Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
duke@435 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@435 4 #
duke@435 5 # This code is free software; you can redistribute it and/or modify it
duke@435 6 # under the terms of the GNU General Public License version 2 only, as
duke@435 7 # published by the Free Software Foundation.
duke@435 8 #
duke@435 9 # This code is distributed in the hope that it will be useful, but WITHOUT
duke@435 10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@435 11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@435 12 # version 2 for more details (a copy is included in the LICENSE file that
duke@435 13 # accompanied this code).
duke@435 14 #
duke@435 15 # You should have received a copy of the GNU General Public License version
duke@435 16 # 2 along with this work; if not, write to the Free Software Foundation,
duke@435 17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@435 18 #
trims@1907 19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@1907 20 # or visit www.oracle.com if you need additional information or have any
trims@1907 21 # questions.
duke@435 22 #
duke@435 23 #
duke@435 24
duke@435 25 # Rules to build serviceability agent library, used by vm.make
duke@435 26
duke@435 27 # libsaproc[_g].so: serviceability agent
phh@1558 28
phh@1558 29 SAPROC = saproc
duke@435 30 LIBSAPROC = lib$(SAPROC).so
duke@435 31
phh@1558 32 SAPROC_G = $(SAPROC)$(G_SUFFIX)
phh@1558 33 LIBSAPROC_G = lib$(SAPROC_G).so
phh@1558 34
duke@435 35 AGENT_DIR = $(GAMMADIR)/agent
duke@435 36
duke@435 37 SASRCDIR = $(AGENT_DIR)/src/os/$(Platform_os_family)/proc
duke@435 38
duke@435 39 SASRCFILES = $(SASRCDIR)/saproc.cpp
duke@435 40
duke@435 41 SAMAPFILE = $(SASRCDIR)/mapfile
duke@435 42
duke@435 43 DEST_SAPROC = $(JDK_LIBDIR)/$(LIBSAPROC)
duke@435 44
duke@435 45 # if $(AGENT_DIR) does not exist, we don't build SA
duke@435 46
stefank@2314 47 ifneq ($(wildcard $(AGENT_DIR)),)
stefank@2314 48 BUILDLIBSAPROC = $(LIBSAPROC)
stefank@2314 49 endif
duke@435 50
duke@435 51 SA_LFLAGS = $(MAPFLAG:FILENAME=$(SAMAPFILE))
duke@435 52
duke@435 53 ifdef USE_GCC
duke@435 54 SA_LFLAGS += -D_REENTRANT
duke@435 55 else
duke@435 56 SA_LFLAGS += -mt -xnolib -norunpath
duke@435 57 endif
duke@435 58
dcubed@2838 59 # The libproc Pstack_iter() interface changed in Nevada-B159.
dcubed@2886 60 # Use 'uname -r -v' to determine the Solaris version as per
dcubed@2886 61 # Solaris Nevada team request. This logic needs to match:
dcubed@2838 62 # agent/src/os/solaris/proc/saproc.cpp: set_has_newer_Pstack_iter():
dcubed@2838 63 # - skip SunOS 4 or older
dcubed@2838 64 # - skip Solaris 10 or older
dcubed@2886 65 # - skip two digit internal Nevada builds
dcubed@2886 66 # - skip three digit internal Nevada builds thru 149
dcubed@2886 67 # - skip internal Nevada builds 150-158
dcubed@2886 68 # - if not skipped, print define for Nevada-B159 or later
dcubed@2838 69 SOLARIS_11_B159_OR_LATER := \
dcubed@2838 70 $(shell uname -r -v \
dcubed@2886 71 | sed -n \
dcubed@2886 72 -e '/^[0-4]\. /b' \
dcubed@2886 73 -e '/^5\.[0-9] /b' \
dcubed@2886 74 -e '/^5\.10 /b' \
dcubed@2886 75 -e '/ snv_[0-9][0-9]$/b' \
dcubed@2886 76 -e '/ snv_[01][0-4][0-9]$/b' \
dcubed@2886 77 -e '/ snv_15[0-8]$/b' \
dcubed@2886 78 -e 's/.*/-DSOLARIS_11_B159_OR_LATER/' \
dcubed@2886 79 -e 'p' \
dcubed@2886 80 )
dcubed@2838 81
dcubed@2838 82 # Uncomment the following to simulate building on Nevada-B159 or later
dcubed@2838 83 # when actually building on Nevada-B158 or earlier:
dcubed@2838 84 #SOLARIS_11_B159_OR_LATER=-DSOLARIS_11_B159_OR_LATER
dcubed@2838 85
duke@435 86 $(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE)
duke@435 87 $(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \
duke@435 88 echo "ALT_BOOTDIR, BOOTDIR or JAVA_HOME needs to be defined to build SA"; \
duke@435 89 exit 1; \
duke@435 90 fi
duke@435 91 @echo Making SA debugger back-end...
duke@435 92 $(QUIETLY) $(CPP) \
duke@435 93 $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \
duke@435 94 -I$(SASRCDIR) \
duke@435 95 -I$(GENERATED) \
duke@435 96 -I$(BOOT_JAVA_HOME)/include \
duke@435 97 -I$(BOOT_JAVA_HOME)/include/$(Platform_os_family) \
dcubed@2838 98 $(SOLARIS_11_B159_OR_LATER) \
duke@435 99 $(SASRCFILES) \
duke@435 100 $(SA_LFLAGS) \
duke@435 101 -o $@ \
duke@435 102 -ldl -ldemangle -lthread -lc
phh@1558 103 [ -f $(LIBSAPROC_G) ] || { ln -s $@ $(LIBSAPROC_G); }
duke@435 104
stefank@2314 105 install_saproc: $(BULDLIBSAPROC)
duke@435 106 $(QUIETLY) if [ -f $(LIBSAPROC) ] ; then \
duke@435 107 echo "Copying $(LIBSAPROC) to $(DEST_SAPROC)"; \
duke@435 108 cp -f $(LIBSAPROC) $(DEST_SAPROC) && echo "Done"; \
duke@435 109 fi
duke@435 110
stefank@2314 111 .PHONY: install_saproc

mercurial