Merge branch 'minor'
[automake.git] / m4 / dmalloc.m4
blob0b9f8d4f421a1a8a2560439884900354a39a7f17
1 ## ----------------------------------- ##                   -*- Autoconf -*-
2 ## Check if --with-dmalloc was given.  ##
3 ## From Franc,ois Pinard               ##
4 ## ----------------------------------- ##
6 # Copyright (C) 1996-2017 Free Software Foundation, Inc.
8 # This file is free software; the Free Software Foundation
9 # gives unlimited permission to copy and/or distribute it,
10 # with or without modifications, as long as this notice is preserved.
12 AC_DEFUN([AM_WITH_DMALLOC],
13 [AC_MSG_CHECKING([if malloc debugging is wanted])
14 AC_ARG_WITH([dmalloc],
15 [AS_HELP_STRING([--with-dmalloc],
16                 [use dmalloc, as in http://www.dmalloc.com])],
17 [if test "$withval" = yes; then
18   AC_MSG_RESULT([yes])
19   AC_DEFINE([WITH_DMALLOC], [1],
20             [Define if using the dmalloc debugging malloc package])
21   LIBS="$LIBS -ldmalloc"
22   LDFLAGS="$LDFLAGS -g"
23 else
24   AC_MSG_RESULT([no])
25 fi], [AC_MSG_RESULT([no])])