From adf57cd7e2dca8ded31645e2f2b2deb5e4515c83 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Fri, 30 Jul 2004 12:26:40 +0000 Subject: PostgreSQL extension makefile framework ("pgxs"), by Fabien Coelho, with some massaging by Peter Eisentraut. This is basically a simple generalization of the existing contrib makefiles. --- doc/src/sgml/xfunc.sgml | 195 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 194 insertions(+), 1 deletion(-) (limited to 'doc/src') diff --git a/doc/src/sgml/xfunc.sgml b/doc/src/sgml/xfunc.sgml index 6ec5836047b..2f99f062b53 100644 --- a/doc/src/sgml/xfunc.sgml +++ b/doc/src/sgml/xfunc.sgml @@ -1,5 +1,5 @@ @@ -1610,6 +1610,199 @@ concat_text(PG_FUNCTION_ARGS) &dfunc; + + Extension build infrastructure + + + pgxs + + + + If you are thinking about distributing your PostgreSQL extension + modules, setting up a portable build system for them can be fairly + difficult. Therefore the PostgreSQL installation provides a build + infrastructure for extensions, called PGXS, so + that simple extension modules can be built simply against an + already installed server. Note that this infrastructure is not + intended to be a universal build system framework that can be used + to build all software interfacing to PostgreSQL; it simply + automates common build rules for simple server extension modules. + For more complicated packages, you need to write your own build + system. + + + + To use the infrastructure for your extension, you must write a + simple makefile. In that makefile, you need to set some variables + and finally include the global PGXS makefile. + Here is an example that builds an extension module named + isbn_issn consisting of a shared library, an + SQL script, and a documentation text file: + +MODULES = isbn_issn +DATA_built = isbn_issn.sql +DOCS = README.isbn_issn + +PGXS := $(shell pg_config --pgxs) +include $(PGXS) + + The last two lines should always be the same. Earlier in the + file, you assign variables or add custom + make rules. + + + + The following variables can be set: + + + + MODULES + + + list of shared objects to be build from source file with same + stem (do not include suffix in this list) + + + + + + DATA + + + random files to install into prefix/share/contrib + + + + + + DATA_built + + + random files to install into + prefix/share/contrib, + which need to be built first + + + + + + DOCS + + + random files to install under + prefix/doc/contrib + + + + + + SCRIPTS + + + script files (not binaries) to install into + prefix/bin + + + + + + SCRIPTS_built + + + script files (not binaries) to install into + prefix/bin, + which need to be built first + + + + + + REGRESS + + + list of regression test cases (without suffix) + + + + + + or at most one of these two: + + + + PROGRAM + + + a binary program to build (list objects files in OBJS) + + + + + + MODULE_big + + + a shared object to build (list object files in OBJS) + + + + + + The following can also be set: + + + + + EXTRA_CLEAN + + + extra files to remove in make clean + + + + + + PG_CPPFLAGS + + + will be added to CPPFLAGS + + + + + + PG_LIBS + + + will be added to PROGRAM link line + + + + + + SHLIB_LINK + + + will be added to MODULE_big link line + + + + + + + + Put this makefile as Makefile in the directory + which holds your extension. Then you can do + make to compile, and later make + install to install your module. The extension is + compiled and installed for the + PostgreSQL installation that + corresponds to the first pg_config command + found in your path. + + + + Composite-Type Arguments in C-Language Functions -- cgit v1.2.3