~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to m4/pandora_enable_dtrace.m4

  • Committer: Jay Pipes
  • Date: 2009-09-15 21:01:42 UTC
  • mto: (1126.2.5 merge)
  • mto: This revision was merged to the branch mainline in revision 1128.
  • Revision ID: jpipes@serialcoder-20090915210142-x8mwiqn1q0vzjspp
Moves Alter_info out into its own header and source file, cleans up some related include mess in sql_lex.h, and renames Alter_info to AlterInfo.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
dnl  Copyright (C) 2009 Sun Microsystems, Inc.
2
 
dnl This file is free software; Sun Microsystems, Inc.
 
1
dnl  Copyright (C) 2009 Sun Microsystems
 
2
dnl This file is free software; Sun Microsystems
3
3
dnl gives unlimited permission to copy and/or distribute it,
4
4
dnl with or without modifications, as long as this notice is preserved.
5
5
 
8
8
dnl ---------------------------------------------------------------------------
9
9
AC_DEFUN([PANDORA_ENABLE_DTRACE],[
10
10
  AC_ARG_ENABLE([dtrace],
11
 
    [AS_HELP_STRING([--disable-dtrace],
12
 
            [Build with support for the DTRACE. @<:@default=on@:>@])],
13
 
    [ac_cv_enable_dtrace="$enableval"],
14
 
    [ac_cv_enable_dtrace="yes"])
 
11
    [AS_HELP_STRING([--enable-dtrace],
 
12
            [Build with support for the DTRACE. @<:@default=off@:>@])],
 
13
    [ac_cv_enable_dtrace="yes"],
 
14
    [ac_cv_enable_dtrace="no"])
15
15
 
16
16
  AS_IF([test "$ac_cv_enable_dtrace" = "yes"],[
17
17
    AC_CHECK_PROGS([DTRACE], [dtrace])
18
 
    AC_CHECK_HEADERS(sys/sdt.h)
19
 
 
20
 
    AS_IF([test "x$ac_cv_prog_DTRACE" = "xdtrace" -a "x${ac_cv_header_sys_sdt_h}" = "xyes"],[
21
 
 
22
 
      AC_CACHE_CHECK([if dtrace works],[ac_cv_dtrace_works],[
23
 
        cat >conftest.d <<_ACEOF
24
 
provider Example {
25
 
  probe increment(int);
26
 
};
27
 
_ACEOF
28
 
        $DTRACE -h -o conftest.h -s conftest.d 2>/dev/zero
29
 
        AS_IF([test $? -eq 0],[ac_cv_dtrace_works=yes],
30
 
          [ac_cv_dtrace_works=no])
31
 
        rm -f conftest.h conftest.d
32
 
        AS_IF([test "$TARGET_OSX"],[ac_cv_dtrace_works=no])
33
 
      ])
34
 
      AS_IF([test "x$ac_cv_dtrace_works" = "xyes"],[
35
 
        AC_DEFINE([HAVE_DTRACE], [1], [Enables DTRACE Support])
36
 
      ])
37
 
      AC_CACHE_CHECK([if dtrace should instrument object files],
38
 
        [ac_cv_dtrace_needs_objects],[
39
 
          dnl DTrace on MacOSX does not use -G option
40
 
          cat >conftest.d <<_ACEOF
41
 
provider Example {
42
 
  probe increment(int);
43
 
};
44
 
_ACEOF
45
 
          $DTRACE -G -o conftest.d.o -s conftest.d 2>/dev/zero
46
 
          AS_IF([test $? -eq 0],[ac_cv_dtrace_needs_objects=yes],
47
 
            [ac_cv_dtrace_needs_objects=no])
48
 
          rm -f conftest.d.o conftest.d
49
 
      ])
 
18
    AS_IF([test "x$ac_cv_prog_DTRACE" = "xdtrace"],[
 
19
      AC_DEFINE([HAVE_DTRACE], [1], [Enables DTRACE Support])
 
20
      dnl DTrace on MacOSX does not use -G option
 
21
      cat >conftest.d <<_ACEOF
 
22
provider Example {
 
23
  probe increment(int);
 
24
};
 
25
_ACEOF
 
26
      $DTRACE -G -o conftest.d.o -s conftest.d 2>/dev/zero
 
27
      AS_IF([test $? -eq 0],[ac_cv_dtrace_needs_objects=yes])
 
28
      rm -f conftest.d.o conftest.d
 
29
 
50
30
      AC_SUBST(DTRACEFLAGS) dnl TODO: test for -G on OSX
51
31
      ac_cv_have_dtrace=yes
52
32
    ])])
53
33
 
54
 
AM_CONDITIONAL([HAVE_DTRACE], [test "x$ac_cv_dtrace_works" = "xyes"])
 
34
AM_CONDITIONAL([HAVE_DTRACE], [test "x$ac_cv_have_dtrace" = "xyes"])
55
35
AM_CONDITIONAL([DTRACE_NEEDS_OBJECTS],
56
36
               [test "x$ac_cv_dtrace_needs_objects" = "xyes"])
57
37