This does probably need more discussion (and, instead of just hacking
away -O2, a proper fix for the bugs covered by -O0). I just include it
for completeness here. Not necessary to make 'make distcheck' work.

Signed-off-by: Robert Schwebel <[EMAIL PROTECTED]>

 configure.in |   49 +++++++++++++++++++++++++++++++++----------------
 1 file changed, 33 insertions(+), 16 deletions(-)

Index: configure.in
===================================================================
--- configure.in.orig
+++ configure.in
@@ -41,6 +41,25 @@ AC_SUBST(ILASM)
 
 AC_PATH_PROG(SYSTEM_AR, ar)
 
+#
+# Debugging
+#
+AC_MSG_CHECKING([whether to enable debugging])
+AC_ARG_ENABLE(debug,
+    AS_HELP_STRING([--enable-debug], [enable debugging @<:@default=yes@:>@]),
+        [case "$enableval" in
+        y | yes) CONFIG_DEBUG=yes ;;
+        *) CONFIG_DEBUG=no ;;
+    esac],
+    [CONFIG_DEBUG=yes])
+AC_MSG_RESULT([${CONFIG_DEBUG}])
+if test "${CONFIG_DEBUG}" = "yes"; then
+    CFLAGS="${CFLAGS} -Wall -Wsign-compare -Wfloat-equal -Wformat-security -g 
-O0"
+    AC_DEFINE(DEBUG, 1, [debugging])
+else
+    CFLAGS="${CFLAGS} -Wall -O2"
+fi
+
 dnl Option to disable cygwin1.dll under Windows.
 dnl case "$host$" in
 dnl    *-*-cygwin*) def_cygwin=false ;;
@@ -217,16 +236,18 @@ AC_ARG_WITH(profile,
        PROFILE_NAME=full
 ])
 
-#
-# NOTE! This (--disable-optimizations argument) should be able to be removed 
when the gcc optimizer bug goes away.......
-#
-AC_ARG_ENABLE(optimizations,  
-[  --disable-optimizations disables all CFLAGS that have been passed into 
./configure via the environment or 
-                          by the PROG_CC macro. The result is that CFLAGS is 
replaced by the default '-g'. 
-                          This is useful in bypassing the apparent bugs in 
gcc's optimizer.], 
-[
-       CFLAGS="-g"
-])
+dnl FIXME RSC: this is complete bogus, isn't it?
+dnl
+dnl #
+dnl # NOTE! This (--disable-optimizations argument) should be able to be 
removed when the gcc optimizer bug goes away.......
+dnl #
+dnl AC_ARG_ENABLE(optimizations,
+dnl [  --disable-optimizations disables all CFLAGS that have been passed into 
./configure via the environment or
+dnl                           by the PROG_CC macro. The result is that CFLAGS 
is replaced by the default '-g'.
+dnl                           This is useful in bypassing the apparent bugs in 
gcc's optimizer.],
+dnl [
+dnl    CFLAGS="-g"
+dnl ])
 
 dnl This code was borrowed from "libgc" to test for the correct
 dnl thread package to use, and to notify the garbage collector's
@@ -509,12 +530,8 @@ AC_TRY_COMPILE([], [
 AC_MSG_RESULT($piccompgoto)
 
 dnl Check to see if we are using gcc or not.
-if test x$GCC = xyes ; then
-       if test x$withjit = xyes ; then
-               CFLAGS="$CFLAGS -fno-omit-frame-pointer -Wall"
-       else
-               CFLAGS="$CFLAGS -Wall"
-       fi
+if test x$GCC = xyes && test x$withjit = xyes ; then
+       CFLAGS="$CFLAGS -fno-omit-frame-pointer"
 fi
 
 dnl Check for "tm_gmtoff" in "struct tm".

--
 Dipl.-Ing. Robert Schwebel | http://www.pengutronix.de
 Pengutronix - Linux Solutions for Science and Industry
   Handelsregister:  Amtsgericht Hildesheim, HRA 2686
     Hannoversche Str. 2, 31134 Hildesheim, Germany
   Phone: +49-5121-206917-0 |  Fax: +49-5121-206917-9

_______________________________________________
Developers mailing list
[email protected]
http://dotgnu.org/mailman/listinfo/developers

Reply via email to