From a0aeb2de2dca752097c0eb4794d69e8e83e382c4 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Tue, 12 Sep 2017 09:54:10 -0700 Subject: [PATCH] configure.ac/Makefile: Add debug conditionals. --- configure.ac | 2 ++ include/ircd/Makefile.am | 11 ++++++++++- ircd/Makefile.am | 10 +++++++++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index cc4731c4a..abef344e8 100644 --- a/configure.ac +++ b/configure.ac @@ -154,6 +154,8 @@ AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [Enable debugging suite fo CPPDEFINE([NDEBUG]) ]) +AM_CONDITIONAL([DEBUG], [[[[ "$DEBUG" = "1" ]]]]) + AC_MSG_CHECKING(if you want to do a profile build) AC_ARG_ENABLE(profile, AC_HELP_STRING([--enable-profile], [Enable profiling]), diff --git a/include/ircd/Makefile.am b/include/ircd/Makefile.am index 05b4be342..9eb4de6bf 100644 --- a/include/ircd/Makefile.am +++ b/include/ircd/Makefile.am @@ -5,8 +5,17 @@ AM_CPPFLAGS = \ @BOOST_CPPFLAGS@ \ ### +AM_CXXFLAGS = \ + ### + if GCC -AM_CXXFLAGS = -fpch-deps +AM_CXXFLAGS += -fpch-deps +endif + +if DEBUG +if GCC +AM_CXXFLAGS += -fmax-errors=2 +endif endif if BUILD_PCH diff --git a/ircd/Makefile.am b/ircd/Makefile.am index c6f915b62..a067da261 100644 --- a/ircd/Makefile.am +++ b/ircd/Makefile.am @@ -3,7 +3,6 @@ AUTOMAKE_OPTIONS = foreign libircddir = @libdir@ AM_CPPFLAGS = \ - -fmax-errors=2 \ -ffriend-injection \ -I$(top_srcdir)/include \ @ROCKSDB_CPPFLAGS@ \ @@ -12,10 +11,19 @@ AM_CPPFLAGS = \ -include ircd/ircd.h \ ### +AM_CXXFLAGS = \ + ### + if MINGW PLATFORM_LDFLAGS = -Wl,--enable-runtime-pseudo-reloc -export-symbols-regex '*' endif +if DEBUG +if GCC +AM_CXXFLAGS += -fmax-errors=2 +endif +endif + AM_LDFLAGS = \ -avoid-version \ -Wl,-fuse-ld=gold \