Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bHvYh-0002e4-7V for pgsql-bugs@arkaria.postgresql.org; Tue, 28 Jun 2016 16:08:19 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bHvYg-0006kZ-N2 for pgsql-bugs@arkaria.postgresql.org; Tue, 28 Jun 2016 16:08:18 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bHvYf-0006hI-A5 for pgsql-bugs@postgresql.org; Tue, 28 Jun 2016 16:08:17 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bHvYc-0008F5-OA for pgsql-bugs@postgresql.org; Tue, 28 Jun 2016 16:08:16 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u5SG5hZA021139; Tue, 28 Jun 2016 12:05:43 -0400 From: Tom Lane To: Alvaro Herrera cc: dpa-postgres@aegee.org, Peter Eisentraut , pgsql-bugs@postgresql.org Subject: Re: BUG #14217: Respect $CFLAGS from /usr/local/etc/config.site In-reply-to: <20160628153309.GA23675@alvherre.pgsql> References: <20160628153309.GA23675@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Tue, 28 Jun 2016 11:33:09 -0400" Date: Tue, 28 Jun 2016 12:05:43 -0400 Message-ID: <21138.1467129943@sss.pgh.pa.us> X-Pg-Spam-Score: -3.2 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Alvaro Herrera writes: > dpa-postgres@aegee.org wrote: >> 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. > 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. I think the thing we'd have to work out is what's the proper interaction between the template files and the config.site file. It's worth noting that most of the cases where template files set CFLAGS are when we've detected a non-default compiler. In such cases, it's not exactly clear to me that honoring CFLAGS from config.site would be helpful, as such a setting probably is meant for the default compiler. Another point here is that any setting coming from config.site is presumably not going to vary in response to --enable-debug, which could be problematic, especially so for non-gcc compilers. Also, it looks to me like the autoconf script will fail outright if config.site specifies CFLAGS and the user has tried to specify a different CFLAGS in the environment or command line --- see the logic that checks for cache file corruption. In short, I'm pretty dubious about the utility of this feature, which may explain why nobody has complained about our current behavior for over a dozen years. Still, it *is* inconsistent that we are only discarding CFLAGS and not other variables that might come from such a file. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs