automake
[Top][All Lists]
Advanced

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

Re: AM_CFLAGS usage


From: Ralf Wildenhues
Subject: Re: AM_CFLAGS usage
Date: Mon, 12 Jun 2006 12:53:05 +0200
User-agent: Mutt/1.5.11

* Norbert Sendetzky wrote on Mon, Jun 12, 2006 at 11:06:36AM CEST:
> On Monday 12 June 2006 10:28, Ralf Corsepius wrote:
> > > > Note though that
> > > >   -Wall -ansi -pedantic
> > > >
> > > > is pretty GCC specific, and will make many other compilers barf
> > > > heavily.  So if your package targets portability, it'd be nice
> > > > to allow your users to override these flags (preferably by
> > > > ./configure CFLAGS='...').
> > >
> > > How can I do this?
> >
> > NOTE: CFLAGS !!

> Ralf (Wildenhues) refers to OVERRIDING flags set if I understood him 
> correctly.

Yes.  Maybe this should be in a FAQ or so:  you can put
  : ${CFLAGS='-Wall -ansi -pedantic'}

before AC_PROG_CC in configure.ac.  Users with non-GCC compilers won't
like you because they will have to set CFLAGS to override this, and
users (with any kind of compiler) won't like you because you take away
the default (set -g if possible, add -O2 if possible) setting they
expect from packages using Autoconf.  (I first through of
http://lists.gnu.org/archive/html/automake/2005-09/msg00108.html but
that tackles a slightly different problem setting.)

FWIW, I prefer that packages don't override CFLAGS at all.  For specific
settings, I keep a long-term build tree with a working config.status
file (and of course a config.cache as well) around.  Or a config.site
file (if you don't know what this is, read up on it in the Autoconf
manual).

Cheers,
Ralf




reply via email to

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