PageRenderTime 122ms CodeModel.GetById 61ms app.highlight 1ms RepoModel.GetById 59ms app.codeStats 0ms

/m4/check_valgrind.m4

http://github.com/mozy/mordor
m4 | 49 lines | 28 code | 2 blank | 19 comment | 0 complexity | 5f1759e0ddd9faaf2570dbcddedb4adc MD5 | raw file
 1# SYNOPSIS
 2#
 3#    AC_CHECK_VALGRIND
 4#
 5# DESCRIPTION
 6#
 7#     Test for enable/disable HAVE_VALGRIND macro
 8#
 9#   This macro enable following option
10#
11#      --disable-valgrind
12#      --enable-valgrind=<yes|no>
13#
14#   This macro calls:
15#       AC_SUBST(VALGRIND_CPPFLAGS)
16#
17#   And sets:
18#
19#     HAVE_VALGRIND
20
21AC_DEFUN([AC_CHECK_VALGRIND],
22[
23    AC_ARG_ENABLE([valgrind],
24        AS_HELP_STRING(
25            [--with-valgrind@<:@=ARG@:>@],
26            [Compile with HAVE_VALGRIND macro defined (ARG=yes),
27            or disable it (ARG=no)
28            @<:@ARG=no@:>@ ]
29        ),
30        [
31        if test "$enableval" = "yes"; then
32            want_valgrind="yes"
33        else
34            want_valgrind="no"
35        fi
36        ],
37        [want_valgrind="no"]
38    )
39
40    AC_MSG_CHECKING([whether enable HAVE_VALGRIND macro])
41    if test x${want_valgrind} = "xyes" ; then
42        AC_MSG_RESULT([yes])
43        AC_DEFINE(HAVE_VALGRIND,1,[define if compiling for running valgrind ])
44        VALGRIND_CPPFLAGS="-DHAVE_VALGRIND"
45        AC_SUBST(VALGRIND_CPPFLAGS)
46    else
47        AC_MSG_RESULT([no])
48    fi
49])