Re: PostgreSQL 9.3 beta breaks some extensions "make install"

From: Cédric Villemain <cedric(at)2ndquadrant(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Christoph Berg <myon(at)debian(dot)org>, Peter Eisentraut <peter_e(at)gmx(dot)net>
Subject: Re: PostgreSQL 9.3 beta breaks some extensions "make install"
Date: 2013-06-02 13:53:31
Message-ID: 201306021553.35477.cedric@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Le mardi 28 mai 2013 15:15:55, Cédric Villemain a écrit :
> Le samedi 25 mai 2013 16:41:24, Cédric Villemain a écrit :
> > > > If it seems to be on the right way, I'll keep fixing EXTENSION
> > > > building with VPATH.
> > >
> > > I haven't tried the patch, but let me just say that Debian (and
> > > apt.postgresql.org) would very much like the VPATH situation getting
> > > improved. At the moment we seem to have to invent a new build recipe
> > > for every extension around.
>
> Attached patch adds support for VPATH with USE_PGXS
> It just change recipe for install: in pgxs.mk.
>
> I am unsure automatic variables can be used this way with all UNIX
> variation of make...
>
> I also didn't touch MODULE and PROGRAM (yet)

This patch can also be seen as a bugfix.
The problem is that in case like this one:
===
FOO=bar.control
installcontrol: $(FOO)
$(INSTALL_DATA) $(FOO) \
'$(DESTDIR)$(datadir)/extension/'
===

INSTALL_DATA will install the file defined by FOO (=bar.control).

But in the next case (the fix):
===
FOO=bar.control
installcontrol: $(FOO)
$(INSTALL_DATA) $< '$(DESTDIR)$(datadir)/extension/'
===

the $< contains the *filepath* where 'make' found the FOO file.
I believe it is because recipes are read once target and prerequisite are set,
so $< contains the full path to FOO, but FOO will still contain exactly what
has been assigned to FOO.

I choose to add targets for the variables that can be set when using PGXS. And
say 'install:' target to depends on each.

Maybe there is a smarter way to do it... my skills in Makefile are limited.

So far the feedback is good for the set of patches: pg_buildext (the debian
postgresql builder tool) is still working as expected and can be simplified. I
can build each contrib provided with PostgreSQL and some others have been
tried (like plr).
IMHO this is mostly bugfixing and it just outline that we can support VPATH and
PGXS build at the same time.

--
Cédric Villemain +33 (0)6 20 30 22 52
http://2ndQuadrant.fr/
PostgreSQL: Support 24x7 - Développement, Expertise et Formation

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2013-06-02 17:14:38 Re: [PATCH] pg_isready (was: [WIP] pg_ping utility)
Previous Message Cédric Villemain 2013-06-02 10:56:25 Re: PostgreSQL 9.3 beta breaks some extensions "make install"