From 64f890905f3a5186bc4df980c8becfda5c39c2ea Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Sun, 31 Mar 2013 16:58:40 -0400 Subject: 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 --- doc/src/sgml/ecpg.sgml | 9 +++++++++ doc/src/sgml/libpq.sgml | 21 +++++++++++++++++++++ 2 files changed, 30 insertions(+) (limited to 'doc/src') 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 @@ -5714,6 +5714,15 @@ cc -o myprog prog1.o prog2.o ... -lecpg -L/usr/local/pgsql/lib to that command line. + + You can + use pg_configpg_configwith + ecpg + or pkg-configpkg-configwith + ecpg with package name libecpg to + get the paths for your installation. + + If you manage the build process of a larger project using make, it might be convenient to include 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 @@ -7640,6 +7640,18 @@ CPPFLAGS += -I/usr/local/pgsql/include + + If you + have pkg-configpkg-configwith + libpq installed, you can run instead: + +$ pkg-config --cflags libpq +-I/usr/local/include + + Note that this will already include the in front of + the path. + + 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 + + Or again use pkg-config: + +$ pkg-config --libs libpq +-L/usr/local/pgsql/lib -lpq + + Note again that this prints the full options, not only the path. + + Error messages that point to problems in this area could look like the following: -- cgit v1.2.3