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

Re: Maintainer mode and debug flags

From: Malcolm Rowe <malcolm-svn-dev_at_farside.org.uk>
Date: 2007-04-20 10:54:17 CEST

On Thu, Apr 19, 2007 at 03:55:34PM -0500, Hyrum K. Wright wrote:
> [[[
> * configure.in
> Disable debug symbols by default, unless requested by '--enable-debug'
> or '--enable-maintainer-mode'. Also, disable optimizations when using
> maintainer mode.
> ]]]

> Index: configure.in
> ===================================================================
> --- configure.in (revision 24663)
> +++ configure.in (working copy)
> @@ -444,49 +444,55 @@
> capable of https:// access.]),
> [])
>
> -AC_ARG_ENABLE(debug,
> -AC_HELP_STRING([--enable-debug],
> - [Turn on debugging]),
> -[
> - if test "$enableval" = "yes" ; then
> - enable_debugging="yes"
> - else
> - enable_debugging="no"
> - fi
> -],
> -[
> - enable_debugging="no"
> -])
> +enable_debugging=no
>
> 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
> + remove_optimization=yes

What's the point in remove_optimization? It always follows the value of
enable_debugging (which makes sense: we want to remove optimisations
when debugging is enabled; I just don't think it needs to be a separate
variable).

> + add_debug_flags=yes
> +
> if test "$GCC" = "yes"; then
> CFLAGS="$CFLAGS -Wpointer-arith -Wwrite-strings -Wshadow"
> fi
> fi
> ])
>
> +AC_ARG_ENABLE(debug,
> +AC_HELP_STRING([--enable-debug],
> + [Turn on debugging]),
> +[
> + if test "$enableval" = "yes" ; then
> + enable_debugging="yes"
> + add_debug_flags=yes
> + remove_optimization=yes
> + fi
> +])

Weren't you going to add something so that '--enable-maintainer-mode
--disable-debug' worked? (i.e. debugging is off by default, except that
--enable-maintainer-mode switches it on, except that --disable-debug can
switch it off again; the result being a build with SVN_DEBUG defined but
without -g).

> +
> if test "$enable_debugging" = "yes" ; then
> dnl At the moment, we don't want optimization, because we're
> dnl debugging.
> - CFLAGS=["`echo $CFLAGS' ' | sed -e 's/-O[^ ]* //g'`"]
> + remove_optimization=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"
> + add_debug_flags=yes
> else
> if test "$enable_debugging" = "no" ; then
> CFLAGS=["`echo $CFLAGS' ' | sed -e 's/-g[0-9] //g' | sed -e 's/-g//g'`"]
> fi
> fi
>
> +if test "$remove_optimization" = "yes" ; then
> + CFLAGS=["`echo $CFLAGS' ' | sed -e 's/-O[^ ]* //g'`"]
> +fi

I think this can be combined with stripping out -g above - we always
want optimisation off when -g is on, and I can't offhand think of a
situation where we want optimisation off otherwise.

>
> +if test "$add_debug_flags" = "yes" ; then
> + CFLAGS="$CFLAGS -DSVN_DEBUG -DAP_DEBUG"
> +fi
> +
> AC_ARG_WITH(editor,
> AC_HELP_STRING([--with-editor=PATH],
> [Specify a default editor for the subversion client.]),

Regards,
Malcolm

  • application/pgp-signature attachment: stored
Received on Fri Apr 20 10:54:31 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.