diff --git a/configure b/configure index 7a5af8cf..50ee4dbb 100755 --- a/configure +++ b/configure @@ -1235,6 +1235,8 @@ Optional Features: --disable-openssl disable openssl --disable-perl disable perl --enable-sasl enable sasl + --disable-optimization Disable some compiler optimizations to decrease + memory usage while compiling Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -2509,13 +2511,22 @@ if test "${enable_sasl+set}" = set; then enableval=$enable_sasl; if test "$enableval" = "yes" ; then SASL=1; fi fi +# Check whether --enable-optimization was given. +if test "${enable_optimization+set}" = set; then + enableval=$enable_optimization; OPTIMIZE="$enableval" +else + OPTIMIZE="yes" +fi + if test "$DEBUG" != "no"; then appendCXX -ggdb -D_DEBUG # These enable some debug options in g++'s STL, e.g. invalid use of iterators appendCXX -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC -D_GLIBCXX_CONCEPT_CHECKS else - appendCXX -O2 -fomit-frame-pointer + if test "x$OPTIMIZE" = "xyes"; then + appendCXX -O2 + fi fi if test "$IPV6" != "no"; then diff --git a/configure.in b/configure.in index d3de95c9..b64e9e0d 100644 --- a/configure.in +++ b/configure.in @@ -87,13 +87,20 @@ AC_ARG_ENABLE( [perl], AC_ARG_ENABLE( [sasl], AC_HELP_STRING([--enable-sasl], [enable sasl]), [if test "$enableval" = "yes" ; then SASL=1; fi],) +AC_ARG_ENABLE( [optimization], + AC_HELP_STRING([--disable-optimization], [Disable some compiler optimizations to + decrease memory usage while compiling]), + [OPTIMIZE="$enableval"], + [OPTIMIZE="yes"]) if test "$DEBUG" != "no"; then appendCXX -ggdb -D_DEBUG # These enable some debug options in g++'s STL, e.g. invalid use of iterators appendCXX -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC -D_GLIBCXX_CONCEPT_CHECKS else - appendCXX -O2 -fomit-frame-pointer + if test "x$OPTIMIZE" = "xyes"; then + appendCXX -O2 + fi fi if test "$IPV6" != "no"; then