Hi all,

the GNU automake manual mentions that --enable-developer-mode is considered deprecated. So I prepared not to misuse it for other thing than the ones it was designed for.

The patch adds an --enable-developer-mode option to ./configure, which enables some CFLAGS for gcc (other compilers should follow) and defines the macro MC_ENABLE_DEBUGGING_CODE.

The latter will be used in src/global.h to either define or undefine the NDEBUG macro for assertions, and perhaps some deprecation macros.

Roland
Index: configure.ac
===================================================================
RCS file: /cvsroot/mc/mc/configure.ac,v
retrieving revision 1.22
diff -u -p -r1.22 configure.ac
--- configure.ac        13 Apr 2005 18:39:15 -0000      1.22
+++ configure.ac        16 Apr 2005 12:20:26 -0000
@@ -553,17 +553,7 @@ if test "$GLIBC21" != yes; then
     AC_DEFINE(USE_INCLUDED_REGEX, 1, [Use the regex included here])
 fi
 
-if test x"$USE_MAINTAINER_MODE" = x"yes"; then
-    if test x"${enable_gcc_warnings+set}" != x"set"; then
-        if test x"${GCC}" = x"yes"; then
-            CFLAGS="-Wall $CFLAGS"
-        fi
-    fi
-else
-    CPPFLAGS="-DNDEBUG ${CPPFLAGS}"
-fi
-
-ri_GCC_WARNINGS
+MC_ARG_ENABLE_DEVELOPER_MODE()
 
 AC_SUBST(CFLAGS)
 AC_SUBST(CPPFLAGS)
Index: acinclude.m4
===================================================================
RCS file: /cvsroot/mc/mc/acinclude.m4,v
retrieving revision 1.68
diff -u -p -r1.68 acinclude.m4
--- acinclude.m4        19 Mar 2005 21:53:24 -0000      1.68
+++ acinclude.m4        16 Apr 2005 12:20:26 -0000
@@ -957,3 +957,20 @@ if test "$mc_cv_asm_labels" != yes; then
              [Define if functions cannot be renamed by asm labels])
 fi
 ])
+
+AC_DEFUN([MC_ARG_ENABLE_DEVELOPER_MODE],
+[AC_ARG_ENABLE([developer-mode],
+  AS_HELP_STRING([--enable-developer-mode], [Enable debugging help]))
+AM_CONDITIONAL([DEVELOPER], [test x"$enable_developer_mode" = x"yes"])
+if test x"$enable_developer_mode" = x"yes"; then
+  AC_DEFINE([MC_ENABLE_DEBUGGING_CODE], [1], [Enable debugging code])
+  if test x"$GCC" = x"yes"; then
+dnl Developers get some useful warnings and debugging support.
+dnl This will make the backtrace output more readable.
+    CFLAGS="-W -Wall -ggdb ${CFLAGS}"
+  fi
+elif test x"$GCC" = x"yes"; then
+dnl Some warnings cannot hurt at all
+  CFLAGS="-Wall"
+fi
+])
_______________________________________________
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel

Reply via email to