From b09c248bdd3d0d86714865d2142604aea789e840 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 26 Jun 2007 22:05:04 +0000 Subject: Fix PGXS conventions so that extensions can be built against Postgres installations whose pg_config program does not appear first in the PATH. Per gripe from Eddie Stanley and subsequent discussions with Fabien Coelho and others. --- doc/src/sgml/xfunc.sgml | 38 ++++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/xfunc.sgml b/doc/src/sgml/xfunc.sgml index de7eed5a6db..0b8860c0c29 100644 --- a/doc/src/sgml/xfunc.sgml +++ b/doc/src/sgml/xfunc.sgml @@ -1,4 +1,4 @@ - + User-Defined Functions @@ -2071,10 +2071,11 @@ MODULES = isbn_issn DATA_built = isbn_issn.sql DOCS = README.isbn_issn -PGXS := $(shell pg_config --pgxs) +PG_CONFIG = pg_config +PGXS := $(shell $(PG_CONFIG) --pgxs) include $(PGXS) - The last two lines should always be the same. Earlier in the + The last three lines should always be the same. Earlier in the file, you assign variables or add custom make rules. @@ -2215,6 +2216,18 @@ include $(PGXS) + + + PG_CONFIG + + + path to pg_config program for the + PostgreSQL installation to build against + (typically just pg_config to use the first one in your + PATH) + + + @@ -2222,13 +2235,26 @@ include $(PGXS) 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 + install to install your module. By default, the extension is compiled and installed for the PostgreSQL installation that - corresponds to the first pg_config command - found in your path. + corresponds to the first pg_config program + found in your path. You can use a different installation by + setting PG_CONFIG to point to its + pg_config program, either within the makefile + or on the make command line. + + + Changing PG_CONFIG only works when building + against PostgreSQL 8.3 or later. + With older releases it does not work to set it to anything except + pg_config; you must alter your PATH + to select the installation to build against. + + + The scripts listed in the REGRESS variable are used for regression testing of your module, just like make -- cgit v1.2.3