PageRenderTime 7ms CodeModel.GetById 2ms app.highlight 1ms RepoModel.GetById 2ms app.codeStats 0ms

/config/ac_dmalloc.m4

https://code.google.com/
m4 | 39 lines | 21 code | 2 blank | 16 comment | 0 complexity | e66da2fda80b4bfd1b4ead606e0a952c MD5 | raw file
 1##*****************************************************************************
 2## $Id$
 3##*****************************************************************************
 4#  AUTHOR:
 5#    Jim Garlick <garlick@llnl.gov>
 6#
 7#  SYNOPSIS:
 8#    AC_DMALLOC
 9#
10#  DESCRIPTION:
11#    Adds support for --with-dmalloc. 
12#    
13#
14#  WARNINGS:
15#    This macro must be placed after AC_PROG_CC or equivalent.
16##*****************************************************************************
17
18AC_DEFUN([AC_DMALLOC],
19[
20  AC_MSG_CHECKING([if malloc debugging is wanted])
21  AC_ARG_WITH(dmalloc,
22    AC_HELP_STRING([--with-dmalloc], [compile using Gray Watson's dmalloc]),
23     [ case "$withval" in
24        yes) ac_with_dmalloc=yes ;;
25        no)  ac_with_dmalloc=no ;;
26        *)   AC_MSG_RESULT([doh!])
27             AC_MSG_ERROR([bad value "$withval" for --withdmalloc]) ;;
28      esac
29    ]
30  )
31  AC_MSG_RESULT([${ac_with_dmalloc=no}])
32
33  if test "$ac_with_dmalloc" = "yes"; then
34     AC_CHECK_LIB([dmalloc], [xmalloc],, 
35       AC_MSG_ERROR([Cannot find libdmalloc!]))
36     AC_DEFINE(WITH_DMALLOC, 1, 
37              [Define if using dmalloc debugging malloc package.])
38  fi
39])