[lug] Automake question: Overriding optimization defaults

Tom Tromey tromey at redhat.com
Wed Feb 27 14:40:10 MST 2002


Scott> It appears that configure checks to see if CXXFLAGS is set and
Scott> if not determines a default.

Yes.  I think this bit is documented in the autoconf manual.

Scott> Since our build tree is recursive and fully automated, it's a
Scott> bit tricky to flag individual library's make or configure
Scott> calls.  However, if I set CXXFLAGS to be empty I can generate
Scott> my own with AM_CXXFLAGS.

There's no support for doing it case-by-case.
I tend to just rebuild the code I'm interested in.

For instance, I frequently build gcc, which has a lot of directories.
Then if I want to debug the compiler itself (as opposed to the many
support libraries or whatever), I just do:

    cd <builddir>/gcc
    make mostlyclean
    make CFLAGS=-g

In theory this works in any automake-using tree (in practice it
requires that the Makefile.am author not have somehow made this not
work).

Sometimes I'll just remove a single .o and rebuild it, if I know where
I want to debug.

Often I'll also just build the whole tree with debugging.  In most
cases I tend to be fixing bugs, and only when I'm working on
performance issues do I really care about optimization.

Tom



More information about the LUG mailing list