summaryrefslogtreecommitdiff
path: root/common/m4/gst-valgrind.m4
diff options
context:
space:
mode:
authorJeongmo Yang <jm80.yang@samsung.com>2012-09-07 21:59:49 +0900
committerJeongmo Yang <jm80.yang@samsung.com>2012-09-07 22:00:07 +0900
commit8665a5303d5fa3daaba53cff8f0758e0fc859636 (patch)
tree1f047a01969b70f244d6c0b4381a34e5b7b64355 /common/m4/gst-valgrind.m4
parent4e9e23ca3164c203a46c205da5af49e354dbbdd2 (diff)
downloadgst-plugins-s5pc2xx-8665a5303d5fa3daaba53cff8f0758e0fc859636.tar.gz
gst-plugins-s5pc2xx-8665a5303d5fa3daaba53cff8f0758e0fc859636.tar.bz2
gst-plugins-s5pc2xx-8665a5303d5fa3daaba53cff8f0758e0fc859636.zip
Change-Id: I0736f126be88ae94efb6698b91de356c16357e52
Diffstat (limited to 'common/m4/gst-valgrind.m4')
-rwxr-xr-xcommon/m4/gst-valgrind.m435
1 files changed, 35 insertions, 0 deletions
diff --git a/common/m4/gst-valgrind.m4 b/common/m4/gst-valgrind.m4
new file mode 100755
index 0000000..93c2635
--- /dev/null
+++ b/common/m4/gst-valgrind.m4
@@ -0,0 +1,35 @@
+AC_DEFUN([AG_GST_VALGRIND_CHECK],
+[
+ dnl valgrind inclusion
+ AC_ARG_ENABLE(valgrind,
+ AC_HELP_STRING([--disable-valgrind], [disable run-time valgrind detection]),
+ [
+ case "${enableval}" in
+ yes) USE_VALGRIND="$USE_DEBUG" ;;
+ no) USE_VALGRIND=no ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --enable-valgrind) ;;
+ esac],
+ [
+ USE_VALGRIND="$USE_DEBUG"
+ ]) dnl Default value
+
+ VALGRIND_REQ="2.1"
+ if test "x$USE_VALGRIND" = xyes; then
+ PKG_CHECK_MODULES(VALGRIND, valgrind > $VALGRIND_REQ,
+ USE_VALGRIND="yes",
+ [
+ USE_VALGRIND="no"
+ AC_MSG_RESULT([no])
+ ])
+ fi
+
+ if test "x$USE_VALGRIND" = xyes; then
+ AC_DEFINE(HAVE_VALGRIND, 1, [Define if valgrind should be used])
+ AC_MSG_NOTICE(Using extra code paths for valgrind)
+ fi
+ AC_SUBST(VALGRIND_CFLAGS)
+ AC_SUBST(VALGRIND_LIBS)
+
+ AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
+ AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
+])