Please check the GNU Autoconf Macro Archive for Updates
AC-Archive
Autoconf Macro Archive

ac-archive.sf.net: - Project CVS - Download
Macro Index
- AM Support
- C++ Support
- C Support
- Fortran Support
- Java Support
- Cross Compilation
- Installed Packages
- Miscellaneous
- LaTeX Support
- Uncategorized
- archive macros
- adl's macros
- bkorb's macros
- guidod's macros
- latex's macros
- other's macros
- rleigh's macros
- obsoleted macros
- released macros
- search index

Documentation
- Contribute!
- History
- acincludedir m4
- acinclude (tool)
- macro howto
- ax tricks
- maintainers
- License
- Topics

generated...
2007-08-05

(C) 2007 guidod
Download the M4 Source.

ax_with_dmalloc

Back to the Main Page.

Synopsis
AX_WITH_DMALLOC ,

Enable/disable dmalloc library support.

Version

2006-01-15

Author

Peter Simons <simons@cryp.to>

License

AllPermissive
Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. Users of this software should generally follow the principles of the MIT License includings its disclaimer.

Category

cryp.to ac-archive's Installed Packages (released)

Documentation

Let the user enable/disable support for the dmalloc library available from <http://www.dmalloc.org/>.

The macro adds the command-line flag "--with-dmalloc". Furthermore, "-IPREFIX/include" will be added to "$CPPFLAGS", "-LPREFIX/lib" to "$LDFLAGS", and "-DDEBUG_DMALLOC" and "-DDMALLOC_FUNC_CHECK" to "$CPPFLAGS".

To enable dmalloc support in your code, add the following snippet to your header files:

 #ifdef DEBUG_DMALLOC
 #  include <dmalloc.h>
 #endif

M4 Source Code
AC_DEFUN([AX_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