[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Rationalize --enable-debug and --enable-maintainer-mode

From: Hyrum K. Wright <hyrum_wright_at_mail.utexas.edu>
Date: 2007-03-22 23:51:30 CET

Peter Lundblad wrote:
> Hi,
>
> the current situation regarding --enable-debug and
> --enable-maintainer-mode is a little confusing.
>
> --enable-debug enables compiler debugging, but not the SVN_DEBUG and
> AP_DEBUG macros. OTOH, --enable-maintainer-mode does the latter,
> but does not enable compiler debugging, although it pretends to do
> so by setting an internal variable, but too late... Uh...
> I'm not sure if we need two options here, but it might be good to
> leave --enable-debug to not cause problems for people with automated
> builds. Also, --disable-debug can be used to disable debugging
> information.
>
> Anyway, any objections to this patch that tries to make this a little
> less confusing?

+1. My autoconf-fu isn't very good, so I can't comment on the patch,
but very in favor of the concept.

-Hyrum

> [[[
> When configuring, make --enable-debug disable compiler optimization and make
> --enable-maintainer-mode imply --enable-debug.
>
> * configure.in:
> Move check for --enable-maintainer-mode above conditional on
> $enable_debugging and move addition of SVN_DEBUG and AP_DEBUG
> to that conditional.
> ]]]
>
> Index: configure.in
> ===================================================================
> --- configure.in (revision 24026)
> +++ configure.in (working copy)
> @@ -440,7 +440,7 @@
>
> AC_ARG_ENABLE(debug,
> AC_HELP_STRING([--enable-debug],
> - [Turn on debugging and compile time warnings]),
> + [Turn on debugging]),
> [
> if test "$enableval" = "yes" ; then
> enable_debugging="yes"
> @@ -448,11 +448,29 @@
> enable_debugging="no"
> fi
> ])
> +
> +AC_ARG_ENABLE(maintainer-mode,
> +AC_HELP_STRING([--enable-maintainer-mode],
> + [Turn on debugging and very strict compile-time warnings]),
> +[
> + if test "$enableval" = "yes" ; then
> + if test "$enable_debugging" = "no" ; then
> + AC_MSG_ERROR(Can't have --disable-debug and --enable-maintainer-mode)
> + fi
> + enable_debugging=yes
> + if test "$GCC" = "yes"; then
> + CFLAGS="$CFLAGS -Wpointer-arith -Wwrite-strings -Wshadow"
> + fi
> + fi
> +])
> +
> if test "$enable_debugging" = "yes" ; then
> dnl At the moment, we don't want optimization, because we're
> dnl debugging.
> - dnl ### actually, debugging should be fine with the default -O2
> CFLAGS=["`echo $CFLAGS' ' | sed -e 's/-O[^ ]* //g'`"]
> + dnl SVN_DEBUG enables specific features for developer builds
> + dnl AP_DEBUG enables specific (Apache) features for developer builds
> + CFLAGS="$CFLAGS -DSVN_DEBUG -DAP_DEBUG"
> else
> if test "$enable_debugging" = "no" ; then
> CFLAGS=["`echo $CFLAGS' ' | sed -e 's/-g[0-9] //g' | sed -e 's/-g//g'`"]
> @@ -493,25 +511,7 @@
> AC_SUBST(MOD_ACTIVATION)
>
>
> -AC_ARG_ENABLE(maintainer-mode,
> -AC_HELP_STRING([--enable-maintainer-mode],
> - [Turn on debugging and very strict compile-time warnings]),
> -[
> - if test "$enableval" = "yes" ; then
> - if test "$enable_debugging" = "no" ; then
> - AC_MSG_ERROR(Can't have --disable-debug and --enable-maintainer-mode)
> - fi
> - enable_debugging=yes
> - dnl SVN_DEBUG enables specific features for developer builds
> - dnl AP_DEBUG enables specific (Apache) features for developer builds
> - CFLAGS="$CFLAGS -DSVN_DEBUG -DAP_DEBUG"
> - if test "$GCC" = "yes"; then
> - CFLAGS="$CFLAGS -Wpointer-arith -Wwrite-strings -Wshadow"
> - fi
> - fi
> -])
>
> -
> AC_ARG_ENABLE(gprof,
> AC_HELP_STRING([--enable-gprof],
> [Produce gprof profiling data in 'gmon.out' (GCC only).]),

Received on Thu Mar 22 23:51:27 2007

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.