~ubuntu-branches/ubuntu/natty/gst-entrans/natty

« back to all changes in this revision

Viewing changes to common/m4/gst-valgrind.m4

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Smedegaard
  • Date: 2010-09-13 19:49:29 UTC
  • Revision ID: james.westby@ubuntu.com-20100913194929-qz90a14xyxln9yfz
Tags: upstream-0.10.2
ImportĀ upstreamĀ versionĀ 0.10.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
AC_DEFUN([GST_VALGRIND_CHECK],
 
2
[
 
3
  dnl valgrind inclusion
 
4
  AC_ARG_ENABLE(valgrind,
 
5
    AC_HELP_STRING([--disable-valgrind], [disable run-time valgrind detection]),
 
6
    [
 
7
      case "${enableval}" in
 
8
        yes) USE_VALGRIND="$USE_DEBUG" ;;
 
9
        no)  USE_VALGRIND=no ;;
 
10
        *) AC_MSG_ERROR(bad value ${enableval} for --enable-valgrind) ;;
 
11
      esac],
 
12
    [
 
13
      USE_VALGRIND="$USE_DEBUG"
 
14
    ]) dnl Default value
 
15
 
 
16
  VALGRIND_REQ="2.1"
 
17
  if test "x$USE_VALGRIND" = xyes; then
 
18
    PKG_CHECK_MODULES(VALGRIND, valgrind > $VALGRIND_REQ,
 
19
      USE_VALGRIND="yes",
 
20
      [
 
21
        USE_VALGRIND="no"
 
22
        AC_MSG_RESULT([no])
 
23
      ])
 
24
  fi
 
25
 
 
26
  if test "x$USE_VALGRIND" = xyes; then
 
27
    AC_DEFINE(HAVE_VALGRIND, 1, [Define if valgrind should be used])
 
28
    AC_MSG_NOTICE(Using extra code paths for valgrind)
 
29
  fi
 
30
  AC_SUBST(VALGRIND_CFLAGS)
 
31
  AC_SUBST(VALGRIND_LIBS)
 
32
  
 
33
  AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
 
34
  AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
 
35
])