1 dnl ###################################################################### 2 dnl Debugging: "yes" means general, "mem" means general and memory debugging, 3 dnl and "no" means none. 4 AC_DEFUN([AMU_OPT_DEBUG], 5 [AC_MSG_CHECKING(for debugging options) 6 AC_ARG_ENABLE(debug, 7 AC_HELP_STRING([--enable-debug=ARG],[enable debugging (yes/mem/no)]), 8 [ 9 if test "$enableval" = yes; then 10 AC_MSG_RESULT(yes) 11 AC_DEFINE(DEBUG) 12 ac_cv_opt_debug=yes 13 elif 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 20 else 21 AC_MSG_RESULT(no) 22 ac_cv_opt_debug=no 23 fi 24 ], 25 [ 26 # default is no debugging 27 AC_MSG_RESULT(no) 28 ]) 29 ]) 30 dnl ====================================================================== 31