Blame telepathy-account-widgets/m4/tpaw-valgrind.m4

Packit 79f644
dnl Detect Valgrind location and flags
Packit 79f644
Packit 79f644
AC_DEFUN([TPAW_VALGRIND],
Packit 79f644
[
Packit 79f644
  enable=$1
Packit 79f644
  if test -n "$2"; then
Packit 79f644
    valgrind_req=$2
Packit 79f644
  else
Packit 79f644
    valgrind_req="2.1"
Packit 79f644
  fi
Packit 79f644
Packit 79f644
  PKG_CHECK_MODULES(VALGRIND, valgrind > "$valgrind_req",
Packit 79f644
    have_valgrind_runtime="yes", have_valgrind_runtime="no")
Packit 79f644
Packit 79f644
  AC_PATH_PROG(VALGRIND_PATH, valgrind)
Packit 79f644
Packit 79f644
  # Compile the instrumentation for valgrind only if the valgrind
Packit 79f644
  # libraries are installed and the valgrind executable is found
Packit 79f644
  if test "x$enable" = xyes &&
Packit 79f644
     test "$have_valgrind_runtime" = yes &&
Packit 79f644
     test -n "$VALGRIND_PATH" ;
Packit 79f644
  then
Packit 79f644
    AC_DEFINE(HAVE_VALGRIND, 1, [Define if valgrind should be used])
Packit 79f644
    AC_MSG_NOTICE(using compile-time instrumentation for valgrind)
Packit 79f644
  fi
Packit 79f644
Packit 79f644
  AC_SUBST(VALGRIND_CFLAGS)
Packit 79f644
  AC_SUBST(VALGRIND_LIBS)
Packit 79f644
Packit 79f644
  AM_CONDITIONAL(HAVE_VALGRIND, test -n "$VALGRIND_PATH")
Packit 79f644
])