Collection of DPF-based plugins for packaging
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.5KB

  1. # ===========================================================================
  2. # https://www.gnu.org/software/autoconf-archive/ax_with_dmalloc.html
  3. # ===========================================================================
  4. #
  5. # SYNOPSIS
  6. #
  7. # AX_WITH_DMALLOC
  8. #
  9. # DESCRIPTION
  10. #
  11. # Let the user enable/disable support for the dmalloc library available
  12. # from <http://www.dmalloc.org/>.
  13. #
  14. # The macro adds the command-line flag "--with-dmalloc". Furthermore,
  15. # "-IPREFIX/include" will be added to "$CPPFLAGS", "-LPREFIX/lib" to
  16. # "$LDFLAGS", and "-DDEBUG_DMALLOC" and "-DDMALLOC_FUNC_CHECK" to
  17. # "$CPPFLAGS".
  18. #
  19. # To enable dmalloc support in your code, add the following snippet to
  20. # your header files:
  21. #
  22. # #ifdef DEBUG_DMALLOC
  23. # # include <dmalloc.h>
  24. # #endif
  25. #
  26. # LICENSE
  27. #
  28. # Copyright (c) 2008 Peter Simons <simons@cryp.to>
  29. #
  30. # Copying and distribution of this file, with or without modification, are
  31. # permitted in any medium without royalty provided the copyright notice
  32. # and this notice are preserved. This file is offered as-is, without any
  33. # warranty.
  34. #serial 8
  35. AC_DEFUN([AX_WITH_DMALLOC], [
  36. AC_MSG_CHECKING(whether to use the dmalloc library)
  37. AC_ARG_WITH(dmalloc,
  38. [ --with-dmalloc[=PREFIX] Compile with dmalloc library],
  39. if test "$withval" = "" -o "$withval" = "yes"; then
  40. ac_cv_dmalloc="/usr/local"
  41. else
  42. ac_cv_dmalloc="$withval"
  43. fi
  44. AC_MSG_RESULT(yes)
  45. CPPFLAGS="$CPPFLAGS -DDEBUG_DMALLOC -DDMALLOC_FUNC_CHECK -I$ac_cv_dmalloc/include"
  46. LDFLAGS="$LDFLAGS -L$ac_cv_dmalloc/lib"
  47. LIBS="$LIBS -ldmalloc"
  48. ,AC_MSG_RESULT(no))
  49. ])dnl