1dnl ######################################################################
2dnl Debugging: "yes" means general, "mem" means general and memory debugging,
3dnl and "no" means none.
4AC_DEFUN([AMU_OPT_DEBUG],
5[AC_MSG_CHECKING(for debugging options)
6AC_ARG_ENABLE(debug,
7AC_HELP_STRING([--enable-debug=ARG],[enable debugging (yes/mem/no)]),
8[
9if test "$enableval" = yes; then
10  AC_MSG_RESULT(yes)
11  AC_DEFINE(DEBUG)
12  ac_cv_opt_debug=yes
13elif test "$enableval" = mem; then
14  AC_MSG_RESULT(mem)
15  AC_DEFINE(DEBUG)
16  AC_DEFINE(DEBUG_MEM)
17  AC_CHECK_FUNC(malloc_verify,,AC_CHECK_LIB(mapmalloc, malloc_verify))
18  AC_CHECK_FUNC(mallinfo,,AC_CHECK_LIB(malloc, mallinfo))
19  ac_cv_opt_debug=mem
20else
21  AC_MSG_RESULT(no)
22  ac_cv_opt_debug=no
23fi
24],
25[
26  # default is no debugging
27  AC_MSG_RESULT(no)
28])
29])
30dnl ======================================================================
31