From 75648c7397d96109cde90468bd24efcdf41608ca Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Wed, 4 Oct 2017 16:32:12 -0700 Subject: [PATCH] configure.ac: Add an RB_DEBUG_LEVEL which will always be defined; 0 when RB_DEBUG is not defined. --- configure.ac | 2 ++ ircd/ircd.cc | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 13ec8d874..edd066811 100644 --- a/configure.ac +++ b/configure.ac @@ -152,10 +152,12 @@ AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [Enable debugging suite fo AC_SUBST(DEBUG, 1) CXXFLAGS+=" -O0 -ggdb" RB_DEFINE_UNQUOTED([DEBUG], [1], [Not configured for release when lit.]) + RB_DEFINE_UNQUOTED([DEBUG_LEVEL], [1], [Defined to 0 for release; or > 0 otherwise]) ], [ AC_SUBST(DEBUG, 0) CXXFLAGS+=" -O3" CPPDEFINE([NDEBUG]) + RB_DEFINE_UNQUOTED([DEBUG_LEVEL], [0], [Defined to 0 for release]) ]) AM_CONDITIONAL([DEBUG], [[[[ "$DEBUG" = "1" ]]]]) diff --git a/ircd/ircd.cc b/ircd/ircd.cc index 5f6ace641..696d7fb8e 100644 --- a/ircd/ircd.cc +++ b/ircd/ircd.cc @@ -67,7 +67,7 @@ try { // cores are not dumped without consent of the user to maintain the privacy // of cryptographic key material in memory at the time of the crash. - if(RB_DEBUG || debugmode) + if(RB_DEBUG_LEVEL || debugmode) enable_coredumps(); assert(runlevel == runlevel::STOPPED); @@ -100,7 +100,7 @@ try __VERSION__, RB_DATE_CONFIGURED, __TIMESTAMP__, - RB_DEBUG? "(DEBUG MODE)" : ""); + RB_DEBUG_LEVEL? "(DEBUG MODE)" : ""); ircd::set_runlevel(runlevel::READY); }