automake
[Top][All Lists]
Advanced

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

Re: Force -O0 flags, inhibit the default -O2 flags


From: Ralf Corsepius
Subject: Re: Force -O0 flags, inhibit the default -O2 flags
Date: Thu, 29 Sep 2005 16:14:54 +0200

On Thu, 2005-09-29 at 10:44 +0200, Harald Dunkel wrote:
> 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,
No. The autotools are tools to enable users, developers and system
integrators to adapt a package to a particular system's setup.

It's not their task to package a package for you personal setup.

>  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

Simply use:

configure CXXFLAGS="-Wall"

Besides this, -Wall is a GCC proprietary option which will not work with
many compilers. Hardcoding it anywhere inside of a configure.ac or
Makefile.am is simply non portable and is a bug in a packages
configuration.

> 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.
I guess we all agree that this discussion doesn't lead anywhere and that
the autotools apparently are not made for everybody.

Ralf






reply via email to

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