summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmanuele Aina <em@nerd.ocracy.org>2007-06-26 13:55:32 +0000
committerEmanuele Aina <em@nerd.ocracy.org>2007-06-26 13:55:32 +0000
commitc3f686a13352ff60bff32bab88c4e972b7539680 (patch)
treebc4f89f76cba564ea84c71aee2dd88a3200d5cc2
parentecd806d9ca7b6a5623b6940fb6d9875526a76e56 (diff)
Use the macro in salut-args.m4 for the --disable-debug compilation option
-rw-r--r--configure.ac10
-rw-r--r--m4/salut-args.m411
2 files changed, 8 insertions, 13 deletions
diff --git a/configure.ac b/configure.ac
index 462fa3c5..e059c328 100644
--- a/configure.ac
+++ b/configure.ac
@@ -33,7 +33,7 @@ AC_PROG_CC_STDC
AM_PROG_AS
dnl add common command line switches
-#SALUT_ARG_DEBUG
+SALUT_ARG_DEBUG
#SALUT_ARG_PROFILING
SALUT_ARG_VALGRIND
SALUT_ARG_COVERAGE
@@ -47,14 +47,6 @@ ifelse(salut_nano_version, 0,
])
AC_SUBST(ERROR_CFLAGS)
-AC_ARG_ENABLE(debug,
- AC_HELP_STRING([--disable-debug],[compile without debug code]),
- enable_debug=$enableval, enable_debug=yes )
-
-if test x$enable_debug = xyes; then
- AC_DEFINE(ENABLE_DEBUG, [], [Enable debug code])
-fi
-
dnl Check for code generation tools
XSLTPROC=
AC_CHECK_PROGS([XSLTPROC], [xsltproc])
diff --git a/m4/salut-args.m4 b/m4/salut-args.m4
index 80abdc32..4395c68e 100644
--- a/m4/salut-args.m4
+++ b/m4/salut-args.m4
@@ -9,15 +9,18 @@ AC_DEFUN([SALUT_ARG_DEBUG],
[
dnl debugging stuff
AC_ARG_ENABLE(debug,
- AC_HELP_STRING([--disable-debug],[disable addition of -g debugging info]),
+ AC_HELP_STRING([--disable-debug],[compile without debug code]),
[
case "${enableval}" in
- yes) ENABLE_DEBUG=yes ;;
- no) ENABLE_DEBUG=no ;;
+ yes|no) enable="${enableval}" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
esac
],
- [ENABLE_DEBUG=yes]) dnl Default value
+ [enable=yes])
+
+ if test "$enable" = yes; then
+ AC_DEFINE(ENABLE_DEBUG, [], [Enable debug code])
+ fi
])
AC_DEFUN([SALUT_ARG_PROFILING],