]> git.0d.be Git - empathy.git/blob - m4/empathy-valgrind.m4
Merge branch 'tp-tube'
[empathy.git] / m4 / empathy-valgrind.m4
1 dnl Detect Valgrind location and flags
2
3 AC_DEFUN([EMPATHY_VALGRIND],
4 [
5   enable=$1
6   if test -n "$2"; then
7     valgrind_req=$2
8   else
9     valgrind_req="2.1"
10   fi
11
12   PKG_CHECK_MODULES(VALGRIND, valgrind > "$valgrind_req",
13     have_valgrind_runtime="yes", have_valgrind_runtime="no")
14
15   AC_PATH_PROG(VALGRIND_PATH, valgrind)
16
17   # Compile the instrumentation for valgrind only if the valgrind
18   # libraries are installed and the valgrind executable is found
19   if test "x$enable" = xyes &&
20      test "$have_valgrind_runtime" = yes &&
21      test -n "$VALGRIND_PATH" ;
22   then
23     AC_DEFINE(HAVE_VALGRIND, 1, [Define if valgrind should be used])
24     AC_MSG_NOTICE(using compile-time instrumentation for valgrind)
25   fi
26
27   AC_SUBST(VALGRIND_CFLAGS)
28   AC_SUBST(VALGRIND_LIBS)
29
30   AM_CONDITIONAL(HAVE_VALGRIND, test -n "$VALGRIND_PATH")
31 ])