File: peti_with_dmalloc.m4

package info (click to toggle)
autoconf-archive 20060312-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 4,180 kB
  • ctags: 13
  • sloc: sh: 455; makefile: 44
file content (37 lines) | stat: -rw-r--r-- 1,175 bytes parent folder | download
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
dnl @synopsis PETI_WITH_DMALLOC
dnl
dnl Let the user enable/disable dmalloc library support. See
dnl <http://www.dmalloc.org/> for further details.
dnl
dnl Calling this macro defines a user command-line flag
dnl "--with-dmalloc". Furthermore, "-IPREFIX/include" will be added to
dnl "$CPPFLAGS", "-LPREFIX/lib" to "$LDFLAGS", and "-DDEBUG_DMALLOC"
dnl and "-DDMALLOC_FUNC_CHECK" to "$CPPFLAGS".
dnl
dnl To enable dmalloc support in your code, add this snippet to tho
dnl appropriate header files:
dnl
dnl   #ifdef DEBUG_DMALLOC
dnl   #  include <dmalloc.h>
dnl   #endif
dnl
dnl @category InstalledPackages
dnl @author Peter Simons <simons@cryp.to>
dnl @version 2003-01-15
dnl @license AllPermissive

AC_DEFUN([PETI_WITH_DMALLOC], [
AC_MSG_CHECKING(whether to use the dmalloc library)
AC_ARG_WITH(dmalloc,
[  --with-dmalloc[=PREFIX]  Compile with dmalloc library],
if test "$withval" = "" -o "$withval" = "yes"; then
    ac_cv_dmalloc="/usr/local"
else
    ac_cv_dmalloc="$withval"
fi
AC_MSG_RESULT(yes)
CPPFLAGS="$CPPFLAGS -DDEBUG_DMALLOC -DDMALLOC_FUNC_CHECK -I$ac_cv_dmalloc/include"
LDFLAGS="$LDFLAGS -L$ac_cv_dmalloc/lib"
LIBS="$LIBS -ldmalloc"
,AC_MSG_RESULT(no))
])dnl