summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xconfigure.ac13
-rw-r--r--src/Makefile.am9
2 files changed, 21 insertions, 1 deletions
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