summaryrefslogtreecommitdiffstats
path: root/contrib/amd/m4/macros/opt_debug.m4
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/amd/m4/macros/opt_debug.m4')
-rw-r--r--contrib/amd/m4/macros/opt_debug.m430
1 files changed, 30 insertions, 0 deletions
diff --git a/contrib/amd/m4/macros/opt_debug.m4 b/contrib/amd/m4/macros/opt_debug.m4
new file mode 100644
index 0000000..18205f2
--- /dev/null
+++ b/contrib/amd/m4/macros/opt_debug.m4
@@ -0,0 +1,30 @@
+dnl ######################################################################
+dnl Debugging: "yes" means general, "mem" means general and memory debugging,
+dnl and "no" means none.
+AC_DEFUN(AMU_OPT_DEBUG,
+[AC_MSG_CHECKING(for debugging options)
+AC_ARG_ENABLE(debug,
+AC_HELP_STRING([--enable-debug=ARG],[enable debugging (yes/mem/no)]),
+[
+if test "$enableval" = yes; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(DEBUG)
+ ac_cv_opt_debug=yes
+elif test "$enableval" = mem; then
+ AC_MSG_RESULT(mem)
+ AC_DEFINE(DEBUG)
+ AC_DEFINE(DEBUG_MEM)
+ AC_CHECK_LIB(mapmalloc, malloc_verify)
+ AC_CHECK_LIB(malloc, mallinfo)
+ ac_cv_opt_debug=mem
+else
+ AC_MSG_RESULT(no)
+ ac_cv_opt_debug=no
+fi
+],
+[
+ # default is no debugging
+ AC_MSG_RESULT(no)
+])
+])
+dnl ======================================================================
OpenPOWER on IntegriCloud