changeset 810:0c2f8ee6be42

Make debug output compile-time configurable via --enable-debug. Disabled by default.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 07 Nov 2012 12:52:46 +0200
parents 8f155eca3612
children 7f4cba609dd4
files configure.ac src/config.h.in src/xmms-sid.h
diffstat 3 files changed, 24 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/configure.ac	Wed Nov 07 12:46:16 2012 +0200
+++ b/configure.ac	Wed Nov 07 12:52:46 2012 +0200
@@ -19,10 +19,11 @@
 dnl *** Define some templates
 dnl ***
 AH_TEMPLATE([HAVE_SONG_POSITION], [Define if you have XMMS patched with the songpos patch.])
-AH_TEMPLATE([HAVE_SIDPLAY1], [Define if you have and want to use libSIDPlay 1])
-AH_TEMPLATE([HAVE_SIDPLAY2], [Define if you have and want to use libSIDPlay 2])
+AH_TEMPLATE([HAVE_SIDPLAY1], [Define if you have and want to use libSIDPlay 1.])
+AH_TEMPLATE([HAVE_SIDPLAY2], [Define if you have and want to use libSIDPlay 2.])
 AH_TEMPLATE([HAVE_SIDPLAY2_FP], [Define if you have and want to use libSIDPlay 2-FP http://sourceforge.net/projects/sidplay-residfp/])
 AH_TEMPLATE([HAVE_THEMETUNE], [Define if you want to build code to play XMMS-SID theme SID-tune. The tune needs to be installed too, though.])
+AH_TEMPLATE([DEBUG], [Define if you wish to enable debug output to terminal.])
 
 
 dnl ***
@@ -66,6 +67,23 @@
 
 
 dnl ***
+dnl *** Enable debugging
+dnl ***
+AC_ARG_ENABLE([debug],
+[AS_HELP_STRING([--enable-debug], [Enable debug output to terminal/console.])],
+[
+if test "x$enableval" = "xyes"; then
+	xs_enable_debug=yes
+else
+	xs_enable_debug=no
+fi
+], [xs_enable_debug=no])
+if test "x$xs_enable_debug" = "xyes"; then
+	AC_DEFINE([DEBUG])
+fi
+
+
+dnl ***
 dnl *** Enable or disable themetune support/installation
 dnl ***
 AC_ARG_ENABLE([themetune],
@@ -192,4 +210,5 @@
 	    Included builders         : $xs_builders
 	XMMS-SID theme SID-tune       : $xs_have_themetune
 	Translations (i18n/nls)       : $USE_NLS
+	Debugging enabled             : $xs_enable_debug
 ])
--- a/src/config.h.in	Wed Nov 07 12:46:16 2012 +0200
+++ b/src/config.h.in	Wed Nov 07 12:52:46 2012 +0200
@@ -1,5 +1,8 @@
 /* src/config.h.in.  Generated from configure.ac by autoheader.  */
 
+/* Define if you wish to enable debug output to terminal. */
+#undef DEBUG
+
 /* Define to 1 if translation of program messages to the user's native
    language is requested. */
 #undef ENABLE_NLS
--- a/src/xmms-sid.h	Wed Nov 07 12:46:16 2012 +0200
+++ b/src/xmms-sid.h	Wed Nov 07 12:52:46 2012 +0200
@@ -29,14 +29,6 @@
 extern "C" {
 #endif
 
-/*
- * Some constants and defines
- */
-/* #define to enable spurious debugging messages for development
- * purposes. Output goes to stderr. See also DEBUG_NP below.
- */
-#define DEBUG
-
 /* Define to ISO C99 macro for debugging instead of varargs function.
  * This provides more useful information, but is incompatible with
  * older standards. If #undef'd, a varargs function is used instead.