hotspot/build/solaris/makefiles/dtrace.make
author son
Thu, 13 Mar 2008 16:56:54 +0300
changeset 114 a777da6f3f55
parent 1 489c9b5090e2
permissions -rw-r--r--
6636368: XAtom contains unused code Summary: unused code has been removed Reviewed-by: dcherepanov
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
     2
# Copyright 2005-2007 Sun Microsystems, Inc.  All Rights Reserved.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
# published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
# This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
# version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
# accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
# You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
# 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
    19
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    20
# CA 95054 USA or visit www.sun.com if you need additional information or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    21
# have any questions.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
#  
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
489c9b5090e2 Initial load
duke
parents:
diff changeset
    25
# Rules to build jvm_db/dtrace, used by vm.make
489c9b5090e2 Initial load
duke
parents:
diff changeset
    26
489c9b5090e2 Initial load
duke
parents:
diff changeset
    27
# we build libjvm_dtrace/libjvm_db/dtrace for COMPILER1 and COMPILER2
489c9b5090e2 Initial load
duke
parents:
diff changeset
    28
# but not for CORE configuration
489c9b5090e2 Initial load
duke
parents:
diff changeset
    29
489c9b5090e2 Initial load
duke
parents:
diff changeset
    30
ifneq ("${TYPE}", "CORE")
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
ifneq ("${TYPE}", "KERNEL")
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
ifdef USE_GCC
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
dtraceCheck:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
	$(QUIETLY) echo "**NOTICE** Dtrace support disabled for gcc builds"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
else
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
JVM_DB = libjvm_db
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
LIBJVM_DB = libjvm$(G_SUFFIX)_db.so
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
JVM_DTRACE = jvm_dtrace
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
LIBJVM_DTRACE = libjvm$(G_SUFFIX)_dtrace.so
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
JVMOFFS = JvmOffsets
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
JVMOFFS.o = $(JVMOFFS).o
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
GENOFFS = generate$(JVMOFFS)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
DTRACE_SRCDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/dtrace
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
DTRACE = dtrace
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
DTRACE.o = $(DTRACE).o
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
# to remove '-g' option which causes link problems
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
# also '-z nodefs' is used as workaround
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
GENOFFS_CFLAGS = $(shell echo $(CFLAGS) | sed -e 's/ -g / /g' -e 's/ -g0 / /g';)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
ifdef LP64
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
DTRACE_OPTS = -64 -D_LP64
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
# making libjvm_db
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
INCLS = $(GENERATED)/incls
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
# Use mapfile with libjvm_db.so
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
LIBJVM_DB_MAPFILE = $(MAKEFILES_DIR)/mapfile-vers-jvm_db
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
LFLAGS_JVM_DB += $(MAPFLAG:FILENAME=$(LIBJVM_DB_MAPFILE))
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
# Use mapfile with libjvm_dtrace.so
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
LIBJVM_DTRACE_MAPFILE = $(MAKEFILES_DIR)/mapfile-vers-jvm_dtrace
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
LFLAGS_JVM_DTRACE += $(MAPFLAG:FILENAME=$(LIBJVM_DTRACE_MAPFILE))
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
ifdef USE_GCC
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
LFLAGS_JVM_DB += -D_REENTRANT $(PICFLAG)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
LFLAGS_JVM_DTRACE += -D_REENTRANT $(PICFLAG)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
else
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
LFLAGS_JVM_DB += -mt $(PICFLAG) -xnolib
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
LFLAGS_JVM_DTRACE += -mt $(PICFLAG) -xnolib
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
ISA = $(subst i386,i486,$(shell isainfo -n))
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
# Making 64/libjvm_db.so: 64-bit version of libjvm_db.so which handles 32-bit libjvm.so
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
ifneq ("${ISA}","${BUILDARCH}")
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
XLIBJVM_DB = 64/$(LIBJVM_DB)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
XLIBJVM_DTRACE = 64/$(LIBJVM_DTRACE)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
XARCH = $(subst sparcv9,v9,$(shell echo $(ISA)))
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
$(XLIBJVM_DB): $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS).h $(LIBJVM_DB_MAPFILE)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
	@echo Making $@
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
	$(QUIETLY) mkdir -p 64/ ; \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
	$(CC) $(SYMFLAG) -xarch=$(XARCH) -D$(TYPE) -I. -I$(GENERATED) \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
		$(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -lc
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
$(XLIBJVM_DTRACE): $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
	@echo Making $@
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
	$(QUIETLY) mkdir -p 64/ ; \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
	$(CC) $(SYMFLAG) -xarch=$(XARCH) -D$(TYPE) -I. \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
		$(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c -lc -lthread -ldoor
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
endif # ifneq ("${ISA}","${BUILDARCH}")
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
ifdef USE_GCC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
LFLAGS_GENOFFS += -D_REENTRANT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
LFLAGS_GENOFFS += -mt -xnolib -norunpath
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
lib$(GENOFFS).so: $(DTRACE_SRCDIR)/$(GENOFFS).cpp $(DTRACE_SRCDIR)/$(GENOFFS).h \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
                  $(INCLS)/_vmStructs.cpp.incl $(LIBJVM.o)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
	$(QUIETLY) $(CCC) $(CPPFLAGS) $(GENOFFS_CFLAGS) $(SHARED_FLAG) $(PICFLAG) \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
		 $(LFLAGS_GENOFFS) -o $@ $(DTRACE_SRCDIR)/$(GENOFFS).cpp -lc
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
$(GENOFFS): $(DTRACE_SRCDIR)/$(GENOFFS)Main.c lib$(GENOFFS).so
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
	$(QUIETLY) $(LINK.CC) -z nodefs -o $@ $(DTRACE_SRCDIR)/$(GENOFFS)Main.c \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
		./lib$(GENOFFS).so
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
# $@.tmp is created first. It's to avoid empty $(JVMOFFS).h produced in error case.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
$(JVMOFFS).h: $(GENOFFS)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
	$(QUIETLY) LD_LIBRARY_PATH=. ./$(GENOFFS) -header > $@.tmp ; \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
	if [ `diff $@.tmp $@ > /dev/null 2>&1; echo $$?` -ne 0 ] ; \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
	then rm -f $@; mv $@.tmp $@; echo Updated $@ ; \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
	else rm -f $@.tmp; \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
	fi
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
$(JVMOFFS)Index.h: $(GENOFFS)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
	$(QUIETLY) LD_LIBRARY_PATH=. ./$(GENOFFS) -index > $@.tmp ; \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
	if [ `diff $@.tmp $@ > /dev/null 2>&1; echo $$?` -ne 0 ] ; \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
	then rm -f $@; mv $@.tmp $@; echo Updated $@ ; \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
	else rm -f $@.tmp; \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
	fi
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
$(JVMOFFS).cpp: $(GENOFFS) $(JVMOFFS).h $(JVMOFFS)Index.h
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
	$(QUIETLY) LD_LIBRARY_PATH=. ./$(GENOFFS) -table > $@.tmp ; \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
	if [ `diff $@.tmp $@ > /dev/null 2>&1; echo $$?` -ne 0 ] ; \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
	then rm -f $@; mv $@.tmp $@; echo Updated $@ ; \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
	else rm -f $@.tmp; \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
	fi
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
$(JVMOFFS.o): $(JVMOFFS).h $(JVMOFFS).cpp 
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
	$(QUIETLY) $(CCC) -c -I. -o $@ $(ARCHFLAG) -D$(TYPE) $(JVMOFFS).cpp
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
$(LIBJVM_DB): $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS.o) $(XLIBJVM_DB) $(LIBJVM_DB_MAPFILE)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
	@echo Making $@
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
	$(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. -I$(GENERATED) \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
		$(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -lc
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
$(LIBJVM_DTRACE): $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(XLIBJVM_DTRACE) $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
	@echo Making $@
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
	$(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I.  \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
		$(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c -lc -lthread -ldoor
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
$(DTRACE).d: $(DTRACE_SRCDIR)/hotspot.d $(DTRACE_SRCDIR)/hotspot_jni.d \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
             $(DTRACE_SRCDIR)/hs_private.d $(DTRACE_SRCDIR)/jhelper.d
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
	$(QUIETLY) cat $^ > $@
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
# Dtrace is available, so we build $(DTRACE.o)  
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
$(DTRACE.o): $(DTRACE).d $(JVMOFFS).h $(JVMOFFS)Index.h $(DTraced_Files)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
	@echo Compiling $(DTRACE).d
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
	$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -G -o $@ -s $(DTRACE).d \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
     $(DTraced_Files) ||\
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
  STATUS=$$?;\
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
	if [ x"$$STATUS" = x"1" -a \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
       x`uname -r` = x"5.10" -a \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
       x`uname -p` = x"sparc" ]; then\
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
    echo "*****************************************************************";\
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
    echo "* If you are building server compiler, and the error message is ";\
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
    echo "* \"incorrect ELF machine type...\", you have run into solaris bug ";\
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
    echo "* 6213962, \"dtrace -G doesn't work on sparcv8+ object files\".";\
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
    echo "* Either patch/upgrade your system (>= S10u1_15), or set the ";\
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
    echo "* environment variable HOTSPOT_DISABLE_DTRACE_PROBES to disable ";\
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
    echo "* dtrace probes for this build.";\
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
    echo "*****************************************************************";\
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
  fi;\
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
  exit $$STATUS
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
  # Since some DTraced_Files are in LIBJVM.o and they are touched by this
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
  # command, and libgenerateJvmOffsets.so depends on LIBJVM.o, 'make' will
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
  # think it needs to rebuild libgenerateJvmOffsets.so and thus JvmOffsets*
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
  # files, but it doesn't, so we touch the necessary files to prevent later
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
  # recompilation. Note: we only touch the necessary files if they already
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
  # exist in order to close a race where an empty file can be created
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
  # before the real build rule is executed.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
  # But, we can't touch the *.h files:  This rule depends
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
  # on them, and that would cause an infinite cycle of rebuilding.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
  # Neither the *.h or *.ccp files need to be touched, since they have
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
  # rules which do not update them when the generator file has not
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
  # changed their contents.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
	$(QUIETLY) if [ -f lib$(GENOFFS).so ]; then touch lib$(GENOFFS).so; fi
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
	$(QUIETLY) if [ -f $(GENOFFS) ]; then touch $(GENOFFS); fi
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
	$(QUIETLY) if [ -f $(JVMOFFS.o) ]; then touch $(JVMOFFS.o); fi
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
.PHONY: dtraceCheck
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
SYSTEM_DTRACE_PROG = /usr/sbin/dtrace
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
PATCH_DTRACE_PROG = /opt/SUNWdtrd/sbin/dtrace
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
systemDtraceFound := $(wildcard ${SYSTEM_DTRACE_PROG})
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
patchDtraceFound := $(wildcard ${PATCH_DTRACE_PROG})
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
ifneq ("$(patchDtraceFound)", "")
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
DTRACE_PROG=$(PATCH_DTRACE_PROG)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
DTRACE_INCL=-I/opt/SUNWdtrd/include
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
ifneq ("$(systemDtraceFound)", "")
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
DTRACE_PROG=$(SYSTEM_DTRACE_PROG)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
endif # ifneq ("$(systemDtraceFound)", "")
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
endif # ifneq ("$(patchDtraceFound)", "")
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
ifneq ("${DTRACE_PROG}", "")
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
ifeq ("${HOTSPOT_DISABLE_DTRACE_PROBES}", "")
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
DTRACE_OBJS = $(DTRACE.o) $(JVMOFFS.o)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
CFLAGS += $(DTRACE_INCL) -DDTRACE_ENABLED
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
MAPFILE_DTRACE_OPT = $(MAPFILE_DTRACE)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
dtraceCheck:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
else # manually disabled
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
dtraceCheck:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   224
	$(QUIETLY) echo "**NOTICE** Dtrace support disabled via environment variable"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
endif # ifeq ("${HOTSPOT_DISABLE_DTRACE_PROBES}", "")
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
else # No dtrace program found
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
dtraceCheck:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
	$(QUIETLY) echo "**NOTICE** Dtrace support disabled: not supported by system"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   232
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
endif # ifneq ("${dtraceFound}", "")
489c9b5090e2 Initial load
duke
parents:
diff changeset
   234
489c9b5090e2 Initial load
duke
parents:
diff changeset
   235
endif # ifdef USE_GCC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   236
489c9b5090e2 Initial load
duke
parents:
diff changeset
   237
else # KERNEL build
489c9b5090e2 Initial load
duke
parents:
diff changeset
   238
489c9b5090e2 Initial load
duke
parents:
diff changeset
   239
dtraceCheck:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   240
	$(QUIETLY) echo "**NOTICE** Dtrace support disabled for KERNEL builds"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   241
489c9b5090e2 Initial load
duke
parents:
diff changeset
   242
endif # ifneq ("${TYPE}", "KERNEL")
489c9b5090e2 Initial load
duke
parents:
diff changeset
   243
489c9b5090e2 Initial load
duke
parents:
diff changeset
   244
else # CORE build
489c9b5090e2 Initial load
duke
parents:
diff changeset
   245
489c9b5090e2 Initial load
duke
parents:
diff changeset
   246
dtraceCheck:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   247
	$(QUIETLY) echo "**NOTICE** Dtrace support disabled for CORE builds"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   248
489c9b5090e2 Initial load
duke
parents:
diff changeset
   249
endif # ifneq ("${TYPE}", "CORE")