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
19 : Probe whether dtrace builds an object, as newer Illumos requires an input
20 : object file that uses at least one of the probes defined in the .d file
23 case "$dtracexnolibs" in
26 $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h
29 if $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
31 echo "Your dtrace accepts -xnolibs"
32 elif $dtrace -h -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
34 echo "Your dtrace doesn't accept -xnolibs"
36 echo "Your dtrace doesn't work at all, try building without dtrace support" >&4
42 $dtrace -h -s ../perldtrace.d -o perldtrace.h
45 case $dtracexnolibs in
46 $define) xnolibs=-xnolibs ;;
50 case "$dtraceobject" in
56 #include "perldtrace.h"
58 PERL_LOADED_FILE("dummy");
63 if $cc -c -o try.o $optimize $ccflags try.c \
64 && $dtrace -G $xnolibs -s ../perldtrace.d try.o >/dev/null 2>&1; then
66 echo "Your dtrace builds an object file"
69 *) dtraceobject=$undef ;;
71 $rm_try perldtrace.o perldtrace.h