- AS_IF([test "x$ac_cv_prog_DTRACE" = "xdtrace"],[
- AC_DEFINE([HAVE_DTRACE], [1], [Enables DTRACE Support])
- AC_MSG_CHECKING([if dtrace should instrument object files])
- dnl DTrace on MacOSX does not use -G option
- cat >conftest.d <<_ACEOF
+ AC_CHECK_HEADERS(sys/sdt.h)
+
+ AS_IF([test "x$ac_cv_prog_DTRACE" = "xdtrace" -a "x${ac_cv_header_sys_sdt_h}" = "xyes"],[
+
+ AC_CACHE_CHECK([if dtrace works],[ac_cv_dtrace_works],[
+ cat >conftest.d <<_ACEOF
+provider Example {
+ probe increment(int);
+};
+_ACEOF
+ $DTRACE -h -o conftest.h -s conftest.d 2>/dev/zero
+ AS_IF([test $? -eq 0],[ac_cv_dtrace_works=yes],
+ [ac_cv_dtrace_works=no])
+ rm -f conftest.h conftest.d
+ ])
+ AS_IF([test "x$ac_cv_dtrace_works" = "xyes"],[
+ AC_DEFINE([HAVE_DTRACE], [1], [Enables DTRACE Support])
+ ])
+ AC_CACHE_CHECK([if dtrace should instrument object files],
+ [ac_cv_dtrace_needs_objects],[
+ dnl DTrace on MacOSX does not use -G option
+ cat >conftest.d <<_ACEOF