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: Paolo Bonzini
Subject: Re: AC_INIT seems to be setting CXXFLAGS
Date: Fri, 31 Jul 2009 09:09:05 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Lightning/1.0pre Thunderbird/3.0b2

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 intended meaning of "are not to do" is that the user should always be able to override CFLAGS and CXXFLAGS. In other words, autoconf scripts should never place in CFLAGS and CXXFLAGS any option that, if removed, will cause the build to fail. The typical example are -D and -I options, or in the case of GCC options like -fpermissive (which would presumably cause parse errors if eliminated) or -msse (without which SSE builtins won't work).

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"

That's okay.  Doing simply

: ${CXXFLAGS=""}

right after AC_INIT is fine. So is setting CXXFLAGS to "-O1 -g" if your program doesn't like being compiled at -O2.

I'm not a native speaker (and the only native-speaking Autoconf developer is gone for two weeks), so suggestions on how to phrase this in the documentation are very welcome.

Paolo




reply via email to

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