pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: dpa-postgres@aegee.org
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #14217: Respect $CFLAGS from /usr/local/etc/config.site
Date: Tue, 28 Jun 2016 11:33:09 -0400
Message-ID: <20160628153309.GA23675@alvherre.pgsql> (raw)
In-Reply-To: <20160628090414.17235.40306@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

dpa-postgres@aegee.org wrote:
> The following bug has been logged on the website:
> 
> Bug reference:      14217
> Logged by:          Dilian Palauzov
> Email address:      dpa-postgres@aegee.org
> PostgreSQL version: 9.6beta2
> Operating system:   Linux
> Description:        
> 
> configure generated by Autoconf loads the file $prefix/etc/config.site and
> if CFLAGS is defined there, its value is used when building the project.
> 
> Because in postgresql configure.in contains on line 400 "unset CFLAGS" the
> value of $CFLAGS from config.site is discarded when building postgresql,
> contrary to $LDFLAGS from config.site.

This report is correct; we're not doing the right thing here.  The
autoconf manual explicitely says:

	Site files are also good places to set default values for other output
	variables, such as CFLAGS, if you need to give them non-default values:
	anything you would normally do, repetitively, on the command line. If
	you use non-default values for prefix or exec_prefix (wherever you
	locate the site file), you can set them in the site file if you specify
	it with the CONFIG_SITE environment variable.
https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Site-Defaults.html

The way it works today completely ignores settings in config.site, which is
clearly bogus per the above manual, but I doubt that blanket removal of the
"unset" is the right solution.  The line was added by this commit:

commit 801427abc2924195b35be19abe4f64dbbea82263
Author:     Peter Eisentraut <peter_e@gmx.net>
AuthorDate: Sat Nov 1 20:48:51 2003 +0000
CommitDate: Sat Nov 1 20:48:51 2003 +0000

    Unset CFLAGS before reading template.  This should be more robust.
    
    When --enable-debug is used, then the default CFLAGS for non-GCC is just
    -g without -O.
    
    Backpatch enhancement of Autoconf inline test that detects problems with
    the HP C compiler.


-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (5+ messages)  latest in thread

Message-ID: <20160628153309.GA23675@alvherre.pgsql>
Permalink:  ../20160628153309.GA23675@alvherre.pgsql/
Also on:    postgresql.org/message-id/20160628153309.GA23675@alvherre.pgsql

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: alvherre@2ndquadrant.com, dpa-postgres@aegee.org
  Subject: Re: BUG #14217: Respect $CFLAGS from /usr/local/etc/config.site
  In-Reply-To: <20160628153309.GA23675@alvherre.pgsql>
  References: <20160628090414.17235.40306@wrigleys.postgresql.org> <20160628153309.GA23675@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox