Re: PGXS on VPATH?

Lists: pgsql-hackers
From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Hackers <pgsql-hackers(at)postgresql(dot)org>, Fabien COELHO <fabien(at)coelho(dot)net>
Subject: PGXS on VPATH?
Date: 2005-11-02 13:07:11
Message-ID: 20051102130711.GB26495@surnet.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

Is PGXS on VPATH builds supported? I was just testing tsearch2 and it
isn't working. Note that I'm first standing on the builddir and it
doesn't work; then I'm back at the srcdir and it does work.

07:02 jovan tsearch2 2$ pwd
/pgsql/build/00orig/contrib/tsearch2
07:02 jovan tsearch2 0$ LANG=C make USE_PGXS=1
make: *** No rule to make target `tsearch.sql.in', needed by `tsearch2.sql'. Stop.
07:02 jovan tsearch2 2$ cdsrc
07:02 jovan tsearch2 0$ pwd
/pgsql/source/00orig/contrib/tsearch2
07:02 jovan tsearch2 0$ LANG=C make USE_PGXS=1
sed -e 's,MODULE_PATHNAME,$libdir/tsearch2,g' tsearch.sql.in >tsearch2.sql
cp untsearch.sql.in untsearch2.sql
gcc -O2 -Wall -Wmissing-prototypes [...]

--
Alvaro Herrera http://www.amazon.com/gp/registry/CTMLCN8V17R4
"Changing the world ... one keyboard at a time!"
(www.DVzine.org)


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Hackers <pgsql-hackers(at)postgresql(dot)org>, Fabien COELHO <fabien(at)coelho(dot)net>
Subject: Re: PGXS on VPATH?
Date: 2005-11-02 14:16:25
Message-ID: 5096.1130940985@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> writes:
> Is PGXS on VPATH builds supported?

Probably not in the way you're thinking. IIRC pgxs.mk explicitly resets
VPATH, and I think it has to do that because any VPATH embedded in
Makefile.global would represent what was done at the time of building
the PG installation --- which has zip to do with where the PGXS-using
software is located.

It might work to explicitly set VPATH from the make command line:
make USE_PGXS=1 VPATH=whatever
as this should override the assignments in the makefiles.

regards, tom lane


From: Fabien COELHO <fabien(at)coelho(dot)net>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PGXS on VPATH?
Date: 2005-11-07 15:06:16
Message-ID: Pine.LNX.4.64.0511071553550.874@briare.cri.ensmp.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


Dear Alvaro,

sorry for this late response.

>> Is PGXS on VPATH builds supported?
>
> Probably not in the way you're thinking. IIRC pgxs.mk explicitly resets
> VPATH, and I think it has to do that because any VPATH embedded in
> Makefile.global would represent what was done at the time of building
> the PG installation --- which has zip to do with where the PGXS-using
> software is located.
>
> It might work to explicitly set VPATH from the make command line:
> make USE_PGXS=1 VPATH=whatever
> as this should override the assignments in the makefiles.

Indeed.

There were some kind of issue with VPATH so that it was scratched when
building under pgxs.

ifdef PGXS
# We assume that we are in src/makefiles/, so top is ...
top_builddir := $(dir $(PGXS))../..
include $(top_builddir)/src/Makefile.global
top_srcdir = $(top_builddir)
srcdir = .
VPATH =
endif

Maybe something clever could be done with relative VPATHs, or by trying to
translate prefixes? On the other hand, I'm not a VPATH fan;-)

--
Fabien.