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

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