Re: [HACKERS] Add EXTRA_CFLAGS to configure

2015-11-30 Thread Bruce Momjian
On Wed, Oct 28, 2015 at 01:53:31PM +, Nathan Wagner wrote: > On Wed, Oct 28, 2015 at 02:42:19PM +0100, Robert Haas wrote: > > On Wed, Oct 28, 2015 at 2:17 PM, Andres Freund wrote: > > >> I use COPT for this purpose. > > > > > > Unless I miss something you can't just pass that to configure thou

Re: [HACKERS] Add EXTRA_CFLAGS to configure

2015-10-29 Thread Peter Eisentraut
On 10/28/15 6:55 AM, Andres Freund wrote: > 1) ./configure CFLAGS=... essentially breaks --enable-debug and related >options, If assigning to CFLAGS breaks --enable-debug, then we should fix that by reordering things a bit. > overwrites -O2 as the default and such. That's imo pretty >conf

Re: [HACKERS] Add EXTRA_CFLAGS to configure

2015-10-28 Thread Tom Lane
Andres Freund writes: > On 2015-10-28 11:42:28 -0400, Tom Lane wrote: >> 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 >>

Re: [HACKERS] Add EXTRA_CFLAGS to configure

2015-10-28 Thread Andres Freund
On 2015-10-28 11:42:28 -0400, Tom Lane wrote: > 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 no

Re: [HACKERS] Add EXTRA_CFLAGS to configure

2015-10-28 Thread Tom Lane
Andres Freund writes: > On 2015-10-28 09:36:39 -0400, Tom Lane wrote: >> Andres Freund writes: >>> 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

Re: [HACKERS] Add EXTRA_CFLAGS to configure

2015-10-28 Thread Andres Freund
On 2015-10-28 09:36:39 -0400, Tom Lane wrote: > Andres Freund 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 -O

Re: [HACKERS] Add EXTRA_CFLAGS to configure

2015-10-28 Thread Nathan Wagner
On Wed, Oct 28, 2015 at 02:42:19PM +0100, Robert Haas wrote: > On Wed, Oct 28, 2015 at 2:17 PM, Andres Freund wrote: > >> I use COPT for this purpose. > > > > Unless I miss something you can't just pass that to configure though, > > right? I.e. it has to be passed to each make invocation? > > Wha

Re: [HACKERS] Add EXTRA_CFLAGS to configure

2015-10-28 Thread Robert Haas
On Wed, Oct 28, 2015 at 2:17 PM, Andres Freund wrote: >> I use COPT for this purpose. > > Unless I miss something you can't just pass that to configure though, > right? I.e. it has to be passed to each make invocation? What I do is: echo COPT=-Wall -Werror > src/Makefile.custom -- Robert Haas

Re: [HACKERS] Add EXTRA_CFLAGS to configure

2015-10-28 Thread Tom Lane
Andres Freund 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 >confusin

Re: [HACKERS] Add EXTRA_CFLAGS to configure

2015-10-28 Thread Andres Freund
On 2015-10-28 12:20:22 +0100, Robert Haas wrote: > On Wed, Oct 28, 2015 at 11:55 AM, Andres Freund wrote: > > 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

Re: [HACKERS] Add EXTRA_CFLAGS to configure

2015-10-28 Thread Robert Haas
On Wed, Oct 28, 2015 at 11:55 AM, Andres Freund wrote: > 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 suc

[HACKERS] Add EXTRA_CFLAGS to configure

2015-10-28 Thread Andres Freund
Hi, 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 p