aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2013-10-06 22:57:16 -0400
committerAndrew Dunstan <andrew@dunslane.net>2013-10-06 22:57:16 -0400
commit2e1cb733f96cff04f6c9116c166fec54bc1e18c6 (patch)
tree19fdb8d93a492b70c066b6cd5095e2478ce1a1c7 /doc/src
parent7db0dc0eac4512253c2ec0e6bea60ecd2d7bea27 (diff)
downloadpostgresql-2e1cb733f96cff04f6c9116c166fec54bc1e18c6.tar.gz
postgresql-2e1cb733f96cff04f6c9116c166fec54bc1e18c6.zip
Document support for VPATH builds of extensions.
Cédric Villemain and me.
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/extend.sgml29
1 files changed, 28 insertions, 1 deletions
diff --git a/doc/src/sgml/extend.sgml b/doc/src/sgml/extend.sgml
index 60fa1a8922c..5015002aac8 100644
--- a/doc/src/sgml/extend.sgml
+++ b/doc/src/sgml/extend.sgml
@@ -935,7 +935,7 @@ include $(PGXS)
To use the <acronym>PGXS</acronym> infrastructure for your extension,
you must write a simple makefile.
In the makefile, you need to set some variables
- and finally include the global <acronym>PGXS</acronym> makefile.
+ and include the global <acronym>PGXS</acronym> makefile.
Here is an example that builds an extension module named
<literal>isbn_issn</literal>, consisting of a shared library containing
some C code, an extension control file, a SQL script, and a documentation
@@ -1172,6 +1172,33 @@ include $(PGXS)
</caution>
<para>
+ You can also run <literal>make</literal> in a directory outside the source
+ tree of your extension, if you want to keep the build directory separate.
+ This procedure is also called a
+ <indexterm><primary>VPATH</primary></indexterm><firstterm>VPATH</firstterm>
+ build. Here's how:
+ <screen>
+ <userinput>mkdir build_dir</userinput>
+ <userinput>cd build_dir</userinput>
+ <userinput>make -f /path/to/extension/source/tree/Makefile</userinput>
+ <userinput>make -f /path/to/extension/source/tree/Makefile install</userinput>
+ </screen>
+ </para>
+
+ <para>
+ Alternatively, you can set up a directory for a VPATH build in a similar
+ way to how it is done for the core code. One way to to this is using the
+ core script <filename>config/prep_buildtree</>. Once this has been done
+ you can build by setting the <literal>make</literal> variable
+ <varname>USE_VPATH</varname> like this:
+ <screen>
+ <userinput>make USE_VPATH=/path/to/extension/source/tree</userinput>
+ <userinput>make USE_VPATH=/path/to/extension/source/tree install</userinput>
+ </screen>
+ This procedure can work with a greater variety of directory layouts.
+ </para>
+
+ <para>
The scripts listed in the <varname>REGRESS</> variable are used for
regression testing of your module, which can be invoked by <literal>make
installcheck</literal> after doing <literal>make install</>. For this to