* configure.ac: Add --disable-optimization. This is handy for debugging
authorDavid Shaw <dshaw@jabberwocky.com>
Tue, 23 May 2006 15:32:57 +0000 (15:32 +0000)
committerDavid Shaw <dshaw@jabberwocky.com>
Tue, 23 May 2006 15:32:57 +0000 (15:32 +0000)
so the compiler doesn't rearrange things and eliminate variables.

ChangeLog
configure.ac

index 64f5a7e..55537b9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-05-23  David Shaw  <dshaw@jabberwocky.com>
+
+       * configure.ac: Add --disable-optimization.  This is handy for
+       debugging so the compiler doesn't rearrange things and eliminate
+       variables.
+
 2006-05-22  Marcus Brinkmann  <marcus@g10code.de>
 
        * configure.ac: Remove check for noexecstack and invoke
index a6adfc2..6804145 100644 (file)
@@ -1264,6 +1264,15 @@ if test "$GCC" = yes; then
         CFLAGS="$CFLAGS -Wall"
     fi
 
+    # This is handy for debugging so the compiler doesn't rearrange
+    # things and eliminate variables.
+    AC_ARG_ENABLE(optimization,
+       AC_HELP_STRING([--disable-optimization],
+                     [disable compiler optimization]),
+                      [if test $enableval = no ; then
+                         CFLAGS=`echo $CFLAGS | sed 's/-O[[0-9]]//'`
+                       fi])
+
     AC_MSG_CHECKING([if gcc supports -Wno-pointer-sign])
 
     _gcc_cflags_save=$CFLAGS