This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: use CPPFLAGS at configure time
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: Roland McGrath <roland at redhat dot com>
- Cc: libc-alpha at sources dot redhat dot com
- Date: 03 Apr 2003 23:57:33 -0300
- Subject: Re: use CPPFLAGS at configure time
- Organization: GCC Team, Red Hat
- References: <200304040245.h342jHJ16232@magilla.sf.frob.com>
On Apr 3, 2003, Roland McGrath <roland at redhat dot com> wrote:
>> Yeah, it doesn't *have* to be used for .s files, but it's not like it
>> hurts either, especially at configure time.
> The makefiles do not use CPPFLAGS when compiling .s files.
> What configure does should always match what the build will do.
Precisely, CPPFLAGS is not propagated to the Makefiles. That's a bug,
but not the bug I'm trying to fix here.
The bug I'm trying to fix here is that C compiles, and even
preprocessing, aren't always using CPPFLAGS in the configure tests. I
just figured it wouldn't hurt to pass CPPFLAGS to assemble tests as
well. If you'd better append CPPFLAGS to CFLAGS, null it out, and be
done with it, fine. But failing to use CPPFLAGS in some cases, while
using it in others, is a more serious bug.
>> If this patch can't go in, I'll have to switch to CFLAGS, duplicating
>> autoconf's logic for a default CFLAGS, which I'd rather not do.
> What I recommend is setting CC to include all the options essential for
> correct target selection.
This also means overriding autoconf's guessing of CC, which is even
more convoluted.
Unfortunately, my original patch, with a set of flags that was
appended to $CC after $CC was guessed by autoconf, was rejected as
well.
I'm out of options.
If you'll reconsider the patch that I had tried to get approved at
first, that created a new variable whose contents would be added to CC
after AC_PROG_CC, I'd much rather use that.
> It is conventional for CFLAGS to specify things like -g and -O*,
> which are preferences about what to do rather than specifications
> about the spec to which the output will comply.
The convention is actually that:
$CC $CPPFLAGS $CFLAGS is used to preprocess, compile and assemble
$CC $CPPFLAGS $CFLAGS $LDFLAGS ... $LIBS is used to link
glibc fails to follow this standard in a number of ways. I'm not
trying to fix all of these problems, just one minor piece of the
problem.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva at {redhat dot com, gcc.gnu.org}
CS PhD student at IC-Unicamp oliva at {lsd dot ic dot unicamp dot br, gnu.org}
Free Software Evangelist Professional serial bug killer