Hi Paul,

On Mon, May 22, 2000 at 05:44:44PM -0400, Paul D. Smith wrote:
> %% Ossama Othman <[EMAIL PROTECTED]> writes:
> 
>   oo> I've had complaints from users about the fact that my configure script
>   oo> adds "-g -O2" to CXXFLAGS by default since they want to compile an
>   oo> optimized version of the library without debugging symbols.  I know
>   oo> that gcc/g++ can generate debugging symbols for optimized code, but
>   oo> that's not the issue.  The issue here is that the user doesn't appear
>   oo> to have a choice about the "-g -O2" flags.  Is this correct?  If so,
>   oo> why does autoconf add these?  Shouldn't it be up to the package
>   oo> maintainer to decide whether these flags get added to the compiler
>   oo> flags?
> 
> It's not correct.  If they read the INSTALL file (you do ship the
> autoconf INSTALL file with your package, right?)

Yes, of course.  "automake --add-missing" is my friend. :-)

> they'll see they can do
> either of these things to override the default value:
> 
>   $ CXXFLAGS=-g ./configure ...
>   $ make
> 
> (that's sh/ksh/bash/zsh syntax; if you're using csh/tcsh you need to add
> an "env " to the beginning of the configure line) or
> 
>   $ ./configure ...
>   $ make CXXFLAGS=-g

I knew about the environment options but I didn't realize that it
would disable the "-g -O2," for example.  That's what I get for not
reading INSTALL more than once every two years.  :-)

> (the latter assumes you're makefiles are properly constructed so that
> they don't add important options to CXXFLAGS and leave them to the user
> for modification, as the GNU coding standards require).

Yes, indeed.  I don't reset CXXFLAGS in the Makefile at all.  What I
would like is a way to disable the automatically selected "-g -O2"
flags by some configure script options, rather than using the
CXXFLAGS=whatever hack.  Note that I'm not saying that CXXFLAGS is
itself a hack.  What I feel is a hack is the fact that it must be used
to disable the "-g -O2" that autoconf adds to the compiler flags.
Does this make any sense?

> HTH! :)

Thanks!  ;-)

-Ossama
-- 
Ossama Othman <[EMAIL PROTECTED]>
Distributed Object Computing Laboratory, Univ. of California at Irvine
1024D/F7A394A8 - 84ED AA0B 1203 99E4 1068  70E6 5EB7 5E71 F7A3 94A8

Reply via email to