Re: Rethinking -L switch handling and construction of LDFLAGS

2018-04-02 Thread Tom Lane
So here's a draft patch for this. It fixes the originally complained-of issue about --with-libxml breaking the build on Macs. I've not tested it very far beyond that plus a sanity cross-check on Linux, but I doubt there's any point in further manual testing; we might as well just throw it at the

Re: Rethinking -L switch handling and construction of LDFLAGS

2018-04-01 Thread Tom Lane
Andres Freund writes: > On 2018-04-01 13:55:05 -0400, Tom Lane wrote: >> I'm hesitant to do that because LDFLAGS is a name known to make's >> default rules, and I don't want to bet that we're not relying on >> those default rules anywhere. > FWIW, postgres builds cleanly with -r -R in MAKELAGS.

Re: Rethinking -L switch handling and construction of LDFLAGS

2018-04-01 Thread Andres Freund
Hi, On 2018-04-01 13:55:05 -0400, Tom Lane wrote: > > Why don't we change the link commands to reference LDFLAGS_INTERNAL > > explicitly? That seems like it'd be cleaner. > > I'm hesitant to do that because LDFLAGS is a name known to make's > default rules, and I don't want to bet that we're not

Re: Rethinking -L switch handling and construction of LDFLAGS

2018-04-01 Thread Tom Lane
Andres Freund writes: > On 2018-04-01 13:38:15 -0400, Tom Lane wrote: >> I don't have a concrete patch to propose yet, but the design idea >> I have in mind is to split LDFLAGS into two or more parts, so that >> -L switches for the build tree are supposed to be put in the first >> part and externa

Re: Rethinking -L switch handling and construction of LDFLAGS

2018-04-01 Thread Andres Freund
Hi, On 2018-04-01 13:38:15 -0400, Tom Lane wrote: > In short, we need to deal more honestly with the positioning of -L > switches in link commands. Somebody's idea that we could embed > both -L and -l into $(libpq), and then pay basically no attention to > where that ends up in the final link com

Rethinking -L switch handling and construction of LDFLAGS

2018-04-01 Thread Tom Lane
I noticed that if I build with --with-libxml on my Mac platforms, "make installcheck" stops working for certain contrib modules such as postgres_fdw. I finally got around to diagnosing the reason why, and it goes like this: 1. --with-libxml causes configure to include -L/Applications/Xco