1 ?RCS: Copyright (c) 2016 Tony Cook
3 ?RCS: You may distribute under the terms of either the GNU General Public
4 ?RCS: License or the Artistic License, as specified in the README file.
6 ?MAKE:dtraceobject dtracexnolibs: usedtrace dtrace cc ccflags optimize \
10 ?S: Whether we need to build an object file with the dtrace tool.
13 ?S: Whether dtrace accepts -xnolibs. If available we call dtrace -h
14 ?S: and dtrace -G with -xnolibs to allow dtrace to run in a jail on
18 : Probe whether dtrace builds an object, as newer Illumos requires an input
19 : object file that uses at least one of the probes defined in the .d file
22 case "$dtracexnolibs" in
25 $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h
28 if $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
30 echo "Your dtrace accepts -xnolibs"
31 elif $dtrace -h -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
33 echo "Your dtrace doesn't accept -xnolibs"
35 echo "Your dtrace doesn't work at all, try building without dtrace support" >&4
41 $dtrace -h -s ../perldtrace.d -o perldtrace.h
44 case $dtracexnolibs in
45 $define) xnolibs=-xnolibs ;;
49 case "$dtraceobject" in
55 #include "perldtrace.h"
57 PERL_LOADED_FILE("dummy");
62 if $cc -c -o try.o $optimize $ccflags try.c \
63 && $dtrace -G $xnolibs -s ../perldtrace.d try.o >/dev/null 2>&1; then
65 echo "Your dtrace builds an object file"
68 *) dtraceobject=$undef ;;
70 $rm_try perldtrace.o perldtrace.h