[lug] Automake question: Overriding optimization defaults

Tom Tromey tromey at redhat.com
Wed Feb 27 12:34:52 MST 2002


>>>>> "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