1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-08 06:02:22 +03:00

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
This commit is contained in:
Peter Eisentraut
2013-03-31 16:58:40 -04:00
parent 3780fc679c
commit 64f890905f
6 changed files with 62 additions and 3 deletions

View File

@@ -5714,6 +5714,15 @@ cc -o myprog prog1.o prog2.o ... -lecpg
<literal>-L/usr/local/pgsql/lib</literal> to that command line.
</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

View File

@@ -7640,6 +7640,18 @@ CPPFLAGS += -I/usr/local/pgsql/include
</screen>
</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:
@@ -7674,6 +7686,15 @@ cc -o testprog testprog1.o testprog2.o -L/usr/local/pgsql/lib -lpq
</screen>
</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: