From 5b4774d352787626061752e8dba6377b25b64f66 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 5 Feb 2017 20:03:13 +0300 Subject: Add configure option --enable-glibcdebug for enable libcstdc++ debug mode. By default this option disabled. --- configure.ac | 13 +++++++++++++ src/Makefile.am | 9 ++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 3c91519a3..a44573698 100755 --- a/configure.ac +++ b/configure.ac @@ -29,6 +29,19 @@ esac],[asserts_enabled=true]) AM_CONDITIONAL(ENABLE_ASSERTS, test x$asserts_enabled = xtrue) +# Enable -D_GLIBCXX_DEBUG +AC_ARG_ENABLE(glibcdebug, +[ --enable-glibcdebug Enable glibc++ debug mode], +[case "${enableval}" in + yes) glibcdebug_enabled=true + ;; + no) glibcdebug_enabled=false + ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-glibcdebug) ;; +esac],[glibcdebug_enabled=false]) + +AM_CONDITIONAL(ENABLE_GLIBCDEBUG, test x$glibcdebug_enabled = xtrue) + # Checks for android. AC_ARG_ENABLE(androidbuild, [ --enable-androidbuild Turn on android building], diff --git a/src/Makefile.am b/src/Makefile.am index 0f0bae0f0..51c49cb99 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -26,6 +26,11 @@ manaplus_CXXFLAGS += -Werror dyecmd_CXXFLAGS += -Werror endif +if ENABLE_GLIBCDEBUG +manaplus_CXXFLAGS += -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC +dyecmd_CXXFLAGS += -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC +endif + if USE_X11 manaplus_CXXFLAGS += -DUSE_X11 dyecmd_CXXFLAGS += -DUSE_X11 @@ -1887,7 +1892,9 @@ if ENABLE_ASSERTS manaplustests_CXXFLAGS += -DENABLE_ASSERTS manaplustests_LDFLAGS = -rdynamic endif - +if ENABLE_GLIBCDEBUG +manaplustests_CXXFLAGS += -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC +endif if USE_X11 manaplustests_CXXFLAGS += -DUSE_X11 endif -- cgit v1.2.3-70-g09d2