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 \