File: ac_dmalloc.m4

package info (click to toggle)
pdsh 2.36-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,436 kB
  • sloc: ansic: 12,474; sh: 3,196; makefile: 402; perl: 163
file content (39 lines) | stat: -rw-r--r-- 1,150 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
##*****************************************************************************
## $Id$
##*****************************************************************************
#  AUTHOR:
#    Jim Garlick <garlick@llnl.gov>
#
#  SYNOPSIS:
#    AC_DMALLOC
#
#  DESCRIPTION:
#    Adds support for --with-dmalloc. 
#    
#
#  WARNINGS:
#    This macro must be placed after AC_PROG_CC or equivalent.
##*****************************************************************************

AC_DEFUN([AC_DMALLOC],
[
  AC_MSG_CHECKING([if malloc debugging is wanted])
  AC_ARG_WITH(dmalloc,
    AS_HELP_STRING([--with-dmalloc],[compile using Gray Watson's dmalloc]),
     [ case "$withval" in
        yes) ac_with_dmalloc=yes ;;
        no)  ac_with_dmalloc=no ;;
        *)   AC_MSG_RESULT([doh!])
             AC_MSG_ERROR([bad value "$withval" for --withdmalloc]) ;;
      esac
    ]
  )
  AC_MSG_RESULT([${ac_with_dmalloc=no}])

  if test "$ac_with_dmalloc" = "yes"; then
     AC_CHECK_LIB([dmalloc], [xmalloc],, 
       AC_MSG_ERROR([Cannot find libdmalloc!]))
     AC_DEFINE(WITH_DMALLOC, 1, 
              [Define if using dmalloc debugging malloc package.])
  fi
])