2 doc/src/sgml/ref/pg_config-ref.sgml
3 PostgreSQL documentation
6 <refentry id=
"app-pgconfig">
7 <indexterm zone=
"app-pgconfig">
8 <primary>pg_config
</primary>
12 <refentrytitle><application>pg_config
</application></refentrytitle>
13 <manvolnum>1</manvolnum>
14 <refmiscinfo>Application
</refmiscinfo>
18 <refname>pg_config
</refname>
19 <refpurpose>retrieve information about the installed version of
<productname>PostgreSQL
</productname></refpurpose>
24 <command>pg_config
</command>
25 <arg rep=
"repeat"><replaceable>option
</replaceable></arg>
30 <title>Description
</title>
32 The
<application>pg_config
</application> utility prints configuration parameters
33 of the currently installed version of
<productname>PostgreSQL
</productname>. It is
34 intended, for example, to be used by software packages that want to interface
35 to
<productname>PostgreSQL
</productname> to facilitate finding the required header files
42 <title>Options
</title>
45 To use
<application>pg_config
</application>, supply one or more of the following
49 <term><option>--bindir
</option></term>
52 Print the location of user executables. Use this, for example, to find
53 the
<command>psql
</command> program. This is normally also the location
54 where the
<filename>pg_config
</filename> program resides.
60 <term><option>--docdir
</option></term>
63 Print the location of documentation files.
69 <term><option>--htmldir
</option></term>
72 Print the location of HTML documentation files.
78 <term><option>--includedir
</option></term>
81 Print the location of C header files of the client interfaces.
87 <term><option>--pkgincludedir
</option></term>
90 Print the location of other C header files.
96 <term><option>--includedir-server
</option></term>
99 Print the location of C header files for server programming.
105 <term><option>--libdir
</option></term>
108 Print the location of object code libraries.
114 <term><option>--pkglibdir
</option></term>
117 Print the location of dynamically loadable modules, or where
118 the server would search for them. (Other
119 architecture-dependent data files might also be installed in this
126 <term><option>--localedir
</option></term>
129 Print the location of locale support files. (This will be an empty
130 string if locale support was not configured when
131 <productname>PostgreSQL
</productname> was built.)
137 <term><option>--mandir
</option></term>
140 Print the location of manual pages.
146 <term><option>--sharedir
</option></term>
149 Print the location of architecture-independent support files.
155 <term><option>--sysconfdir
</option></term>
158 Print the location of system-wide configuration files.
164 <term><option>--pgxs
</option></term>
167 Print the location of extension makefiles.
173 <term><option>--configure
</option></term>
176 Print the options that were given to the
<filename>configure
</filename>
177 script when
<productname>PostgreSQL
</productname> was configured for building.
178 This can be used to reproduce the identical configuration, or
179 to find out with what options a binary package was built. (Note
180 however that binary packages often contain vendor-specific custom
181 patches.) See also the examples below.
187 <term><option>--cc
</option></term>
190 Print the value of the
<varname>CC
</varname> variable that was used for building
191 <productname>PostgreSQL
</productname>. This shows the C compiler used.
197 <term><option>--cppflags
</option></term>
200 Print the value of the
<varname>CPPFLAGS
</varname> variable that was used for building
201 <productname>PostgreSQL
</productname>. This shows C compiler switches needed
202 at preprocessing time (typically,
<literal>-I
</literal> switches).
208 <term><option>--cflags
</option></term>
211 Print the value of the
<varname>CFLAGS
</varname> variable that was used for building
212 <productname>PostgreSQL
</productname>. This shows C compiler switches.
218 <term><option>--cflags_sl
</option></term>
221 Print the value of the
<varname>CFLAGS_SL
</varname> variable that was used for building
222 <productname>PostgreSQL
</productname>. This shows extra C compiler switches
223 used for building shared libraries.
229 <term><option>--ldflags
</option></term>
232 Print the value of the
<varname>LDFLAGS
</varname> variable that was used for building
233 <productname>PostgreSQL
</productname>. This shows linker switches.
239 <term><option>--ldflags_ex
</option></term>
242 Print the value of the
<varname>LDFLAGS_EX
</varname> variable that was used for building
243 <productname>PostgreSQL
</productname>. This shows linker switches
244 used for building executables only.
250 <term><option>--ldflags_sl
</option></term>
253 Print the value of the
<varname>LDFLAGS_SL
</varname> variable that was used for building
254 <productname>PostgreSQL
</productname>. This shows linker switches
255 used for building shared libraries only.
261 <term><option>--libs
</option></term>
264 Print the value of the
<varname>LIBS
</varname> variable that was used for building
265 <productname>PostgreSQL
</productname>. This normally contains
<literal>-l
</literal>
266 switches for external libraries linked into
<productname>PostgreSQL
</productname>.
272 <term><option>--version
</option></term>
275 Print the version of
<productname>PostgreSQL
</productname>.
281 <term><option>-?
</option></term>
282 <term><option>--help
</option></term>
285 Show help about
<application>pg_config
</application> command line
292 If more than one option is given, the information is printed in that order,
293 one item per line. If no options are given, all available information
294 is printed, with labels.
303 The options
<option>--docdir
</option>,
<option>--pkgincludedir
</option>,
304 <option>--localedir
</option>,
<option>--mandir
</option>,
305 <option>--sharedir
</option>,
<option>--sysconfdir
</option>,
306 <option>--cc
</option>,
<option>--cppflags
</option>,
307 <option>--cflags
</option>,
<option>--cflags_sl
</option>,
308 <option>--ldflags
</option>,
<option>--ldflags_sl
</option>,
309 and
<option>--libs
</option> were added in
<productname>PostgreSQL
</productname> 8.1.
310 The option
<option>--htmldir
</option> was added in
<productname>PostgreSQL
</productname> 8.4.
311 The option
<option>--ldflags_ex
</option> was added in
<productname>PostgreSQL
</productname> 9.0.
317 <title>Example
</title>
320 To reproduce the build configuration of the current PostgreSQL
321 installation, run the following command:
323 eval ./configure `pg_config --configure`
325 The output of
<literal>pg_config --configure
</literal> contains
326 shell quotation marks so arguments with spaces are represented
327 correctly. Therefore, using
<literal>eval
</literal> is required