diff --git a/configure.ac b/configure.ac index 2b5b9e5ae..8044d3002 100644 --- a/configure.ac +++ b/configure.ac @@ -418,6 +418,18 @@ fi AM_CONDITIONAL([ASYNCEXCEPT], [[[[ $asyncexcept = "yes" ]]]]) +dnl +dnl Low memory compilation mode +dnl + +AC_ARG_ENABLE(lowmem-compile, AC_HELP_STRING([--enable-lowmem-compile], [Enable low-memory compilation options]), +[ + lowmem_compile="yes" +], [ + lowmem_compile="no" +]) + +AM_CONDITIONAL([LOWMEM_COMPILE], [[[[ $lowmem_compile = "yes" ]]]]) dnl dnl Optimization diff --git a/ircd/Makefile.am b/ircd/Makefile.am index ef9136ebc..ad0f7e7c8 100644 --- a/ircd/Makefile.am +++ b/ircd/Makefile.am @@ -160,10 +160,12 @@ endif # (>= 2 GiB) which can thrash small systems and even sometimes crash GCC. # This option reduces memory consumption at the cost of compilation speed. if GCC -json.lo: CXXFLAGS += --param ggc-min-expand=3 -#http.lo: CXXFLAGS += --param ggc-min-expand=15 -#rfc3986.lo: CXXFLAGS += --param ggc-min-expand=15 -#rfc1459.lo: CXXFLAGS += --param ggc-min-expand=15 -#m_id.lo: CXXFLAGS += --param ggc-min-expand=15 -#fmt.lo: CXXFLAGS += --param ggc-min-expand=15 +if LOWMEM_COMPILE +json.lo: CXXFLAGS += --param ggc-min-expand=1 +http.lo: CXXFLAGS += --param ggc-min-expand=1 +fmt.lo: CXXFLAGS += --param ggc-min-expand=1 +rfc3986.lo: CXXFLAGS += --param ggc-min-expand=1 +rfc1459.lo: CXXFLAGS += --param ggc-min-expand=1 +m_id.lo: CXXFLAGS += --param ggc-min-expand=1 +endif endif