Ossama Othman <[EMAIL PROTECTED]> writes:

> I've had complaints from users about the fact that my configure script
> adds "-g -O2" to CXXFLAGS by default since they want to compile an
> optimized version of the library without debugging symbols.  I know that
> gcc/g++ can generate debugging symbols for optimized code, but that's
> not the issue.  The issue here is that the user doesn't appear to have a
> choice about the "-g -O2" flags.

Set CFLAGS in the environment before running autoconf.  I believe CVS
autoconf has other, nicer mechanisms for doing this.  I have the following
alias that I always use to run configure:

alias stdconf env CC=gcc CFLAGS=-O2 CXX=g++ CXXFLAGS=-O2 sh configure \
      --datadir=\''${prefix}/lib'\' \
      --libexecdir=\''${prefix}/lib'\' \
      --sharedstatedir=\''${prefix}/lib'\'

As you can see, it's primarily there to disable the really annoying
default file layout that the GNU coding standards decided on, for reasons
that I still disagree with.  (Although that's not nearly as annoying as
the fact that most packages that include i18n support absolutely will not
put locale files in lib where they belong instead of in share without
actually patching the Makefile, since it hard-codes $prefix/share.)

> Is this correct?  If so, why does autoconf add these?

It's a GNU coding standards thing.

-- 
Russ Allbery ([EMAIL PROTECTED])             <http://www.eyrie.org/~eagle/>

Reply via email to