From e2e59d3e4901b9405a86cbe754dde1f681fe25b7 Mon Sep 17 00:00:00 2001 From: kuepper Date: Thu, 16 Nov 2006 12:52:46 +0000 Subject: [PATCH] * configure.in (AC_DEBUG): add test * acinclude.m4 (AC_DEBUG): Define debug-feature and set DEBUG, NODEBUG, or NDEBUG according to its value. --- eo/ChangeLog | 4 ++++ eo/acinclude.m4 | 23 +++++++++++++++++++++++ eo/configure.in | 1 + 3 files changed, 28 insertions(+) diff --git a/eo/ChangeLog b/eo/ChangeLog index d40835e6b..8a0e8ee90 100644 --- a/eo/ChangeLog +++ b/eo/ChangeLog @@ -1,5 +1,9 @@ +2006-11-16 Jochen Küpper + * configure.in (AC_DEBUG): add test + * acinclude.m4 (AC_DEBUG): Define debug-feature and set DEBUG, NODEBUG, + or NDEBUG according to its value. * Local Variables: * coding: iso-8859-1 diff --git a/eo/acinclude.m4 b/eo/acinclude.m4 index 8a3244382..f9e35376e 100644 --- a/eo/acinclude.m4 +++ b/eo/acinclude.m4 @@ -19,6 +19,29 @@ AC_DEFUN([AC_APPLICATIONS],[dnl +# AC_DEBUG() +# +# Check for commandline options requesting DEBUG feature. +# Might define DEBUG, NODEBUG, or NDEBUG, depending on flags given. +AC_DEFUN([AC_DEBUG],[dnl + AC_ARG_ENABLE([debug], + AC_HELP_STRING([--enable-debug], [include debugging code (default=no)]), + [ case "${enableval}" in + yes) debug=true ;; + no) debug=false ;; + *) AC_MSG_ERROR(bad value ${enableval} for debug option) ;; + esac], + [debug=false]) + if test "$debug" = true; then + AC_DEFINE([DEBUG], true, [Debugging flag]) + else + AC_DEFINE([NDEBUG], true, [no debugging]) + AC_DEFINE([NODEBUG], true, [no debugging]) + fi +]) + + + # AC_GNUPLOT() # # Compile applications unless user requests not to do it. diff --git a/eo/configure.in b/eo/configure.in index 9f30947f0..9db4b1fe4 100644 --- a/eo/configure.in +++ b/eo/configure.in @@ -46,6 +46,7 @@ AC_CHECK_LIB(m, cos) dnl user-switches AC_APPLICATIONS +AC_DEBUG AC_GNUPLOT AC_TUTORIAL