Hello, Ossama!

> 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.  Is this correct?  If so,
> why does autoconf add these?  Shouldn't it be up to the package
> maintainer to decide whether these flags get added to the compiler
> flags?

I believe that it's a good default for those who compile packages (as
opposed to those who download binaries and those who develop that
software).

This way you get an executable that you can occasionally debug if you
encounter some problems, and yet it runs on the full speed. You can
strip the executable if you don't want debug information.

Package managers are welcome to provide different defaults (such as
-mpentium -O6)

If you want to debug the software seriously and/or compile it fast
(perhaps many times) you are welcome to write a script for running
configure with your preferred arguments.

Regards,
Pavel Roskin

Reply via email to