16
16
AS_IF([test "$ac_cv_enable_dtrace" = "yes"],[
17
17
AC_CHECK_PROGS([DTRACE], [dtrace])
18
18
AS_IF([test "x$ac_cv_prog_DTRACE" = "xdtrace"],[
19
AC_DEFINE([HAVE_DTRACE], [1], [Enables DTRACE Support])
20
AC_MSG_CHECKING([if dtrace should instrument object files])
21
dnl DTrace on MacOSX does not use -G option
22
cat >conftest.d <<_ACEOF
27
$DTRACE -G -o conftest.d.o -s conftest.d 2>/dev/zero
28
AS_IF([test $? -eq 0],[ac_cv_dtrace_needs_objects=yes],
20
AC_CACHE_CHECK([if dtrace works],[ac_cv_dtrace_works],[
21
cat >conftest.d <<_ACEOF
26
$DTRACE -h -o conftest.h -s conftest.d 2>/dev/zero
27
AS_IF([test $? -eq 0],[ac_cv_dtrace_works=yes],
28
[ac_cv_dtrace_works=no])
29
rm -f conftest.h conftest.d
31
AS_IF([test "x$ac_cv_dtrace_works" = "xyes"],[
32
AC_DEFINE([HAVE_DTRACE], [1], [Enables DTRACE Support])
34
AC_CACHE_CHECK([if dtrace should instrument object files],
35
[ac_cv_dtrace_needs_objects],[
36
dnl DTrace on MacOSX does not use -G option
37
cat >conftest.d <<_ACEOF
42
$DTRACE -G -o conftest.d.o -s conftest.d 2>/dev/zero
43
AS_IF([test $? -eq 0],[ac_cv_dtrace_needs_objects=yes],
29
44
[ac_cv_dtrace_needs_objects=no])
30
rm -f conftest.d.o conftest.d
31
AC_MSG_RESULT($ac_cv_dtrace_needs_objects)
45
rm -f conftest.d.o conftest.d
32
47
AC_SUBST(DTRACEFLAGS) dnl TODO: test for -G on OSX
33
48
ac_cv_have_dtrace=yes
36
AM_CONDITIONAL([HAVE_DTRACE], [test "x$ac_cv_have_dtrace" = "xyes"])
51
AM_CONDITIONAL([HAVE_DTRACE], [test "x$ac_cv_dtrace_works" = "xyes"])
37
52
AM_CONDITIONAL([DTRACE_NEEDS_OBJECTS],
38
53
[test "x$ac_cv_dtrace_needs_objects" = "xyes"])