aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaniel <arowser@gmail.com>2014-03-04 13:52:42 +0800
committerWladimir J. van der Laan <laanwj@gmail.com>2014-03-10 12:35:52 +0100
commitc41736d0df04f04fd40d16b14924f077c273efbf (patch)
treeb376802bfcba4d874d8c951e8391a0b80337af02
parent17ca4fd40b163c450e9e23b50f66b50bf3a61a59 (diff)
downloadbitcoin-c41736d0df04f04fd40d16b14924f077c273efbf.tar.xz
add --enable-debug for configure
Rebased-From: f5f157b
-rw-r--r--configure.ac17
1 files changed, 17 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 3ed4549a88..6f7d8d19a6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -137,6 +137,23 @@ AC_PATH_PROG(XGETTEXT,xgettext)
AC_PATH_PROG(HEXDUMP,hexdump)
PKG_PROG_PKG_CONFIG
+# Enable debug
+AC_ARG_ENABLE([debug],
+ [AS_HELP_STRING([--enable-debug],
+ [use debug compiler flags and macros (default is no)])],
+ [enable_debug=$enableval],
+ [enable_debug=no])
+
+if test "x$enable_debug" = xyes; then
+ if test "x$GCC" = xyes; then
+ CFLAGS="-g3 -O0 -DDEBUG"
+ fi
+
+ if test "x$GXX" = xyes; then
+ CXXFLAGS="-g3 -O0 -DDEBUG"
+ fi
+fi
+
## TODO: Remove these hard-coded paths and flags. They are here for the sake of
## compatibility with the legacy buildsystem.
##