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