hotspot/make/bsd/makefiles/dtrace.make
author sla
Thu, 16 Jan 2014 20:14:21 +0100
changeset 22520 b9e88eed82d7
parent 20686 1fa9a75192c3
child 22736 6c317cced072
permissions -rw-r--r--
8030812: Change the solaris DTrace implementation to use USDT2 instead of USDT1 Reviewed-by: coleenp, sspitsyn, dsamersoff
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10565
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     1
#
15432
9d976ca484d8 8000692: Remove old KERNEL code
zgu
parents: 14815
diff changeset
     2
# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
10565
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     4
#
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     7
# published by the Free Software Foundation.
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     8
#
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     9
# This code is distributed in the hope that it will be useful, but WITHOUT
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    10
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    11
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    12
# version 2 for more details (a copy is included in the LICENSE file that
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    13
# accompanied this code).
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    14
#
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    15
# You should have received a copy of the GNU General Public License version
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    16
# 2 along with this work; if not, write to the Free Software Foundation,
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    17
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    18
#
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    19
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    20
# or visit www.oracle.com if you need additional information or have any
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    21
# questions.
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    22
#  
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    23
#
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    24
10739
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    25
# Rules to build jvm_db/dtrace, used by vm.make
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    26
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    27
# We build libjvm_dtrace/libjvm_db/dtrace for COMPILER1 and COMPILER2
15432
9d976ca484d8 8000692: Remove old KERNEL code
zgu
parents: 14815
diff changeset
    28
# but not for CORE configuration.
10739
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    29
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    30
ifneq ("${TYPE}", "CORE")
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    31
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    32
ifeq ($(OS_VENDOR), Darwin)
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    33
# we build dtrace for macosx using USDT2 probes
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    34
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    35
DtraceOutDir = $(GENERATED)/dtracefiles
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    36
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    37
# Bsd does not build libjvm_db, does not compile on macosx
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    38
# disabled in build: rule in vm.make
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    39
JVM_DB = libjvm_db
14815
41114a74463a 7153050: remove crufty '_g' support from HotSpot repo makefiles
dcubed
parents: 13974
diff changeset
    40
LIBJVM_DB = libjvm_db.dylib
10739
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    41
20686
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
    42
LIBJVM_DB_DEBUGINFO   = libjvm_db.dylib.dSYM
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
    43
LIBJVM_DB_DIZ         = libjvm_db.diz
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
    44
10739
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    45
JVM_DTRACE = jvm_dtrace
14815
41114a74463a 7153050: remove crufty '_g' support from HotSpot repo makefiles
dcubed
parents: 13974
diff changeset
    46
LIBJVM_DTRACE = libjvm_dtrace.dylib
10739
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    47
20686
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
    48
LIBJVM_DTRACE_DEBUGINFO   = libjvm_dtrace.dylib.dSYM
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
    49
LIBJVM_DTRACE_DIZ         = libjvm_dtrace.diz
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
    50
10739
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    51
JVMOFFS = JvmOffsets
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    52
JVMOFFS.o = $(JVMOFFS).o
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    53
GENOFFS = generate$(JVMOFFS)
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    54
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    55
DTRACE_SRCDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/dtrace
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    56
DTRACE = dtrace
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    57
DTRACE.o = $(DTRACE).o
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    58
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    59
# to remove '-g' option which causes link problems
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    60
# also '-z nodefs' is used as workaround
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    61
GENOFFS_CFLAGS = $(shell echo $(CFLAGS) | sed -e 's/ -g / /g' -e 's/ -g0 / /g';)
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    62
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    63
ifdef LP64
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    64
DTRACE_OPTS = -D_LP64
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    65
endif
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    66
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    67
# making libjvm_db
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    68
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    69
# Use mapfile with libjvm_db.so
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    70
LIBJVM_DB_MAPFILE = # no mapfile for usdt2 # $(MAKEFILES_DIR)/mapfile-vers-jvm_db
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    71
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    72
# Use mapfile with libjvm_dtrace.so
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    73
LIBJVM_DTRACE_MAPFILE = # no mapfile for usdt2 # $(MAKEFILES_DIR)/mapfile-vers-jvm_dtrace
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    74
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    75
LFLAGS_JVM_DB += $(PICFLAG) # -D_REENTRANT
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    76
LFLAGS_JVM_DTRACE += $(PICFLAG) # -D_REENTRANT
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    77
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    78
ISA = $(subst i386,i486,$(BUILDARCH))
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    79
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    80
# Making 64/libjvm_db.so: 64-bit version of libjvm_db.so which handles 32-bit libjvm.so
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    81
ifneq ("${ISA}","${BUILDARCH}")
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    82
20686
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
    83
XLIBJVM_DIR = 64
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
    84
XLIBJVM_DB = $(XLIBJVM_DIR)/$(LIBJVM_DB)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
    85
XLIBJVM_DTRACE = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE)
10739
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    86
XARCH = $(subst sparcv9,v9,$(shell echo $(ISA)))
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    87
20686
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
    88
XLIBJVM_DB_DEBUGINFO       = $(XLIBJVM_DIR)/$(LIBJVM_DB_DEBUGINFO)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
    89
XLIBJVM_DB_DIZ             = $(XLIBJVM_DIR)/$(LIBJVM_DB_DIZ)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
    90
XLIBJVM_DTRACE_DEBUGINFO   = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE_DEBUGINFO)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
    91
XLIBJVM_DTRACE_DIZ         = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE_DIZ)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
    92
10739
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    93
$(XLIBJVM_DB): $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS).h $(LIBJVM_DB_MAPFILE)
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    94
	@echo Making $@
20686
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
    95
	$(QUIETLY) mkdir -p $(XLIBJVM_DIR) ; \
10739
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    96
	$(CC) $(SYMFLAG) -xarch=$(XARCH) -D$(TYPE) -I. -I$(GENERATED) \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    97
		$(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c #-lc
20686
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
    98
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
    99
  ifeq ($(OS_VENDOR), Darwin)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   100
	$(DSYMUTIL) $@
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   101
    ifeq ($(ZIP_DEBUGINFO_FILES),1)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   102
        # Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   103
        # is not in the archived name:
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   104
	( cd $(XLIBJVM_DIR) && $(ZIPEXE) -q -r -y $(LIBJVM_DB_DIZ) $(LIBJVM_DB_DEBUGINFO) )
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   105
	$(RM) -r $(XLIBJVM_DB_DEBUGINFO)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   106
    endif
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   107
  else
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   108
	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(XLIBJVM_DB_DEBUGINFO)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   109
        # Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   110
        # is not in the link name:
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   111
        $(QUIETLY) ( cd $(XLIBJVM_DIR) && $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DB_DEBUGINFO) $(LIBJVM_DB) )
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   112
    ifeq ($(STRIP_POLICY),all_strip)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   113
	$(QUIETLY) $(STRIP) $@
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   114
    else
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   115
      ifeq ($(STRIP_POLICY),min_strip)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   116
	$(QUIETLY) $(STRIP) -x $@
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   117
      # implied else here is no stripping at all
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   118
      endif
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   119
    endif
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   120
    ifeq ($(ZIP_DEBUGINFO_FILES),1)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   121
        # Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   122
        # is not in the archived name:
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   123
	( cd $(XLIBJVM_DIR) && $(ZIPEXE) -q -y $(LIBJVM_DB_DIZ) $(LIBJVM_DB_DEBUGINFO) )
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   124
	$(RM) $(XLIBJVM_DB_DEBUGINFO)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   125
    endif
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   126
  endif
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   127
endif
10739
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   128
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   129
$(XLIBJVM_DTRACE): $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE)
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   130
	@echo Making $@
20686
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   131
	$(QUIETLY) mkdir -p $(XLIBJVM_DIR) ; \
10739
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   132
	$(CC) $(SYMFLAG) -xarch=$(XARCH) -D$(TYPE) -I. \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   133
		$(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c #-lc -lthread -ldoor
20686
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   134
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   135
  ifeq ($(OS_VENDOR), Darwin)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   136
	$(DSYMUTIL) $@
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   137
    ifeq ($(ZIP_DEBUGINFO_FILES),1)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   138
        # Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   139
        # is not in the archived name:
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   140
	( cd $(XLIBJVM_DIR) && $(ZIPEXE) -q -r -y $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_DEBUGINFO) )
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   141
	$(RM) -r $(XLIBJVM_DTRACE_DEBUGINFO)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   142
    endif
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   143
  else
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   144
	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(XLIBJVM_DTRACE_DEBUGINFO)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   145
        # Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   146
        # is not in the link name:
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   147
	( cd $(XLIBJVM_DIR) && $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DTRACE_DEBUGINFO) $(LIBJVM_DTRACE) )
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   148
    ifeq ($(STRIP_POLICY),all_strip)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   149
	$(QUIETLY) $(STRIP) $@
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   150
    else
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   151
      ifeq ($(STRIP_POLICY),min_strip)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   152
	$(QUIETLY) $(STRIP) -x $@
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   153
      # implied else here is no stripping at all
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   154
      endif
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   155
    endif
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   156
    ifeq ($(ZIP_DEBUGINFO_FILES),1)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   157
        # Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   158
        # is not in the archived name:
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   159
	( cd $(XLIBJVM_DIR) && $(ZIPEXE) -q -y $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_DEBUGINFO) )
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   160
	$(RM) $(XLIBJVM_DTRACE_DEBUGINFO)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   161
    endif
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   162
  endif
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   163
endif
10739
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   164
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   165
endif # ifneq ("${ISA}","${BUILDARCH}")
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   166
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   167
LFLAGS_GENOFFS += -L.
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   168
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   169
lib$(GENOFFS).dylib: $(DTRACE_SRCDIR)/$(GENOFFS).cpp $(DTRACE_SRCDIR)/$(GENOFFS).h \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   170
                  $(LIBJVM.o)
11721
dcd1f62c9caf 7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents: 10739
diff changeset
   171
	$(QUIETLY) $(CXX) $(CXXFLAGS) $(GENOFFS_CFLAGS) $(SHARED_FLAG) $(PICFLAG) \
10739
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   172
		 $(LFLAGS_GENOFFS) -o $@ $(DTRACE_SRCDIR)/$(GENOFFS).cpp -ljvm
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   173
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   174
$(GENOFFS): $(DTRACE_SRCDIR)/$(GENOFFS)Main.c lib$(GENOFFS).dylib
11721
dcd1f62c9caf 7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents: 10739
diff changeset
   175
	$(QUIETLY) $(LINK.CXX) -o $@ $(DTRACE_SRCDIR)/$(GENOFFS)Main.c \
10739
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   176
		./lib$(GENOFFS).dylib
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   177
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   178
# $@.tmp is created first to avoid an empty $(JVMOFFS).h if an error occurs.
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   179
$(JVMOFFS).h: $(GENOFFS)
13966
7b818806118b 8000485: Hotspot build fails in Solaris Studio IDE when building dtrace
vlivanov
parents: 11721
diff changeset
   180
	$(QUIETLY) DYLD_LIBRARY_PATH=.:$(DYLD_LIBRARY_PATH) ./$(GENOFFS) -header > $@.tmp; touch $@; \
10739
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   181
	if [ `diff $@.tmp $@ > /dev/null 2>&1; echo $$?` -ne 0 ] ; \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   182
	then rm -f $@; mv $@.tmp $@; \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   183
	else rm -f $@.tmp; \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   184
	fi
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   185
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   186
$(JVMOFFS)Index.h: $(GENOFFS)
13966
7b818806118b 8000485: Hotspot build fails in Solaris Studio IDE when building dtrace
vlivanov
parents: 11721
diff changeset
   187
	$(QUIETLY) DYLD_LIBRARY_PATH=.:$(DYLD_LIBRARY_PATH) ./$(GENOFFS) -index > $@.tmp; touch $@; \
10739
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   188
	if [ `diff $@.tmp $@ > /dev/null 2>&1; echo $$?` -ne 0 ] ; \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   189
	then rm -f $@; mv $@.tmp $@; \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   190
	else rm -f $@.tmp; \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   191
	fi
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   192
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   193
$(JVMOFFS).cpp: $(GENOFFS) $(JVMOFFS).h $(JVMOFFS)Index.h
13966
7b818806118b 8000485: Hotspot build fails in Solaris Studio IDE when building dtrace
vlivanov
parents: 11721
diff changeset
   194
	$(QUIETLY) DYLD_LIBRARY_PATH=.:$(DYLD_LIBRARY_PATH) ./$(GENOFFS) -table > $@.tmp; touch $@; \
10739
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   195
	if [ `diff $@.tmp $@ > /dev/null 2>&1; echo $$?` -ne 0 ] ; \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   196
	then rm -f $@; mv $@.tmp $@; \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   197
	else rm -f $@.tmp; \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   198
	fi
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   199
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   200
$(JVMOFFS.o): $(JVMOFFS).h $(JVMOFFS).cpp 
11721
dcd1f62c9caf 7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents: 10739
diff changeset
   201
	$(QUIETLY) $(CXX) -c -I. -o $@ $(ARCHFLAG) -D$(TYPE) $(JVMOFFS).cpp
10739
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   202
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   203
$(LIBJVM_DB): $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS.o) $(XLIBJVM_DB) $(LIBJVM_DB_MAPFILE)
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   204
	@echo Making $@
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   205
	$(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. -I$(GENERATED) \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   206
		$(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -Wall # -lc
20686
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   207
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   208
  ifeq ($(OS_VENDOR), Darwin)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   209
	$(DSYMUTIL) $@
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   210
    ifeq ($(ZIP_DEBUGINFO_FILES),1)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   211
	$(ZIPEXE) -q -r -y $(LIBJVM_DB_DIZ) $(LIBJVM_DB_DEBUGINFO)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   212
	$(RM) -r $(LIBJVM_DB_DEBUGINFO)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   213
    endif
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   214
  else
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   215
	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DB_DEBUGINFO)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   216
	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DB_DEBUGINFO) $@
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   217
    ifeq ($(STRIP_POLICY),all_strip)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   218
	$(QUIETLY) $(STRIP) $@
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   219
    else
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   220
      ifeq ($(STRIP_POLICY),min_strip)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   221
	$(QUIETLY) $(STRIP) -x $@
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   222
      # implied else here is no stripping at all
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   223
      endif
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   224
    endif
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   225
    ifeq ($(ZIP_DEBUGINFO_FILES),1)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   226
	$(ZIPEXE) -q -y $(LIBJVM_DB_DIZ) $(LIBJVM_DB_DEBUGINFO)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   227
	$(RM) $(LIBJVM_DB_DEBUGINFO)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   228
    endif
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   229
  endif
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   230
endif
10739
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   231
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   232
$(LIBJVM_DTRACE): $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(XLIBJVM_DTRACE) $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE)
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   233
	@echo Making $@
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   234
	$(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I.  \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   235
		$(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c #-lc -lthread -ldoor
20686
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   236
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   237
  ifeq ($(OS_VENDOR), Darwin)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   238
	$(DSYMUTIL) $@
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   239
    ifeq ($(ZIP_DEBUGINFO_FILES),1)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   240
	$(ZIPEXE) -q -r -y $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_DEBUGINFO) 
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   241
	$(RM) -r $(LIBJVM_DTRACE_DEBUGINFO)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   242
    endif
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   243
  else
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   244
	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DTRACE_DEBUGINFO)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   245
	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DTRACE_DEBUGINFO) $@
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   246
    ifeq ($(STRIP_POLICY),all_strip)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   247
	$(QUIETLY) $(STRIP) $@
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   248
    else
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   249
      ifeq ($(STRIP_POLICY),min_strip)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   250
	$(QUIETLY) $(STRIP) -x $@
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   251
      # implied else here is no stripping at all
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   252
      endif
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   253
    endif
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   254
    ifeq ($(ZIP_DEBUGINFO_FILES),1)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   255
	$(ZIPEXE) -q -y $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_DEBUGINFO) 
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   256
	$(RM) $(LIBJVM_DTRACE_DEBUGINFO)
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   257
    endif
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   258
  endif
1fa9a75192c3 7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents: 15432
diff changeset
   259
endif
10739
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   260
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   261
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   262
$(DtraceOutDir):
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   263
	mkdir $(DtraceOutDir)
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   264
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   265
$(DtraceOutDir)/hotspot.h: $(DTRACE_SRCDIR)/hotspot.d | $(DtraceOutDir)
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   266
	$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_SRCDIR)/hotspot.d
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   267
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   268
$(DtraceOutDir)/hotspot_jni.h: $(DTRACE_SRCDIR)/hotspot_jni.d | $(DtraceOutDir)
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   269
	$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_SRCDIR)/hotspot_jni.d
10565
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   270
10739
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   271
$(DtraceOutDir)/hs_private.h: $(DTRACE_SRCDIR)/hs_private.d | $(DtraceOutDir)
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   272
	$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_SRCDIR)/hs_private.d
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   273
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   274
dtrace_gen_headers: $(DtraceOutDir)/hotspot.h $(DtraceOutDir)/hotspot_jni.h $(DtraceOutDir)/hs_private.h 
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   275
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   276
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   277
.PHONY: dtraceCheck
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   278
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   279
SYSTEM_DTRACE_PROG = /usr/sbin/dtrace
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   280
systemDtraceFound := $(wildcard ${SYSTEM_DTRACE_PROG})
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   281
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   282
ifneq ("$(systemDtraceFound)", "")
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   283
DTRACE_PROG=$(SYSTEM_DTRACE_PROG)
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   284
else
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   285
22520
b9e88eed82d7 8030812: Change the solaris DTrace implementation to use USDT2 instead of USDT1
sla
parents: 20686
diff changeset
   286
endif
10739
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   287
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   288
ifneq ("${DTRACE_PROG}", "")
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   289
ifeq ("${HOTSPOT_DISABLE_DTRACE_PROBES}", "")
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   290
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   291
DTRACE_OBJS = $(DTRACE.o) #$(JVMOFFS.o)
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   292
CFLAGS += -DDTRACE_ENABLED #$(DTRACE_INCL)
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   293
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   294
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   295
dtraceCheck:
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   296
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   297
dtrace_stuff: dtrace_gen_headers
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   298
	$(QUIETLY) echo "dtrace headers generated"
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   299
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   300
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   301
else # manually disabled
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   302
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   303
dtraceCheck:
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   304
	$(QUIETLY) echo "**NOTICE** Dtrace support disabled via environment variable"
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   305
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   306
dtrace_stuff:
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   307
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   308
endif # ifeq ("${HOTSPOT_DISABLE_DTRACE_PROBES}", "")
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   309
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   310
else # No dtrace program found
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   311
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   312
dtraceCheck:
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   313
	$(QUIETLY) echo "**NOTICE** Dtrace support disabled: not supported by system"
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   314
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   315
dtrace_stuff:
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   316
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   317
endif # ifneq ("${dtraceFound}", "")
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   318
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   319
endif # ifeq ($(OS_VENDOR), Darwin)
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   320
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   321
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   322
else # CORE build
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   323
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   324
dtraceCheck:
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   325
	$(QUIETLY) echo "**NOTICE** Dtrace support disabled for CORE builds"
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   326
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   327
endif # ifneq ("${TYPE}", "CORE")