Sander Niemeijer wrote:
> 
> On woensdag, sep 28, 2005, at 17:04 Europe/Amsterdam, Harald Dunkel wrote:
> 
>>> autoconf sets CFLAGS/CXXFLAGS to "reasonable defaults", that's all. If
>>> these defaults cause problems on your platforms, you have to override
>>> them.
>>>
>>
>> They cannot be called "defaults", if they get a higher priority
>> than the flags set in my Makefile.am. And I do not think that
>> setting CXXFLAGS='-g -O2' is a reasonable default, unless autoconf/
>> automake's assumption is that the user is supposed to debug the
>> developer's code.
>>
>> IMHO the priorities for setting build flags should be (highest
>> first):
>>     1)    user
>>     2)    developer
>>     3)    autoconf/automake
>>
>> Surely it is OK that autoconf/automake can provide default build
>> flags somehow, but the flags set by the developer (e.g. AM_CXXFLAGS)
>> should get a higher priority, if they are set. And automake/autoconf
>> should provide just the bare minimum.
> 
> 
> As a developer you have full control over both AM_xxxFLAGS and xxxFLAGS
> variables. There is no ownership difference between these two types of
> flags from a developer/autoconf point of view. If you don't like the
> default for CXXFLAGS that autoconf choses then just replace it in the
> way Ralph explained:
> 
> CXXFLAGS=${CXXFLAGS-"<your other settings>"}
> 

Sorry, but you missed one point: Autconf/automake _should_ provide
default build flags, but with a lower priority then the flags set
by the developer. It should be possible for a developer to set in
his Makefile.am

        AM_CXXFLAGS = -Wall

if he wants to extend Automake's default (-g -O2), or

        AM_AM_CXXFLAGS =
        AM_CXXFLAGS = -O3 -Wall

if he wants to ignore it. Just as an example.

Important is that control about the defaults provided by autoconf/
automake is moved to the developer, if he is interested. The user
should keep the final saying. I guess we all agree here.


Regards

Harri


Reply via email to