summaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2007-06-26 22:05:04 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2007-06-26 22:05:04 +0000
commitb09c248bdd3d0d86714865d2142604aea789e840 (patch)
tree382d314f0df7e8cd877d8d0e554c199c24833b36 /doc/src
parent80f3b5ad2e294b16f1c179a8c6cde98ee5fb3a53 (diff)
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.
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/xfunc.sgml38
1 files changed, 32 insertions, 6 deletions
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 @@
-<!-- $PostgreSQL: pgsql/doc/src/sgml/xfunc.sgml,v 1.128 2007/06/06 23:00:36 tgl Exp $ -->
+<!-- $PostgreSQL: pgsql/doc/src/sgml/xfunc.sgml,v 1.129 2007/06/26 22:05:04 tgl Exp $ -->
<sect1 id="xfunc">
<title>User-Defined Functions</title>
@@ -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)
</programlisting>
- 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
<application>make</application> rules.
</para>
@@ -2215,6 +2216,18 @@ include $(PGXS)
</para>
</listitem>
</varlistentry>
+
+ <varlistentry>
+ <term><varname>PG_CONFIG</varname></term>
+ <listitem>
+ <para>
+ path to <application>pg_config</> program for the
+ <productname>PostgreSQL</productname> installation to build against
+ (typically just <literal>pg_config</> to use the first one in your
+ <varname>PATH</>)
+ </para>
+ </listitem>
+ </varlistentry>
</variablelist>
</para>
@@ -2222,13 +2235,26 @@ include $(PGXS)
Put this makefile as <literal>Makefile</literal> in the directory
which holds your extension. Then you can do
<literal>make</literal> to compile, and later <literal>make
- install</literal> to install your module. The extension is
+ install</literal> to install your module. By default, the extension is
compiled and installed for the
<productname>PostgreSQL</productname> installation that
- corresponds to the first <command>pg_config</command> command
- found in your path.
+ corresponds to the first <command>pg_config</command> program
+ found in your path. You can use a different installation by
+ setting <varname>PG_CONFIG</varname> to point to its
+ <command>pg_config</command> program, either within the makefile
+ or on the <literal>make</literal> command line.
</para>
+ <caution>
+ <para>
+ Changing <varname>PG_CONFIG</varname> only works when building
+ against <productname>PostgreSQL</productname> 8.3 or later.
+ With older releases it does not work to set it to anything except
+ <literal>pg_config</>; you must alter your <varname>PATH</>
+ to select the installation to build against.
+ </para>
+ </caution>
+
<para>
The scripts listed in the <varname>REGRESS</> variable are used for
regression testing of your module, just like <literal>make