build: set in NDEBUG instead of DEBUG in configure
authorRan Benita <ran234@gmail.com>
Mon, 12 Dec 2011 20:37:07 +0000 (22:37 +0200)
committerDavid Herrmann <dh.herrmann@googlemail.com>
Wed, 14 Dec 2011 17:08:19 +0000 (18:08 +0100)
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
configure.ac
src/log.h

index a93f144..0bc20ff 100644 (file)
@@ -47,10 +47,9 @@ AC_SUBST(PANGO_LIBS)
 
 AC_MSG_CHECKING([whether to build with debugging on])
 AC_ARG_ENABLE([debug],
-              [AS_HELP_STRING([--enable-debug],
-                              [whether to build with debugging on)])],
-                              [debug="$enableval"; AC_DEFINE([DEBUG], [0], [Debug])],
-                              [debug=no])
+              [AS_HELP_STRING([--enable-debug], [whether to build with debugging on)])],
+              [debug="$enableval"],
+              [debug=no; AC_DEFINE([NDEBUG], [1], [No Debug])])
 AM_CONDITIONAL([DEBUG], [test x$debug = xyes])
 AC_MSG_RESULT([$debug])
 
index 4ea1471..b098fc7 100644 (file)
--- a/src/log.h
+++ b/src/log.h
@@ -38,6 +38,8 @@
 #include <stdarg.h>
 #include <stdlib.h>
 
+#include "config.h"
+
 /* LOG_EMERG and LOG_ALERT do not make sense for this application */
 #define LOG_CRIT       "<2>" /* error that cannot be handled correctly */
 #define LOG_ERR                "<3>" /* error detected */