1*5478Sjhaslam# 2*5478Sjhaslam# CDDL HEADER START 3*5478Sjhaslam# 4*5478Sjhaslam# The contents of this file are subject to the terms of the 5*5478Sjhaslam# Common Development and Distribution License (the "License"). 6*5478Sjhaslam# You may not use this file except in compliance with the License. 7*5478Sjhaslam# 8*5478Sjhaslam# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*5478Sjhaslam# or http://www.opensolaris.org/os/licensing. 10*5478Sjhaslam# See the License for the specific language governing permissions 11*5478Sjhaslam# and limitations under the License. 12*5478Sjhaslam# 13*5478Sjhaslam# When distributing Covered Code, include this CDDL HEADER in each 14*5478Sjhaslam# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*5478Sjhaslam# If applicable, add the following below this CDDL HEADER, with the 16*5478Sjhaslam# fields enclosed by brackets "[]" replaced with your own identifying 17*5478Sjhaslam# information: Portions Copyright [yyyy] [name of copyright owner] 18*5478Sjhaslam# 19*5478Sjhaslam# CDDL HEADER END 20*5478Sjhaslam# 21*5478Sjhaslam 22*5478Sjhaslam# 23*5478Sjhaslam# Copyright 2007 Sun Microsystems, Inc. All rights reserved. 24*5478Sjhaslam# Use is subject to license terms. 25*5478Sjhaslam# 26*5478Sjhaslam# ident "%Z%%M% %I% %E% SMI" 27*5478Sjhaslam 28*5478Sjhaslamif [ $# != 1 ]; then 29*5478Sjhaslam echo expected one argument: '<'dtrace-path'>' 30*5478Sjhaslam exit 2 31*5478Sjhaslamfi 32*5478Sjhaslam 33*5478Sjhaslamlibdir=${TMPDIR:-/tmp}/libdep.$$ 34*5478Sjhaslamdtrace=$1 35*5478Sjhaslam 36*5478Sjhaslamsetup_libs() 37*5478Sjhaslam{ 38*5478Sjhaslam mkdir $libdir 39*5478Sjhaslam cat > $libdir/liba.$$.d <<EOF 40*5478Sjhaslam#pragma D depends_on library libnotthere.$$.d 41*5478SjhaslamEOF 42*5478Sjhaslam cat > $libdir/libb.$$.d <<EOF 43*5478Sjhaslam#pragma D depends_on library libc.$$.d 44*5478SjhaslamEOF 45*5478Sjhaslam cat > $libdir/libc.$$.d <<EOF 46*5478Sjhaslam#pragma D depends_on library liba.$$.d 47*5478SjhaslamEOF 48*5478Sjhaslam} 49*5478Sjhaslam 50*5478Sjhaslam 51*5478Sjhaslamsetup_libs 52*5478Sjhaslam 53*5478Sjhaslam$dtrace -L$libdir -e 54*5478Sjhaslam 55*5478Sjhaslamstatus=$? 56*5478Sjhaslamrm -rf $libdir 57*5478Sjhaslamreturn $status 58