autoconf
[Top][All Lists]
Advanced

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

Re: AC_INIT seems to be setting CXXFLAGS


From: Monty Taylor
Subject: Re: AC_INIT seems to be setting CXXFLAGS
Date: Thu, 30 Jul 2009 14:26:46 -0700
User-agent: Thunderbird 2.0.0.22 (X11/20090608)

Bob Friesenhahn wrote:
> On Thu, 30 Jul 2009, Paolo Bonzini wrote:
> 
>>> The terrible part about how this mechanism works is that it injects into
>>> CXXFLAGS itself, which means that, without my configure script can't
>>> override that via the setting of AM_CXXFLAGS.
>>
>> I cannot parse this sentence.  Can you explain?
> 
> He is saying that he is not able to override the C++ compiler
> compilation flags by using only Automake.
> 
> Most compilers evaluate arguments in left to right order, and will
> override previously set arguments, but this is not assured.

Actually, it's that I can't override these in a default build by any
mechanism other than editing CXXFLAGS, which is listed as something that
autoconf scripts are not to do. The "right" way to set some flags into a
global CXXFLAGS is to use AM_CXXFLAGS ... but then the compile line
winds up being:

${CXX} ${AM_CXXFLAGS} ${CXXFLAGS}

So I'm left doing what I posted earlier and setting CXXFLAGS to "" if
the user hasn't set it at ./configure time, since there is no other
option to say "hey, um, thanks! but I don't really want you to add -g
-O2 to my flags"

I recognize that this is not the end of the world, but it's sort of
frustrating to have flags injected that are not, in fact, required, and
that I did not ask to have added, especially when it's done in such a
way that doesn't give me an pleasant alternatives.



Monty




reply via email to

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