Andres Freund <and...@anarazel.de> writes:
> On 2015-10-28 09:36:39 -0400, Tom Lane wrote:
>> Andres Freund <and...@anarazel.de> writes:
>>> 1) ./configure CFLAGS=... essentially breaks --enable-debug and related
>>> options, overwrites -O2 as the default and such. That's imo pretty
>>> 2) I like to be able to pass -Werror or something to configure without
>>> breaking a bunch of configure tests that won't work with Werror.
>> I would be rather surprised if such a switch didn't affect the flags used
>> by configure itself, so your point (2) seems like it would require nasty
> Hm, I don't find it that inconsistent to say that configure itself uses
> CFLAGS but not EXTRA_CFLAGS (or whatever).
Well, it is. In particular, you could easily shoot yourself in the foot
this way, for example by passing some semantically relevant switch like
"-m64" in the wrong set of flags.
In view of your point (1), I'd be okay with inventing an EXTRA_CFLAGS
argument that is added to, rather than replacing, the automatically
computed flags. But I think that configure must include such flags
for its own compile runs, else it is not testing the true build
environment and might get wrong answers.
Is -Werror the only practical case where we need configure to *not* see
a flag that should otherwise be applied? If so, maybe we should just
attack that problem directly and narrowly. I can think of at least
1. Invent a "--with-werror" configure switch that causes -Werror to be
added to the CFLAGS, but not while running tests that it'd break.
2. Explicitly filter -Werror out of the user-provided CFLAGS while running
tests that it'd break.
regards, tom lane
Sent via pgsql-hackers mailing list (email@example.com)
To make changes to your subscription: