Re: Add EXTRA_CFLAGS to configure - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Add EXTRA_CFLAGS to configure
Date
Msg-id 20151028142620.GI29811@alap3.anarazel.de
Whole thread Raw
In response to Re: Add EXTRA_CFLAGS to configure  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Add EXTRA_CFLAGS to configure  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 2015-10-28 09:36:39 -0400, Tom Lane wrote:
> Andres Freund <andres@anarazel.de> writes:
> > I rather regularly want to pass extra flags to configure without
> > overwriting CFLAGS. There's two basic reasons:
> 
> > 1) ./configure CFLAGS=... essentially breaks --enable-debug and related
> >    options, overwrites -O2 as the default and such. That's imo pretty
> >    confusing.
> > 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
> inconsistency.

Hm, I don't find it that inconsistent to say that configure itself uses
CFLAGS but not EXTRA_CFLAGS (or whatever).

> Why don't you just edit Makefile.global after configure finishes?

I personally do, and it's not a problem for me because I call configure
and everything from scripts anyway. But it's harder to to tell people
that. It's e.g. much easier to tell people that they should add one
argument to configure to specify -fno-omit-frame-pointer rather than
having to create Makefile.custom or something like that.

Makefile.custom doesn't, afaik, won't forward the cflags to PGXS built
extensions. Which then is annoying for flags like
-fno-omit-frame-pointer.

> Or use COPT or PROFILE?

If we'd persist COPT or PROFILE when specified for configure that'd work
for me as well.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: a raft of parallelism-related bug fixes
Next
From: Bill Moran
Date:
Subject: Is there any ordering to the values in guc.c?