]> jfr.im git - irc/rizon/znc.git/commitdiff
Add --disable-optimization flag to configure to remove -O2
authorpsychon <redacted>
Tue, 16 Sep 2008 13:33:19 +0000 (13:33 +0000)
committerpsychon <redacted>
Tue, 16 Sep 2008 13:33:19 +0000 (13:33 +0000)
PS: This also kills -fomit-frame-pointer. If GCC doesn't add it on itself,
    we don't do it either.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1206 726aef4b-f618-498e-8847-2d620e286838

configure
configure.in

index 7a5af8cfe14b8722e2968046292ae0c9e8295172..50ee4dbb335601d514c821f0e7d7095ca752a8d6 100755 (executable)
--- 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
index d3de95c9311957817c0914932e3fc1f0e7262e3a..b64e9e0d57d0e5346056a12f7df50474b1c5b387 100644 (file)
@@ -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