[lug] Automake question: Overriding optimization defaults

Scott A. Herod herod at interact-tv.com
Wed Feb 27 13:49:13 MST 2002


Thanks for the note, Tom.

It appears that configure checks to see if CXXFLAGS is set and if not
determines a default.  Since our build tree is recursive and fully
automated, it's a bit tricky to flag individual library's make or
configure calls.  However, if I set CXXFLAGS to be empty I can generate
my own with AM_CXXFLAGS.

Maybe it would be better for me to add my own "debug" target that
redefines
CXXFLAGS before calling the default.  That would be better.

Scott

Tom Tromey wrote:
> 
> >>>>> "Scott" == Scott A Herod <herod at interact-tv.com> writes:
> 
> Scott>   I'm using the autoconf/automake utilities for generating
> Scott> makefiles but I can't figure out how to override the default
> Scott> debug and optimization flags.  Right now I'm getting "-g -O2".
> 
> autoconf sets this, not automake.
> 
> Scott> I'm setting AM_CXXFLAGS but that doesn't override the default (
> Scott> which seems to be set in /usr/share/autoconf/acspecific.mf ).
> Scott> Is there something else that I should use?
> 
> At configure time:
> 
>     CFLAGS=-g ./configure ...
> 
> (with autoconf 2.5x you can use `./configure CFLAGS=-g ...', which is
> easier to remember)
> 
> At build time:
> 
>     make CFLAGS=-g
> 
> Macros like CFLAGS, CXXFLAGS, etc, are there for the user to use.
> Unfortunately there still isn't a nice document explaining what
> features automake provides to the person building the package :-(
> 
> Tom



More information about the LUG mailing list