aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2013-03-31 16:58:40 -0400
committerPeter Eisentraut <peter_e@gmx.net>2013-03-31 16:58:40 -0400
commit64f890905f3a5186bc4df980c8becfda5c39c2ea (patch)
tree45202e54e45a1bbb78fb9446c4b7f2682b4c6300 /doc/src
parent3780fc679cc428c1f211e1728c4281ca15e9746b (diff)
downloadpostgresql-64f890905f3a5186bc4df980c8becfda5c39c2ea.tar.gz
postgresql-64f890905f3a5186bc4df980c8becfda5c39c2ea.zip
Add pkg-config files for libpq and ecpg libraries
This will hopefully be easier to use than pg_config for users who are already used to the pkg-config interface. It also works better for multi-arch installations. reviewed by Tom Lane
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/ecpg.sgml9
-rw-r--r--doc/src/sgml/libpq.sgml21
2 files changed, 30 insertions, 0 deletions
diff --git a/doc/src/sgml/ecpg.sgml b/doc/src/sgml/ecpg.sgml
index 4d904cdeb88..68bcb13ca04 100644
--- a/doc/src/sgml/ecpg.sgml
+++ b/doc/src/sgml/ecpg.sgml
@@ -5715,6 +5715,15 @@ cc -o myprog prog1.o prog2.o ... -lecpg
</para>
<para>
+ You can
+ use <command>pg_config</command><indexterm><primary>pg_config</primary><secondary sortas="ecpg">with
+ ecpg</secondary></indexterm>
+ or <command>pkg-config</command><indexterm><primary>pkg-config</primary><secondary sortas="ecpg">with
+ ecpg</secondary></indexterm> with package name <literal>libecpg</literal> to
+ get the paths for your installation.
+ </para>
+
+ <para>
If you manage the build process of a larger project using
<application>make</application>, it might be convenient to include
the following implicit rule to your makefiles:
diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml
index 1a09c1cb8da..3b6ada08f7c 100644
--- a/doc/src/sgml/libpq.sgml
+++ b/doc/src/sgml/libpq.sgml
@@ -7641,6 +7641,18 @@ CPPFLAGS += -I/usr/local/pgsql/include
</para>
<para>
+ If you
+ have <command>pkg-config</command><indexterm><primary>pkg-config</primary><secondary sortas="libpq">with
+ libpq</secondary></indexterm> installed, you can run instead:
+<screen>
+<prompt>$</prompt> pkg-config --cflags libpq
+<computeroutput>-I/usr/local/include</computeroutput>
+</screen>
+ Note that this will already include the <option>-I</option> in front of
+ the path.
+ </para>
+
+ <para>
Failure to specify the correct option to the compiler will
result in an error message such as:
<screen>
@@ -7675,6 +7687,15 @@ cc -o testprog testprog1.o testprog2.o -L/usr/local/pgsql/lib -lpq
</para>
<para>
+ Or again use <command>pkg-config</command>:
+<screen>
+<prompt>$</prompt> pkg-config --libs libpq
+<computeroutput>-L/usr/local/pgsql/lib -lpq</computeroutput>
+</screen>
+ Note again that this prints the full options, not only the path.
+ </para>
+
+ <para>
Error messages that point to problems in this area could look like
the following:
<screen>