summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmir Taaki <genjix@riseup.net>2013-06-18 11:15:41 (GMT)
committer Amir Taaki <genjix@riseup.net>2013-06-18 11:15:41 (GMT)
commitf090251158dda4cd0a59f47f55a7dd37efe8def3 (patch)
treeb37401b1e50fd34442bfe36af819f2b0a1a4d941
parent2d3701c791cfb87c4d10ce0d13d57a7d02a9c45c (diff)
enable-debug mode for configure. turns off debug output.v1.0.9
-rw-r--r--Makefile.am1
-rw-r--r--configure.ac19
-rw-r--r--src/utility/logger.cpp8
3 files changed, 23 insertions, 5 deletions
diff --git a/Makefile.am b/Makefile.am
index cf171cd..7379357 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,4 @@
pkgconfig_DATA = libbitcoin.pc
-data_DATA = bitcoin.sql
SUBDIRS = include/bitcoin src
ACLOCAL_AMFLAGS = -I m4
diff --git a/configure.ac b/configure.ac
index 8370f7c..5c34b58 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7,10 +7,7 @@ AM_PROG_AR
LT_INIT
AC_PROG_CXX
CHECK_GXX_CPP0X
-CFLAGS="-ggdb"
-CXXFLAGS="-ggdb"
-my_CXXFLAGS="$ac_cv_cxx_cpp0x_flag -Wall -Wno-unused-parameter -pedantic -pthread -Wextra -fstack-protector-all"
-AC_SUBST([my_CXXFLAGS])
+CXXFLAGS="$ac_cv_cxx_cpp0x_flag -Wall -Wno-unused-parameter -pedantic -pthread -Wextra -fstack-protector-all"
AC_ARG_ENABLE(bdb,
[AC_HELP_STRING([--enable-bdb],
@@ -24,6 +21,15 @@ AC_ARG_ENABLE(leveldb,
[bld_leveldb="$enable_leveldb"], [bld_leveldb="no"])
AM_CONDITIONAL([DO_LEVELDB], [test "$enable_leveldb" = "yes"])
+AC_ARG_ENABLE([debug],
+[ --enable-debug Turn on debugging],
+[case "${enableval}" in
+ yes) debug=true ;;
+ no) debug=false ;;
+ *) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
+esac],[debug=false])
+AM_CONDITIONAL([DEBUG], [test x$debug = xtrue])
+
AX_BOOST_BASE
#AX_BOOST_SYSTEM
#AX_BOOST_THREAD
@@ -48,6 +54,11 @@ if test "$bld_leveldb" = "yes"; then
CFLAG_LEVELDB="-DLEVELDB_ENABLED"
fi
+if test x$debug = xtrue; then
+ my_CXXFLAGS="-g3 -DDEBUG"
+ AC_SUBST([my_CXXFLAGS])
+fi
+
PKG_CHECK_MODULES([SSL], [libssl >= 0.9])
PKG_CHECK_MODULES([CURL], [libcurl])
diff --git a/src/utility/logger.cpp b/src/utility/logger.cpp
index ef63cad..39969a6 100644
--- a/src/utility/logger.cpp
+++ b/src/utility/logger.cpp
@@ -33,6 +33,10 @@ void output_ostream(std::ostream& ostr, log_level level,
std::cerr << ": " << body << std::endl;
}
+void ignore_output(log_level level,
+ const std::string& domain, const std::string& body)
+{
+}
void output_cout(log_level level,
const std::string& domain, const std::string& body)
{
@@ -45,7 +49,11 @@ void output_cerr(log_level level,
}
logger_wrapper::destination_map logger_wrapper::dests_{
+#ifdef DEBUG
+ std::make_pair(log_level::debug, ignore_output),
+#else
std::make_pair(log_level::debug, output_cout),
+#endif
std::make_pair(log_level::info, output_cout),
std::make_pair(log_level::warning, output_cerr),
std::make_pair(log_level::error, output_cerr),