X-Git-Url: https://perl5.git.perl.org/metaconfig.git/blobdiff_plain/99c9005fc91a1c28d23319b3d8cfec94bb7073c0..c341ceee5971f456c7b673240b37e1c8a2db8c1c:/U/perl/dtraceobject.U diff --git a/U/perl/dtraceobject.U b/U/perl/dtraceobject.U index e9f07dc..8bbbb36 100644 --- a/U/perl/dtraceobject.U +++ b/U/perl/dtraceobject.U @@ -3,21 +3,54 @@ ?RCS: You may distribute under the terms of either the GNU General Public ?RCS: License or the Artistic License, as specified in the README file. ?RCS: -?MAKE:dtraceobject: usedtrace dtrace cc ccflags rm optimize Compile cat -?MAKE: -pick add $@ $@ +?MAKE:dtraceobject dtracexnolibs: usedtrace dtrace cc ccflags optimize \ + Compile cat rm_try +?MAKE: -pick add $@ %< ?S:dtraceobject: ?S: Whether we need to build an object file with the dtrace tool. ?S:. +?S:dtracexnolibs: +?S: Whether dtrace accepts -xnolibs. If available we call dtrace -h +?S: and dtrace -G with -xnolibs to allow dtrace to run in a jail on +?S: FreeBSD. +?S:. +?T:xnolibs : Probe whether dtrace builds an object, as newer Illumos requires an input : object file that uses at least one of the probes defined in the .d file case "$usedtrace" in $define) + case "$dtracexnolibs" in + $define|true|[yY]*) + dtracexnolibs=$define + $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h + ;; + ' '|'') + if $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h 2>&1 ; then + dtracexnolibs=$define + echo "Your dtrace accepts -xnolibs" + elif $dtrace -h -s ../perldtrace.d -o perldtrace.h 2>&1 ; then + dtracexnolibs=$undef + echo "Your dtrace doesn't accept -xnolibs" + else + echo "Your dtrace doesn't work at all, try building without dtrace support" >&4 + exit 1 + fi + ;; + *) + dtracexnolibs=$undef + $dtrace -h -s ../perldtrace.d -o perldtrace.h + ;; + esac + case $dtracexnolibs in + $define) xnolibs=-xnolibs ;; + *) xnolibs= ;; + esac + case "$dtraceobject" in $define|true|[yY]*) dtraceobject=$define ;; ' '|'') - $dtrace -h -s ../perldtrace.d -o perldtrace.h $cat >try.c </dev/null 2>&1; then + && $dtrace -G $xnolibs -s ../perldtrace.d try.o >/dev/null 2>&1; then dtraceobject=$define echo "Your dtrace builds an object file" fi - $rm -f try.c try.o perldtrace.o ;; *) dtraceobject=$undef ;; esac + $rm_try perldtrace.o perldtrace.h esac