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

Re: [PATCH] fix for --enable-debug configuration option

From: Marc Singer <elf_at_buici.com>
Date: 2003-09-02 23:49:12 CEST

On Tue, Sep 02, 2003 at 10:34:51PM +0100, Philip Martin wrote:
> Marc Singer <elf@buici.com> writes:
>
> Patches should be sent to the dev list (I've set Mail-Followup-To),
> ideally they would include a log message as well. See the HACKING
> file.

I sent it there, too. I'll read HACKING, too.

> > I've looked deeper into the configure script and found that
> > --enable-debug is intended to do the trick. What appears to be
> > missing is the setting of the -g switch. This switch is supposed to
> > be set automatically, but is being blocked by the presence of other
> > options. The attached patch moves the check for the C compiler to the
> > top of the configuration script which fixes the problem.
>
> I don't understand your explanation of the problem, or your
> explanation of the solution. What does "being blocked by the presence
> of other options" mean?

The compiler check script has the following fragment:

     if test "$ac_test_CFLAGS" = set; then
       CFLAGS=$ac_save_CFLAGS
     elif test $ac_cv_prog_cc_g = yes; then
       if test "$GCC" = yes; then
         CFLAGS="-g -O2"
       else
         CFLAGS="-g"
       fi
     else
       if test "$GCC" = yes; then
         CFLAGS="-O2"
       else
         CFLAGS=
       fi
     fi

which means that if $ac_save_CFLAGS is not empty, set CFLAGS to that
value, otherwise set -O2 and -g accordingly. Normally, CFLAGS is
empty when ./configure is executed and so the -g flag is set.
However, earlier in the configuration script there is the line

  CFLAGS="$CFLAGS `$apr_config --cflags`"

which makes CFLAGS non-empty. That's what 'blocks' the setting of -g
and -O2 by the compiler check.n

> With your patch I get I get
>
> CFLAGS = -g -O2 -g -O2 -pthread -DNEON_ZLIB -DNEON_SSL $(EXTRA_CFLAGS)
>
> which doesn't seem right.
>
> I don't have apr, apr-util, db or neon in the Subversion build tree,
> do you? Is that making the difference?

That's part of the problem. It is odd that you'd get two copies of
the switches unless CFLAGS is set in your environment.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Sep 3 00:16:37 2003

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.