[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: Philip Martin <philip_at_codematters.co.uk>
Date: 2003-09-03 00:49:07 CEST

Marc Singer <elf@buici.com> writes:

> 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.

The message I saw only had
  To: users@subversion.tigris.org

>> > 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`"

I understand now. On my system that sets CFLAGS to "-g -O2 -pthread",
which explains why it "works for me".

> 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.

I see now, the AC_PROG_CC provides the first "-g -O2" and the
apr_config line you identifed above adds the second "-g -O2".

I agree that you have identified a problem, but I'm not enough of an
autoconf expert to be able to say your solution is correct. I wonder
if it would be better if the files in build/ac-macros/ didn't set any
of CFLAGS, CPPFLAGS, LDFLAGS, etc. Instead they could set things like
SVN_APR_CFLAGS, SVN_BDB_CPPFLAGS, etc. and later these new variables
could be combined with the CFLAGS etc.

I guess it's possible CPPFLAGS getting set could have a similar effect
on AC_PROG_CPP.

-- 
Philip Martin
---------------------------------------------------------------------
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:50:02 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.