be1a5b3c91b40a1e41a18d2042dbfd3276f821f0
[platform/upstream/automake.git] / m4 / dmalloc.m4
1 ## ----------------------------------- ##                   -*- Autoconf -*-
2 ## Check if --with-dmalloc was given.  ##
3 ## From Franc,ois Pinard               ##
4 ## ----------------------------------- ##
5
6 # Copyright (C) 1996-2012 Free Software Foundation, Inc.
7 #
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.
11
12 # serial 6
13
14 AC_DEFUN([AM_WITH_DMALLOC],
15 [AC_MSG_CHECKING([if malloc debugging is wanted])
16 AC_ARG_WITH([dmalloc],
17 [AS_HELP_STRING([--with-dmalloc],
18                 [use dmalloc, as in http://www.dmalloc.com])],
19 [if test "$withval" = yes; then
20   AC_MSG_RESULT([yes])
21   AC_DEFINE([WITH_DMALLOC], [1],
22             [Define if using the dmalloc debugging malloc package])
23   LIBS="$LIBS -ldmalloc"
24   LDFLAGS="$LDFLAGS -g"
25 else
26   AC_MSG_RESULT([no])
27 fi], [AC_MSG_RESULT([no])])
28 ])
29
30 AU_DEFUN([fp_WITH_DMALLOC], [AM_WITH_DMALLOC])