PageRenderTime 31ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/m4/check_valgrind.m4

http://github.com/mozy/mordor
m4 | 49 lines | 28 code | 2 blank | 19 comment | 0 complexity | 5f1759e0ddd9faaf2570dbcddedb4adc MD5 | raw file
Possible License(s): BSD-3-Clause
  1. # SYNOPSIS
  2. #
  3. # AC_CHECK_VALGRIND
  4. #
  5. # DESCRIPTION
  6. #
  7. # Test for enable/disable HAVE_VALGRIND macro
  8. #
  9. # This macro enable following option
  10. #
  11. # --disable-valgrind
  12. # --enable-valgrind=<yes|no>
  13. #
  14. # This macro calls:
  15. # AC_SUBST(VALGRIND_CPPFLAGS)
  16. #
  17. # And sets:
  18. #
  19. # HAVE_VALGRIND
  20. AC_DEFUN([AC_CHECK_VALGRIND],
  21. [
  22. AC_ARG_ENABLE([valgrind],
  23. AS_HELP_STRING(
  24. [--with-valgrind@<:@=ARG@:>@],
  25. [Compile with HAVE_VALGRIND macro defined (ARG=yes),
  26. or disable it (ARG=no)
  27. @<:@ARG=no@:>@ ]
  28. ),
  29. [
  30. if test "$enableval" = "yes"; then
  31. want_valgrind="yes"
  32. else
  33. want_valgrind="no"
  34. fi
  35. ],
  36. [want_valgrind="no"]
  37. )
  38. AC_MSG_CHECKING([whether enable HAVE_VALGRIND macro])
  39. if test x${want_valgrind} = "xyes" ; then
  40. AC_MSG_RESULT([yes])
  41. AC_DEFINE(HAVE_VALGRIND,1,[define if compiling for running valgrind ])
  42. VALGRIND_CPPFLAGS="-DHAVE_VALGRIND"
  43. AC_SUBST(VALGRIND_CPPFLAGS)
  44. else
  45. AC_MSG_RESULT([no])
  46. fi
  47. ])