err.invalidlibdep.ksh revision 5478:d21b1fd9aff6
1291333Sjkim#
2291333Sjkim# CDDL HEADER START
3291333Sjkim#
4291333Sjkim# The contents of this file are subject to the terms of the
5291333Sjkim# Common Development and Distribution License (the "License").
6291333Sjkim# You may not use this file except in compliance with the License.
7291333Sjkim#
8298714Sjkim# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9291333Sjkim# or http://www.opensolaris.org/os/licensing.
10291333Sjkim# See the License for the specific language governing permissions
11291333Sjkim# and limitations under the License.
12291333Sjkim#
13291333Sjkim# When distributing Covered Code, include this CDDL HEADER in each
14291333Sjkim# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15291333Sjkim# If applicable, add the following below this CDDL HEADER, with the
16291333Sjkim# fields enclosed by brackets "[]" replaced with your own identifying
17291333Sjkim# information: Portions Copyright [yyyy] [name of copyright owner]
18291333Sjkim#
19291333Sjkim# CDDL HEADER END
20291333Sjkim#
21291333Sjkim
22291333Sjkim#
23291333Sjkim# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
24291333Sjkim# Use is subject to license terms.
25291333Sjkim#
26291333Sjkim# ident	"%Z%%M%	%I%	%E% SMI"
27291333Sjkim
28291333Sjkimif [ $# != 1 ]; then
29291333Sjkim	echo expected one argument: '<'dtrace-path'>'
30291333Sjkim	exit 2
31291333Sjkimfi
32291333Sjkim
33291333Sjkimlibdir=${TMPDIR:-/tmp}/libdep.$$
34291333Sjkimdtrace=$1
35291333Sjkim
36291333Sjkimsetup_libs()
37291333Sjkim{
38291333Sjkim	mkdir $libdir
39291333Sjkim	cat > $libdir/liba.$$.d <<EOF
40291333Sjkim#pragma D depends_on library libnotthere.$$.d
41291333SjkimEOF
42291333Sjkim	cat > $libdir/libb.$$.d <<EOF
43291333Sjkim#pragma D depends_on library libc.$$.d
44291333SjkimEOF
45291333Sjkim	cat > $libdir/libc.$$.d <<EOF
46298714Sjkim#pragma D depends_on library liba.$$.d
47298714SjkimEOF
48291333Sjkim}
49291333Sjkim
50291333Sjkim
51291333Sjkimsetup_libs
52291333Sjkim
53291333Sjkim$dtrace -L$libdir -e
54291333Sjkim
55291333Sjkimstatus=$?
56291333Sjkimrm -rf $libdir
57291333Sjkimreturn $status
58291333Sjkim