Re: pgxs: build infrastructure for extensions v1

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: pgxs: build infrastructure for extensions v1
Date: 2004-06-07 13:42:27
Message-ID: 200406071342.i57DgRK25207@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches


Have folks looked this over? Is this the direction we want to go?

---------------------------------------------------------------------------

Fabien COELHO wrote:
>
> Dear patchers,
>
>
> Please find attached a patch which provides a working infrastructure for
> pg extensions such as new gist-based indexes, functions, types...
>
> The infrastructure is a simple reworking of the already available internal
> infrastructure for contrib, so that it can be used outside of the
> postgresql source tree after installation, without gory details being in
> sight of the user...
>
> As a test case and show how, I provided new Makefile.pgxs for most contrib
> subdirectories. After postgresql has been configure, compiled and
> installed, simply try them with:
>
> "cd contrib/foo ; make -f Makefile.pgxs install"
>
>
> BEWARE: The patch does not include an update of "configure", as I do not
> have the same version of "autoconf". So configure must be regenerated:
> "autoconf configure.in > configure"
>
> There is an initial documentation in "pgxs.sgml".
>
>
> How it works:
>
> - necessary files (includes, scripts, makefiles...) are copied in lib/build
> on the initial "make install". The adds 2MB of stuff. The former
> installation can be obtained with "make light-install", but then
> no extensions could be added to the installation, so this is more for
> packagers that would like to provide a separate -dev package, IMHO.
>
> Due to gnu-make restriction on how its includes work, these files must
> be copied with the same directory structure as the pg source tree.
> The fact does not appear at all in the actual infrastructure from the
> user point of view, but it explains why subdirectories are necessary
> under the build subdir...
>
> - the makefile of any extension is expected to set macro PGXS to
> "pg_config --pgxs", to include a special pgxs.mk makefile, and to
> set some macros depending on what is to be built, just like in
> current contrib. See the examples under contrib.
>
> - I've added two PGXS-triggered conditionnals in Makefile.global,
> so that includes and libraries are taken where needed...
>
>
> It works for me.
>
>
> Questions and thoughts:
>
> - maybe more files should be copied? if so, which ones?
>
> - should this actually replace the current "contrib" infrastructure?
>
> I would tend to say "yes"... that would require to replace all makefiles
> there by the Makefile.pgxs version, to remove "contrib-global.mk", and
> also possibly to update some documentations.
>
> - more documentation?
> integration of the documentation wrt pg doc?
>
> - validation? one could thing of installing some contribs
> when "make check" is performed, so as to validate that the
> extension infrastructure is not broken?
>
>
> Have a nice day,
>
>
> --
> Fabien Coelho - coelho(at)cri(dot)ensmp(dot)fr

Content-Description:

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2004-06-07 14:37:11 Re: pgxs: build infrastructure for extensions v1
Previous Message Andreas Pflug 2004-06-07 08:08:35 Re: Int2 vector to array equality