dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / cmd / dtrace / test / tst / common / pid / tst.utf8probemod.ksh
blobd56ef1ca18d36d7adb442b3fefed0ce7809c6510
1 #!/bin/ksh -p
3 # This file and its contents are supplied under the terms of the
4 # Common Development and Distribution License ("CDDL"), version 1.0.
5 # You may only use this file in accordance with the terms of version
6 # 1.0 of the CDDL.
8 # A full copy of the text of the CDDL should have accompanied this
9 # source. A copy of the CDDL is also available via the Internet at
10 # http://www.illumos.org/license/CDDL.
14 # Copyright (c) 2013 Joyent, Inc. All rights reserved.
17 DIR=/var/tmp/dtest.$$
18 mkdir $DIR
19 cd $DIR
21 cat > foo.c <<EOF
22 #include <stdlib.h>
24 extern void foo();
26 void
27 main()
29 foo();
31 EOF
33 cat > libfoo.c <<EOF
34 #include <stdio.h>
36 void
37 foo()
39 printf("called foo\n");
41 EOF
43 if ! gcc -m32 -fPIC -shared -o libføo.so libfoo.c -lc ; then
44 print -u 2 "failed to compile libfoo in $DIR"
45 exit 1
49 if ! gcc -m32 -o foo foo.c -lføo -L. ; then
50 print -u 2 "failed to compile foo in $DIR"
51 exit 1
54 export LD_LIBRARY_PATH=`pwd`
56 if ! dtrace -n 'pid$target:libf*::entry{printf("probemod: %s\n", probemod)}' \
57 -qc ./foo ; then
58 print -u 2 "dtrace failed in $DIR"
59 exit 1
62 cd
63 rm -rf $DIR