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