make/solaris/makefiles/saproc.make

Mon, 28 Nov 2011 14:58:31 +0100

author
stefank
date
Mon, 28 Nov 2011 14:58:31 +0100
changeset 3325
f4414323345f
parent 3150
da0999c4b733
child 3518
719f7007c8e8
permissions
-rw-r--r--

7116081: USE_PRECOMPILED_HEADER=0 triggers a single threaded build of the JVM
Summary: Changed the conditional to see if the precompiled header has been specified. Also, removed the unused PrecompiledOption.
Reviewed-by: dholmes, brutisso

     1 #
     2 # Copyright (c) 2005, 2011, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    20 # or visit www.oracle.com if you need additional information or have any
    21 # questions.
    22 #  
    23 #
    25 # Rules to build serviceability agent library, used by vm.make
    27 # libsaproc[_g].so: serviceability agent
    29 SAPROC = saproc
    30 LIBSAPROC = lib$(SAPROC).so
    32 SAPROC_G = $(SAPROC)$(G_SUFFIX)
    33 LIBSAPROC_G = lib$(SAPROC_G).so
    35 LIBSAPROC_DEBUGINFO   = lib$(SAPROC).debuginfo
    36 LIBSAPROC_G_DEBUGINFO = lib$(SAPROC_G).debuginfo
    38 AGENT_DIR = $(GAMMADIR)/agent
    40 SASRCDIR = $(AGENT_DIR)/src/os/$(Platform_os_family)/proc
    42 SASRCFILES = $(SASRCDIR)/saproc.cpp
    44 SAMAPFILE = $(SASRCDIR)/mapfile
    46 DEST_SAPROC           = $(JDK_LIBDIR)/$(LIBSAPROC)
    47 DEST_SAPROC_DEBUGINFO = $(JDK_LIBDIR)/$(LIBSAPROC_DEBUGINFO)
    49 # if $(AGENT_DIR) does not exist, we don't build SA
    51 ifneq ($(wildcard $(AGENT_DIR)),)
    52   BUILDLIBSAPROC = $(LIBSAPROC)
    53 endif
    55 SA_LFLAGS = $(MAPFLAG:FILENAME=$(SAMAPFILE))
    57 ifdef USE_GCC
    58 SA_LFLAGS += -D_REENTRANT
    59 else
    60 SA_LFLAGS += -mt -xnolib -norunpath
    61 endif
    63 # The libproc Pstack_iter() interface changed in Nevada-B159.
    64 # Use 'uname -r -v' to determine the Solaris version as per
    65 # Solaris Nevada team request. This logic needs to match:
    66 # agent/src/os/solaris/proc/saproc.cpp: set_has_newer_Pstack_iter():
    67 #   - skip SunOS 4 or older
    68 #   - skip Solaris 10 or older
    69 #   - skip two digit internal Nevada builds
    70 #   - skip three digit internal Nevada builds thru 149
    71 #   - skip internal Nevada builds 150-158
    72 #   - if not skipped, print define for Nevada-B159 or later
    73 SOLARIS_11_B159_OR_LATER := \
    74 $(shell uname -r -v \
    75     | sed -n \
    76           -e '/^[0-4]\. /b' \
    77           -e '/^5\.[0-9] /b' \
    78           -e '/^5\.10 /b' \
    79           -e '/ snv_[0-9][0-9]$$/b' \
    80           -e '/ snv_[01][0-4][0-9]$$/b' \
    81           -e '/ snv_15[0-8]$$/b' \
    82           -e 's/.*/-DSOLARIS_11_B159_OR_LATER/' \
    83           -e 'p' \
    84           )
    86 # Uncomment the following to simulate building on Nevada-B159 or later
    87 # when actually building on Nevada-B158 or earlier:
    88 #SOLARIS_11_B159_OR_LATER=-DSOLARIS_11_B159_OR_LATER
    90 $(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE)
    91 	$(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \
    92 	  echo "ALT_BOOTDIR, BOOTDIR or JAVA_HOME needs to be defined to build SA"; \
    93 	  exit 1; \
    94 	fi
    95 	@echo Making SA debugger back-end...
    96 	$(QUIETLY) $(CPP)                                               \
    97                    $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG)     \
    98 	           -I$(SASRCDIR)                                        \
    99 	           -I$(GENERATED)                                       \
   100 	           -I$(BOOT_JAVA_HOME)/include                          \
   101 	           -I$(BOOT_JAVA_HOME)/include/$(Platform_os_family)    \
   102 	           $(SOLARIS_11_B159_OR_LATER)                          \
   103 	           $(SASRCFILES)                                        \
   104 	           $(SA_LFLAGS)                                         \
   105 	           -o $@                                                \
   106 	           -ldl -ldemangle -lthread -lc
   107 	[ -f $(LIBSAPROC_G) ] || { ln -s $@ $(LIBSAPROC_G); }
   108 ifneq ($(OBJCOPY),)
   109 	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBSAPROC_DEBUGINFO)
   110 	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBSAPROC_DEBUGINFO) $@
   111   ifeq ($(STRIP_POLICY),all_strip)
   112 	$(QUIETLY) $(STRIP) $@
   113   else
   114     ifeq ($(STRIP_POLICY),min_strip)
   115 	$(QUIETLY) $(STRIP) -x $@
   116     # implied else here is no stripping at all
   117     endif
   118   endif
   119 	[ -f $(LIBSAPROC_G_DEBUGINFO) ] || { ln -s $(LIBSAPROC_DEBUGINFO) $(LIBSAPROC_G_DEBUGINFO); }
   120 endif
   122 install_saproc: $(BULDLIBSAPROC)
   123 	$(QUIETLY) if [ -f $(LIBSAPROC) ] ; then             \
   124 	  echo "Copying $(LIBSAPROC) to $(DEST_SAPROC)";     \
   125 	  test -f $(LIBSAPROC_DEBUGINFO) &&             \
   126 	    cp -f $(LIBSAPROC_DEBUGINFO) $(DEST_SAPROC_DEBUGINFO); \
   127 	  cp -f $(LIBSAPROC) $(DEST_SAPROC) && echo "Done";  \
   128 	fi
   130 .PHONY: install_saproc

mercurial