xref: /netbsd-src/external/bsd/am-utils/dist/m4/macros/opt_debug.m4 (revision a53f50b9b44dc9467ccc9c464999b1d1c509cb0c)
1*a53f50b9Schristosdnl ######################################################################
2*a53f50b9Schristosdnl Debugging: "yes" means general, "mem" means general and memory debugging,
3*a53f50b9Schristosdnl and "no" means none.
4*a53f50b9SchristosAC_DEFUN([AMU_OPT_DEBUG],
5*a53f50b9Schristos[AC_MSG_CHECKING(for debugging options)
6*a53f50b9SchristosAC_ARG_ENABLE(debug,
7*a53f50b9SchristosAC_HELP_STRING([--enable-debug=ARG],[enable debugging (yes/mem/no)]),
8*a53f50b9Schristos[
9*a53f50b9Schristosif test "$enableval" = yes; then
10*a53f50b9Schristos  AC_MSG_RESULT(yes)
11*a53f50b9Schristos  AC_DEFINE(DEBUG)
12*a53f50b9Schristos  ac_cv_opt_debug=yes
13*a53f50b9Schristoselif test "$enableval" = mem; then
14*a53f50b9Schristos  AC_MSG_RESULT(mem)
15*a53f50b9Schristos  AC_DEFINE(DEBUG)
16*a53f50b9Schristos  AC_DEFINE(DEBUG_MEM)
17*a53f50b9Schristos  AC_CHECK_FUNC(malloc_verify,,AC_CHECK_LIB(mapmalloc, malloc_verify))
18*a53f50b9Schristos  AC_CHECK_FUNC(mallinfo,,AC_CHECK_LIB(malloc, mallinfo))
19*a53f50b9Schristos  ac_cv_opt_debug=mem
20*a53f50b9Schristoselse
21*a53f50b9Schristos  AC_MSG_RESULT(no)
22*a53f50b9Schristos  ac_cv_opt_debug=no
23*a53f50b9Schristosfi
24*a53f50b9Schristos],
25*a53f50b9Schristos[
26*a53f50b9Schristos  # default is no debugging
27*a53f50b9Schristos  AC_MSG_RESULT(no)
28*a53f50b9Schristos])
29*a53f50b9Schristos])
30*a53f50b9Schristosdnl ======================================================================
31