[cvslog] (2008-07-04 03:17:35 UTC) Module eggdrop1.6: Change committed!

cvslog cvs at tsss.org
Thu Jul 3 21:17:35 CST 2008


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.6
Commit time: 2008-07-04 03:17:35 UTC
Commited by: Tothwolf <tothwolf at techmonkeys.org>

Modified files:
     Makefile.in aclocal.m4 config.h.in configure configure.ac
     src/eggdrop.h src/main.c

Log message:

Require autoconf 2.60 now.

Added AC_PRESERVE_HELP_ORDER macro to configure.ac

Added new autoconf macros to aclocal.m4 and configure.ac: EGG_DEBUG_ENABLE EGG_DEBUG_DEFAULTS EGG_DEBUG_OPTIONS EGG_DEBUG_CFLAGS EGG_ENABLE_DEBUG_CONTEXT

Added new configure options: --enable-debug --enable-debug-mem --enable-debug-assert --enable-debug-context

Replaced ENABLE_STRIP define with DEBUG

DEBUG_CONTEXT is now defined in config.h instead of eggdrop.h

Refactored DEBUG and DEBUG_CONTEXT conditional code in main.c.

Don't default set unlimited core file size for non-debug builds.

---------------------- diff included ----------------------
Index: eggdrop1.6/Makefile.in
diff -u eggdrop1.6/Makefile.in:1.41 eggdrop1.6/Makefile.in:1.42
--- eggdrop1.6/Makefile.in:1.41	Thu Jul  3 20:52:55 2008
+++ eggdrop1.6/Makefile.in	Thu Jul  3 22:17:25 2008
@@ -2,7 +2,7 @@
 #  This is the Makefile for EGGDROP (the IRC bot)
 #  You should never need to edit this.
 #
-# $Id: Makefile.in,v 1.41 2008-07-04 01:52:55 tothwolf Exp $
+# $Id: Makefile.in,v 1.42 2008-07-04 03:17:25 tothwolf Exp $
 
 SHELL = @SHELL@
 top_srcdir = @top_srcdir@
@@ -22,12 +22,15 @@
 #   -Wall            if you're using gcc and it supports it
 #                    (configure usually detects this anyway now)
 #
+#   -DDEBUG          generic debugging code
 #   -DDEBUG_ASSERT   to enable assert debugging
 #   -DDEBUG_MEM      to be able to debug memory allocation (.debug)
-#                    These can both be set by using 'make debug'
-#                    or 'make sdebug'
-CFLGS =
-DEBCFLGS = -g3 -DDEBUG_ASSERT -DDEBUG_MEM
+#
+# Debug defines can be set with configure now.
+# See ./configure --help for more information.
+
+CFLGS = @CFLGS@
+DEBCFLGS = @DEBCFLGS@
 
 # ./configure SHOULD set these; however you may need to tweak them to get
 # modules to compile. If you do, PLEASE let the development team know so
Index: eggdrop1.6/aclocal.m4
diff -u eggdrop1.6/aclocal.m4:1.109 eggdrop1.6/aclocal.m4:1.110
--- eggdrop1.6/aclocal.m4:1.109	Thu Jul  3 21:41:42 2008
+++ eggdrop1.6/aclocal.m4	Thu Jul  3 22:17:25 2008
@@ -16,7 +16,7 @@
 dnl along with this program; if not, write to the Free Software
 dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 dnl
-dnl $Id: aclocal.m4,v 1.109 2008-07-04 02:41:42 tothwolf Exp $
+dnl $Id: aclocal.m4,v 1.110 2008-07-04 03:17:25 tothwolf Exp $
 dnl
 
 
@@ -412,7 +412,6 @@
                 [enable_strip="no"])
 
   if test "$enable_strip" = yes; then
-    AC_DEFINE(ENABLE_STRIP, 1, [Define if stripping is enabled.])
     cat << 'EOF' >&2
 
 configure: WARNING:
@@ -1606,6 +1605,167 @@
 ])
 
 
+dnl EGG_DEBUG_ENABLE()
+dnl
+AC_DEFUN([EGG_DEBUG_ENABLE],
+[
+  AC_ARG_ENABLE(debug,         [  --enable-debug          enable generic debug code (default for 'make debug')], [enable_debug="$enableval"], [enable_debug="auto"])
+  AC_ARG_ENABLE(debug,         [  --disable-debug         disable generic debug code], [enable_debug="$enableval"], [enable_debug="auto"])
+  AC_ARG_ENABLE(debug-assert,  [  --enable-debug-assert   enable assert debug code (default for 'make debug')], [enable_debug_assert="$enableval"], [enable_debug_assert="auto"])
+  AC_ARG_ENABLE(debug-assert,  [  --disable-debug-assert  disable assert debug code], [enable_debug_assert="$enableval"], [enable_debug_assert="auto"])
+  AC_ARG_ENABLE(debug-mem,     [  --enable-debug-mem      enable memory debug code (default for 'make debug')], [enable_debug_mem="$enableval"], [enable_debug_mem="auto"])
+  AC_ARG_ENABLE(debug-mem,     [  --disable-debug-mem     disable memory debug code], [enable_debug_mem="$enableval"], [enable_debug_mem="auto"])
+  AC_ARG_ENABLE(debug-context, [  --enable-debug-context  enable context debug code (default)], [enable_debug_context="$enableval"], [enable_debug_context="auto"])
+  AC_ARG_ENABLE(debug-context, [  --disable-debug-context disable context debug code], [enable_debug_context="$enableval"], [enable_debug_context="auto"])
+])
+
+
+dnl EGG_DEBUG_DEFAULTS()
+dnl
+AC_DEFUN([EGG_DEBUG_DEFAULTS],
+[
+  # Defaults:
+
+  # make: 'eggdrop' or 'static'
+  default_std_debug="no"
+  default_std_debug_assert="no"
+  default_std_debug_mem="no"
+  default_std_debug_context="yes"
+
+  # make: 'debug' or 'sdebug'
+  default_deb_debug="yes"
+  default_deb_debug_assert="yes"
+  default_deb_debug_mem="yes"
+  default_deb_debug_context="yes"
+
+  if test "$DEFAULT_MAKE" = eggdrop || test "$DEFAULT_MAKE" = static; then
+    default_debug="$default_std_debug" 
+    default_debug_assert="$default_std_debug_assert" 
+    default_debug_mem="$default_std_debug_mem" 
+    default_debug_context="$default_std_debug_context"
+  else
+    default_debug="$default_deb_debug"
+    default_debug_assert="$default_deb_debug_assert"
+    default_debug_mem="$default_deb_debug_mem"
+    default_debug_context="$default_deb_debug_context"
+  fi
+
+  debug_options="debug debug_assert debug_mem"
+
+  debug_cflags_debug="-g3 -DDEBUG"
+  debug_cflags_debug_assert="-DDEBUG_ASSERT"
+  debug_cflags_debug_mem="-DDEBUG_MEM"
+  debug_stdcflags_debug=""
+  debug_stdcflags_debug_assert=""
+  debug_stdcflags_debug_mem=""
+  debug_debcflags_debug=""
+  debug_debcflags_debug_assert=""
+  debug_debcflags_debug_mem=""
+])
+
+
+dnl EGG_DEBUG_OPTIONS()
+dnl
+AC_DEFUN([EGG_DEBUG_OPTIONS],
+[
+  for enable_option in $debug_options; do
+
+    eval enable_value=\$enable_$enable_option
+
+    # Check if either --enable-<opt> or --disable-<opt> was used
+    if test "$enable_value" != auto; then
+      # Make sure an invalid option wasn't passed as --enable-<opt>=foo
+      if test "$enable_value" != yes && test "$enable_value" != no; then
+        opt_name=`echo $enable_option | sed s/_/-/g`
+        eval opt_default=\$default_$enable_option
+        AC_MSG_WARN([Invalid option '$enable_value' passed to --enable-${opt_name}, defaulting to '$opt_default'])
+        eval enable_$enable_option="auto"
+      fi
+    fi
+
+    if test "$enable_value" = auto; then
+      # Note: options generally should not end up in both std and deb but
+      # there may be options in the future where this behavior is desired.
+      if test `eval echo '${'default_std_$enable_option'}'` = yes; then
+        eval `echo debug_stdcflags_$enable_option`=\$debug_cflags_$enable_option
+      fi
+      if test `eval echo '${'default_deb_$enable_option'}'` = yes; then
+        eval `echo debug_debcflags_$enable_option`=\$debug_cflags_$enable_option
+      fi
+    else
+      if test "$enable_value" = yes; then
+        # If option defaults to 'yes' for debug, always put it in stdcflags
+        # when the option is forced on because someone may want it enabled
+        # for a non-debug build.
+        if test `eval echo '${'default_deb_$enable_option'}'` = yes; then
+          eval `echo debug_stdcflags_$enable_option`=\$debug_cflags_$enable_option
+        else
+          # option defaulted to 'no' so put it in debcflags
+          eval `echo debug_debcflags_$enable_option`=\$debug_cflags_$enable_option
+        fi
+      fi
+    fi
+  done
+])
+
+
+dnl EGG_DEBUG_CFLAGS()
+dnl
+AC_DEFUN([EGG_DEBUG_CFLAGS],
+[
+  for cflg_option in $debug_options; do
+    eval stdcflg_value=\$debug_stdcflags_$cflg_option
+    EGG_APPEND_VAR(CFLGS, $stdcflg_value)
+
+    eval debcflg_value=\$debug_debcflags_$cflg_option
+    EGG_APPEND_VAR(DEBCFLGS, $debcflg_value)
+  done
+
+  # Disable debug symbol stripping if compiled with --enable-debug
+  # This will result in core dumps that are actually useful.
+  if test "x$debug_stdcflags_debug" != x; then
+    STRIP="touch"
+    MOD_STRIP="touch"
+    SHLIB_STRIP="touch"
+  fi
+
+  AC_SUBST(CFLGS)
+  AC_SUBST(DEBCFLGS)
+])
+
+
+dnl EGG_ENABLE_DEBUG_CONTEXT()
+dnl
+AC_DEFUN([EGG_ENABLE_DEBUG_CONTEXT],
+[
+  # Check if either --enable-debug-context or --disable-debug-context was used
+  if test "$enable_debug_context" != auto; then
+
+    # Make sure an invalid option wasn't passed as --enable-debug-context=foo
+    if test "$enable_debug_context" != yes && test "$enable_debug_context" != no; then
+      AC_MSG_WARN([Invalid option '$enable_debug_context' passed to --enable-debug-context, defaulting to '$default_debug_context'])
+      enable_debug_context="$default_debug_context"
+    fi
+  else
+    enable_debug_context="$default_debug_context"
+  fi
+
+  if test "$enable_debug_context" = yes; then
+    AC_DEFINE(DEBUG_CONTEXT, 1, [Define for context debugging.])
+  else
+    cat << 'EOF' >&2
+configure: WARNING:
+
+  You have disabled context debugging.
+
+  Eggdrop will not be able to provide context information if it crashes.
+  Bug reports without context are less helpful when tracking down bugs.
+
+EOF
+  fi
+])
+
+
 dnl EGG_CATCH_MAKEFILE_REBUILD()
 dnl
 AC_DEFUN([EGG_CATCH_MAKEFILE_REBUILD],
Index: eggdrop1.6/config.h.in
diff -u eggdrop1.6/config.h.in:1.49 eggdrop1.6/config.h.in:1.50
--- eggdrop1.6/config.h.in:1.49	Thu Jul  3 21:41:42 2008
+++ eggdrop1.6/config.h.in	Thu Jul  3 22:17:25 2008
@@ -34,6 +34,9 @@
 /* Define if running under Cygwin. */
 #undef CYGWIN_HACKS
 
+/* Define for context debugging. */
+#undef DEBUG_CONTEXT
+
 /* Define if running on SunOS 4.0. */
 #undef DLOPEN_1
 
@@ -43,9 +46,6 @@
 /* Defines the current Eggdrop version. */
 #undef EGG_VERSION
 
-/* Define if stripping is enabled. */
-#undef ENABLE_STRIP
-
 /* Define to 1 if you have the <arpa/inet.h> header file. */
 #undef HAVE_ARPA_INET_H
 
Index: eggdrop1.6/configure
diff -u eggdrop1.6/configure:1.157 eggdrop1.6/configure:1.158
--- eggdrop1.6/configure:1.157	Thu Jul  3 21:41:42 2008
+++ eggdrop1.6/configure	Thu Jul  3 22:17:25 2008
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Revision: 1.31 .
+# From configure.ac Revision: 1.32 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.61 for Eggdrop 1.6.20.
 #
@@ -706,6 +706,8 @@
 TCLINCFN
 TCL_REQS
 TCL_LIBS
+CFLGS
+DEBCFLGS
 EGGVERSION
 DEST
 MOD_UPDIR
@@ -1293,18 +1295,24 @@
    esac
   cat <<\_ACEOF
 
-Optional Features:
+Optional Features and Packages:
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
-  --enable-strip          enable stripping of binaries
-  --enable-tcl-threads    enable threaded Tcl library support (autodetect)
-  --disable-tcl-threads   disable threaded Tcl library support
-
-Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --enable-strip          enable stripping of binaries
   --with-tcllib=PATH      full path to Tcl library
   --with-tclinc=PATH      full path to Tcl header
+  --enable-tcl-threads    enable threaded Tcl library support (autodetect)
+  --disable-tcl-threads   disable threaded Tcl library support
+  --enable-debug          enable generic debug code (default for 'make debug')
+  --disable-debug         disable generic debug code
+  --enable-debug-assert   enable assert debug code (default for 'make debug')
+  --disable-debug-assert  disable assert debug code
+  --enable-debug-mem      enable memory debug code (default for 'make debug')
+  --disable-debug-mem     disable memory debug code
+  --enable-debug-context  enable context debug code (default)
+  --disable-debug-context disable context debug code
 
 Some influential environment variables:
   CC          C compiler command
@@ -1792,6 +1800,9 @@
 
 
 
+
+
+
 # Print start message
 
   { echo "$as_me:$LINENO: result: " >&5
@@ -4338,11 +4349,6 @@
 
 
   if test "$enable_strip" = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define ENABLE_STRIP 1
-_ACEOF
-
     cat << 'EOF' >&2
 
 configure: WARNING:
@@ -10810,6 +10816,215 @@
 
 
 
+# Debug options
+
+  # Check whether --enable-debug was given.
+if test "${enable_debug+set}" = set; then
+  enableval=$enable_debug; enable_debug="$enableval"
+else
+  enable_debug="auto"
+fi
+
+  # Check whether --enable-debug was given.
+if test "${enable_debug+set}" = set; then
+  enableval=$enable_debug; enable_debug="$enableval"
+else
+  enable_debug="auto"
+fi
+
+  # Check whether --enable-debug-assert was given.
+if test "${enable_debug_assert+set}" = set; then
+  enableval=$enable_debug_assert; enable_debug_assert="$enableval"
+else
+  enable_debug_assert="auto"
+fi
+
+  # Check whether --enable-debug-assert was given.
+if test "${enable_debug_assert+set}" = set; then
+  enableval=$enable_debug_assert; enable_debug_assert="$enableval"
+else
+  enable_debug_assert="auto"
+fi
+
+  # Check whether --enable-debug-mem was given.
+if test "${enable_debug_mem+set}" = set; then
+  enableval=$enable_debug_mem; enable_debug_mem="$enableval"
+else
+  enable_debug_mem="auto"
+fi
+
+  # Check whether --enable-debug-mem was given.
+if test "${enable_debug_mem+set}" = set; then
+  enableval=$enable_debug_mem; enable_debug_mem="$enableval"
+else
+  enable_debug_mem="auto"
+fi
+
+  # Check whether --enable-debug-context was given.
+if test "${enable_debug_context+set}" = set; then
+  enableval=$enable_debug_context; enable_debug_context="$enableval"
+else
+  enable_debug_context="auto"
+fi
+
+  # Check whether --enable-debug-context was given.
+if test "${enable_debug_context+set}" = set; then
+  enableval=$enable_debug_context; enable_debug_context="$enableval"
+else
+  enable_debug_context="auto"
+fi
+
+
+
+  # Defaults:
+
+  # make: 'eggdrop' or 'static'
+  default_std_debug="no"
+  default_std_debug_assert="no"
+  default_std_debug_mem="no"
+  default_std_debug_context="yes"
+
+  # make: 'debug' or 'sdebug'
+  default_deb_debug="yes"
+  default_deb_debug_assert="yes"
+  default_deb_debug_mem="yes"
+  default_deb_debug_context="yes"
+
+  if test "$DEFAULT_MAKE" = eggdrop || test "$DEFAULT_MAKE" = static; then
+    default_debug="$default_std_debug"
+    default_debug_assert="$default_std_debug_assert"
+    default_debug_mem="$default_std_debug_mem"
+    default_debug_context="$default_std_debug_context"
+  else
+    default_debug="$default_deb_debug"
+    default_debug_assert="$default_deb_debug_assert"
+    default_debug_mem="$default_deb_debug_mem"
+    default_debug_context="$default_deb_debug_context"
+  fi
+
+  debug_options="debug debug_assert debug_mem"
+
+  debug_cflags_debug="-g3 -DDEBUG"
+  debug_cflags_debug_assert="-DDEBUG_ASSERT"
+  debug_cflags_debug_mem="-DDEBUG_MEM"
+  debug_stdcflags_debug=""
+  debug_stdcflags_debug_assert=""
+  debug_stdcflags_debug_mem=""
+  debug_debcflags_debug=""
+  debug_debcflags_debug_assert=""
+  debug_debcflags_debug_mem=""
+
+
+  for enable_option in $debug_options; do
+
+    eval enable_value=\$enable_$enable_option
+
+    # Check if either --enable-<opt> or --disable-<opt> was used
+    if test "$enable_value" != auto; then
+      # Make sure an invalid option wasn't passed as --enable-<opt>=foo
+      if test "$enable_value" != yes && test "$enable_value" != no; then
+        opt_name=`echo $enable_option | sed s/_/-/g`
+        eval opt_default=\$default_$enable_option
+        { echo "$as_me:$LINENO: WARNING: Invalid option '$enable_value' passed to --enable-${opt_name}, defaulting to '$opt_default'" >&5
+echo "$as_me: WARNING: Invalid option '$enable_value' passed to --enable-${opt_name}, defaulting to '$opt_default'" >&2;}
+        eval enable_$enable_option="auto"
+      fi
+    fi
+
+    if test "$enable_value" = auto; then
+      # Note: options generally should not end up in both std and deb but
+      # there may be options in the future where this behavior is desired.
+      if test `eval echo '${'default_std_$enable_option'}'` = yes; then
+        eval `echo debug_stdcflags_$enable_option`=\$debug_cflags_$enable_option
+      fi
+      if test `eval echo '${'default_deb_$enable_option'}'` = yes; then
+        eval `echo debug_debcflags_$enable_option`=\$debug_cflags_$enable_option
+      fi
+    else
+      if test "$enable_value" = yes; then
+        # If option defaults to 'yes' for debug, always put it in stdcflags
+        # when the option is forced on because someone may want it enabled
+        # for a non-debug build.
+        if test `eval echo '${'default_deb_$enable_option'}'` = yes; then
+          eval `echo debug_stdcflags_$enable_option`=\$debug_cflags_$enable_option
+        else
+          # option defaulted to 'no' so put it in debcflags
+          eval `echo debug_debcflags_$enable_option`=\$debug_cflags_$enable_option
+        fi
+      fi
+    fi
+  done
+
+
+  for cflg_option in $debug_options; do
+    eval stdcflg_value=\$debug_stdcflags_$cflg_option
+
+  if test "x$stdcflg_value" != x; then
+    if test "x$CFLGS" = x; then
+      CFLGS="$stdcflg_value"
+    else
+      CFLGS="$CFLGS $stdcflg_value"
+    fi
+  fi
+
+
+    eval debcflg_value=\$debug_debcflags_$cflg_option
+
+  if test "x$debcflg_value" != x; then
+    if test "x$DEBCFLGS" = x; then
+      DEBCFLGS="$debcflg_value"
+    else
+      DEBCFLGS="$DEBCFLGS $debcflg_value"
+    fi
+  fi
+
+  done
+
+  # Disable debug symbol stripping if compiled with --enable-debug
+  # This will result in core dumps that are actually useful.
+  if test "x$debug_stdcflags_debug" != x; then
+    STRIP="touch"
+    MOD_STRIP="touch"
+    SHLIB_STRIP="touch"
+  fi
+
+
+
+
+
+  # Check if either --enable-debug-context or --disable-debug-context was used
+  if test "$enable_debug_context" != auto; then
+
+    # Make sure an invalid option wasn't passed as --enable-debug-context=foo
+    if test "$enable_debug_context" != yes && test "$enable_debug_context" != no; then
+      { echo "$as_me:$LINENO: WARNING: Invalid option '$enable_debug_context' passed to --enable-debug-context, defaulting to '$default_debug_context'" >&5
+echo "$as_me: WARNING: Invalid option '$enable_debug_context' passed to --enable-debug-context, defaulting to '$default_debug_context'" >&2;}
+      enable_debug_context="$default_debug_context"
+    fi
+  else
+    enable_debug_context="$default_debug_context"
+  fi
+
+  if test "$enable_debug_context" = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define DEBUG_CONTEXT 1
+_ACEOF
+
+  else
+    cat << 'EOF' >&2
+configure: WARNING:
+
+  You have disabled context debugging.
+
+  Eggdrop will not be able to provide context information if it crashes.
+  Bug reports without context are less helpful when tracking down bugs.
+
+EOF
+  fi
+
+
+
 # Substitute Makefile variables.
 
   EGGVERSION=`grep 'char.egg_version' $srcdir/src/main.c | $AWK '{gsub(/(\"|\;)/, "", $4); print $4}'`
@@ -11573,6 +11788,8 @@
 TCLINCFN!$TCLINCFN$ac_delim
 TCL_REQS!$TCL_REQS$ac_delim
 TCL_LIBS!$TCL_LIBS$ac_delim
+CFLGS!$CFLGS$ac_delim
+DEBCFLGS!$DEBCFLGS$ac_delim
 EGGVERSION!$EGGVERSION$ac_delim
 DEST!$DEST$ac_delim
 MOD_UPDIR!$MOD_UPDIR$ac_delim
@@ -11580,7 +11797,7 @@
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 92; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 94; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
Index: eggdrop1.6/configure.ac
diff -u eggdrop1.6/configure.ac:1.32 eggdrop1.6/configure.ac:1.33
--- eggdrop1.6/configure.ac:1.32	Thu Jul  3 21:41:42 2008
+++ eggdrop1.6/configure.ac	Thu Jul  3 22:17:25 2008
@@ -1,15 +1,16 @@
 dnl configure.ac: this file is processed by autoconf to produce ./configure.
 dnl
-dnl $Id: configure.ac,v 1.32 2008-07-04 02:41:42 tothwolf Exp $
+dnl $Id: configure.ac,v 1.33 2008-07-04 03:17:25 tothwolf Exp $
 
-AC_PREREQ(2.59)
+AC_PREREQ(2.60)
 AC_INIT([Eggdrop],[1.6.20],[bugs at eggheads.org])
 AC_COPYRIGHT([Copyright (C) 1999 - 2008 Eggheads Development Team])
-AC_REVISION($Revision: 1.32 $)
+AC_REVISION($Revision: 1.33 $)
 AC_CONFIG_SRCDIR(src/eggdrop.h)
 AC_CONFIG_AUX_DIR(misc)
 AC_CONFIG_HEADER(config.h)
 AC_PREFIX_DEFAULT([\${HOME}/eggdrop])
+AC_PRESERVE_HELP_ORDER
 
 dnl config.h stuff
 AH_TOP([/*
@@ -177,6 +178,14 @@
 EGG_TCL_LUSH
 
 
+# Debug options
+EGG_DEBUG_ENABLE
+EGG_DEBUG_DEFAULTS
+EGG_DEBUG_OPTIONS 
+EGG_DEBUG_CFLAGS  
+EGG_ENABLE_DEBUG_CONTEXT
+
+
 # Substitute Makefile variables.
 EGG_SUBST_EGGVERSION
 EGG_SUBST_DEST
Index: eggdrop1.6/src/eggdrop.h
diff -u eggdrop1.6/src/eggdrop.h:1.67 eggdrop1.6/src/eggdrop.h:1.68
--- eggdrop1.6/src/eggdrop.h:1.67	Sat Feb 16 15:41:03 2008
+++ eggdrop1.6/src/eggdrop.h	Thu Jul  3 22:17:25 2008
@@ -4,7 +4,7 @@
  *
  *   IF YOU ALTER THIS FILE, YOU NEED TO RECOMPILE THE BOT.
  *
- * $Id: eggdrop.h,v 1.67 2008-02-16 21:41:03 guppy Exp $
+ * $Id: eggdrop.h,v 1.68 2008-07-04 03:17:25 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -34,11 +34,7 @@
  */
 #undef NO_OLD_BOTNET
 
-/*
- * Undefine this to completely disable context debugging.
- * WARNING: DO NOT send in bug reports if you undefine this!
- */
-#define DEBUG_CONTEXT
+/* DEBUG_CONTEXT is now set in config.h by configure */
 
 /*
  * Set the following to the timestamp for the logfile entries.
Index: eggdrop1.6/src/main.c
diff -u eggdrop1.6/src/main.c:1.123 eggdrop1.6/src/main.c:1.124
--- eggdrop1.6/src/main.c:1.123	Thu Jul  3 20:52:55 2008
+++ eggdrop1.6/src/main.c	Thu Jul  3 22:17:25 2008
@@ -5,7 +5,7 @@
  *   command line arguments
  *   context and assert debugging
  *
- * $Id: main.c,v 1.123 2008-07-04 01:52:55 tothwolf Exp $
+ * $Id: main.c,v 1.124 2008-07-04 03:17:25 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -60,8 +60,8 @@
 #include "tandem.h"
 #include "bg.h"
 
-#ifndef ENABLE_STRIP
-#  include <sys/resource.h>
+#ifdef DEBUG                            /* For debug compile */
+#  include <sys/resource.h>             /* setrlimit() */
 #endif
 
 #ifdef CYGWIN_HACKS
@@ -222,10 +222,12 @@
     }
 }
 
-#ifdef DEBUG_CONTEXT
 static int nested_debug = 0;
 
-void write_debug()
+#ifndef DEBUG_CONTEXT
+#define write_debug() do {} while (0)
+#else
+static void write_debug()
 {
   int x;
   char s[25];
@@ -322,9 +324,7 @@
 
 static void got_bus(int z)
 {
-#ifdef DEBUG_CONTEXT
   write_debug();
-#endif
   fatal("BUS ERROR -- CRASHING!", 1);
 #ifdef SA_RESETHAND
   kill(getpid(), SIGBUS);
@@ -336,9 +336,7 @@
 
 static void got_segv(int z)
 {
-#ifdef DEBUG_CONTEXT
   write_debug();
-#endif
   fatal("SEGMENT VIOLATION -- CRASHING!", 1);
 #ifdef SA_RESETHAND
   kill(getpid(), SIGSEGV);
@@ -350,9 +348,7 @@
 
 static void got_fpe(int z)
 {
-#ifdef DEBUG_CONTEXT
   write_debug();
-#endif
   fatal("FLOATING POINT ERROR -- CRASHING!", 0);
 }
 
@@ -447,9 +443,7 @@
  */
 void eggAssert(const char *file, int line, const char *module)
 {
-#ifdef DEBUG_CONTEXT
   write_debug();
-#endif
   if (!module)
     putlog(LOG_MISC, "*", "* In file %s, line %u", file, line);
   else
@@ -712,18 +706,21 @@
   FILE *f;
   struct sigaction sv;
   struct chanset_t *chan;
+#ifdef DEBUG
+  struct rlimit cdlim;
+#endif
 
-#ifndef ENABLE_STRIP
-  /* Make sure it can write core, if you make debug. Else it's pretty
-   * useless (dw)
-   */
-  {
-    struct rlimit cdlim;
-
-    cdlim.rlim_cur = RLIM_INFINITY;
-    cdlim.rlim_max = RLIM_INFINITY;
-    setrlimit(RLIMIT_CORE, &cdlim);
-  }
+/* Make sure it can write core, if you make debug. Else it's pretty
+ * useless (dw)
+ *
+ * Only allow unlimited size core files when compiled with DEBUG defined.
+ * This is not a good idea for normal builds -- in these cases, use the
+ * default system resource limits instead.
+ */
+#ifdef DEBUG
+  cdlim.rlim_cur = RLIM_INFINITY;
+  cdlim.rlim_max = RLIM_INFINITY;
+  setrlimit(RLIMIT_CORE, &cdlim);
 #endif
 
   /* Initialise context list */
----------------------- End of diff -----------------------



More information about the Changes mailing list