Thread: pgsql: Improve support for building PGXS modules with VPATH.
Improve support for building PGXS modules with VPATH. A VPATH build will be performed when the module's make file path is not the current directory or when USE_VPATH is set. This will assist packagers and others who prefer to build without polluting the source directories. There is still a bit of work to do here, notably documentation, but it's probably a good idea to commit what we have so far and let people test it out on their modules. Cédric Villemain, with an addition from me. Branch ------ master Details ------- http://git.postgresql.org/pg/commitdiff/6697aa2bc25c83b88d6165340348a31328c35de6 Modified Files -------------- src/Makefile.global.in | 12 ++++++++++- src/makefiles/pgxs.mk | 56 ++++++++++++++++++++++++++++++++---------------- 2 files changed, 49 insertions(+), 19 deletions(-)
Andrew Dunstan wrote: > Improve support for building PGXS modules with VPATH. > > A VPATH build will be performed when the module's make file path is not > the current directory or when USE_VPATH is set. So what's the USE_VPATH thing for? I mean, can't you just use VPATH instead? -- Álvaro Herrera http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services
On 07/01/2013 01:39 PM, Alvaro Herrera wrote: > Andrew Dunstan wrote: >> Improve support for building PGXS modules with VPATH. >> >> A VPATH build will be performed when the module's make file path is not >> the current directory or when USE_VPATH is set. > So what's the USE_VPATH thing for? I mean, can't you just use VPATH > instead? > Well, I was distinguishing between things set by the Makefile and things set outisde, but you're probably right. I'll test it and tweak. cheers andrew
On 07/01/2013 02:40 PM, Andrew Dunstan wrote: > > On 07/01/2013 01:39 PM, Alvaro Herrera wrote: >> Andrew Dunstan wrote: >>> Improve support for building PGXS modules with VPATH. >>> >>> A VPATH build will be performed when the module's make file path is not >>> the current directory or when USE_VPATH is set. >> So what's the USE_VPATH thing for? I mean, can't you just use VPATH >> instead? >> > > Well, I was distinguishing between things set by the Makefile and > things set outisde, but you're probably right. I'll test it and tweak. > > Actually, when I try to get rid of it I get issues with srcdir being recursively defined. And in fact, VPATH is defined by Makefile.global when the Postgres build is a VPATH build, and unrelated to the module's build setup. So I think it's probably best to leave this as it is unless you can suggest an easy fix. cheers andrew
Le lundi 1 juillet 2013 21:22:55, Andrew Dunstan a écrit : > On 07/01/2013 02:40 PM, Andrew Dunstan wrote: > > On 07/01/2013 01:39 PM, Alvaro Herrera wrote: > >> Andrew Dunstan wrote: > >>> Improve support for building PGXS modules with VPATH. > >>> > >>> A VPATH build will be performed when the module's make file path is not > >>> the current directory or when USE_VPATH is set. > >> > >> So what's the USE_VPATH thing for? I mean, can't you just use VPATH > >> instead? > > > > Well, I was distinguishing between things set by the Makefile and > > things set outisde, but you're probably right. I'll test it and tweak. > > Actually, when I try to get rid of it I get issues with srcdir being > recursively defined. As for VPATH, the srcdir was previously hard-coded, the patch just improve most of the use cases by setting a more appropriate value.. > And in fact, VPATH is defined by Makefile.global when the Postgres build > is a VPATH build, and unrelated to the module's build setup. pgxs.mk already (I mean before the last commit) set VPATH, the patch around that just try to fix it to be correct instead of hardcoded to NULL.. What's in Makefile.global is not be affected. -- Cédric Villemain +33 (0)6 20 30 22 52 http://2ndQuadrant.fr/ PostgreSQL: Support 24x7 - Développement, Expertise et Formation
Attachment
On 07/01/2013 05:13 PM, Cédric Villemain wrote: > Le lundi 1 juillet 2013 21:22:55, Andrew Dunstan a écrit : >> On 07/01/2013 02:40 PM, Andrew Dunstan wrote: >>> On 07/01/2013 01:39 PM, Alvaro Herrera wrote: >>>> Andrew Dunstan wrote: >>>>> Improve support for building PGXS modules with VPATH. >>>>> >>>>> A VPATH build will be performed when the module's make file path is not >>>>> the current directory or when USE_VPATH is set. >>>> So what's the USE_VPATH thing for? I mean, can't you just use VPATH >>>> instead? >>> Well, I was distinguishing between things set by the Makefile and >>> things set outisde, but you're probably right. I'll test it and tweak. >> Actually, when I try to get rid of it I get issues with srcdir being >> recursively defined. > As for VPATH, the srcdir was previously hard-coded, the patch just improve > most of the use cases by setting a more appropriate value.. > >> And in fact, VPATH is defined by Makefile.global when the Postgres build >> is a VPATH build, and unrelated to the module's build setup. > pgxs.mk already (I mean before the last commit) set VPATH, the patch around > that just try to fix it to be correct instead of hardcoded to NULL.. What's in > Makefile.global is not be affected. Well, it is to the extent that something set there is changed afterwards in pgxs.mk. Anyway, I think I have a good handle on what's going on, and w.r.t. Alvaro's question, we need to leave things as they are. cheers andrew