automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why I can not overwrite CXXFLAGS values?


From: Steven Woody
Subject: Re: Why I can not overwrite CXXFLAGS values?
Date: Sat, 7 Jun 2008 22:01:06 +0800

On Sat, Jun 7, 2008 at 3:38 PM, Ralf Wildenhues <address@hidden> wrote:
> Hello Steven,
>
> * Steven Woody wrote on Fri, Jun 06, 2008 at 08:54:59PM CEST:
>> In my system, the default CXXFLAGS is '-g -O2'.  But, for a particular
>> program, I need -O0 and without -g.  I tried something like:
>>   bin_PROGRAS = xxx
>>   xxx_CXXFLAGS = -O0
>> in Makefile.am.  But, the final CXXFLAGS used when I compile is
>> actually -O0 -g -O2, the default CXXFLAGS appended to my xxx_CXXFLAGS.
>
> Note that is exactly done because CXXFLAGS is for the user, not the
> developer.  If you try to outsmart the user, then that may fire back
> because your users may just know better what's good for their system.
> Yes, they really may.
>

Thank you.

> That said, you can
>  CXXFLAGS =
>  AM_CXXFLAGS = $(CXXFLAGS)
>  xxx_CXXFLAGS = -O0

Set AM_ and xxx_ both?  Manual said, only one of them will be used.


>
> and you probably want `AUTOMAKE_OPTIONS = -Wno-override' in that
> Makefile.am.
>
> Alternatively, you can modify $CXXFLAGS within configure.ac; find out
> whether CXXFLAGS was set by the user _before_ AC_PROG_CXX, and if it
> wasn't, you can default it to your liking.

How?  Thanks.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]