1 <!-- doc/src/sgml/ref/pg_config-ref.sgml -->
3 <refentry id="app-pgconfig">
4 <indexterm zone="app-pgconfig">
5 <primary>pg_config</primary>
9 <refentrytitle>pg_config</refentrytitle>
10 <manvolnum>1</manvolnum>
11 <refmiscinfo>Application</refmiscinfo>
15 <refname>pg_config</refname>
16 <refpurpose>retrieve information about the installed version of <productname>PostgreSQL</></refpurpose>
21 <command>pg_config</command>
22 <arg rep="repeat"><replaceable>option</replaceable></arg>
29 The <application>pg_config</> utility prints configuration parameters
30 of the currently installed version of <productname>PostgreSQL</>. It is
31 intended, for example, to be used by software packages that want to interface
32 to <productname>PostgreSQL</> to facilitate finding the required header files
39 <title>Options</title>
42 To use <application>pg_config</>, supply one or more of the following
46 <term><option>--bindir</option></>
49 Print the location of user executables. Use this, for example, to find
50 the <command>psql</> program. This is normally also the location
51 where the <filename>pg_config</> program resides.
57 <term><option>--docdir</option></>
60 Print the location of documentation files.
66 <term><option>--htmldir</option></>
69 Print the location of HTML documentation files.
75 <term><option>--includedir</option></>
78 Print the location of C header files of the client interfaces.
84 <term><option>--pkgincludedir</option></>
87 Print the location of other C header files.
93 <term><option>--includedir-server</option></>
96 Print the location of C header files for server programming.
102 <term><option>--libdir</option></>
105 Print the location of object code libraries.
111 <term><option>--pkglibdir</option></>
114 Print the location of dynamically loadable modules, or where
115 the server would search for them. (Other
116 architecture-dependent data files might also be installed in this
123 <term><option>--localedir</option></>
126 Print the location of locale support files. (This will be an empty
127 string if locale support was not configured when
128 <productname>PostgreSQL</> was built.)
134 <term><option>--mandir</option></>
137 Print the location of manual pages.
143 <term><option>--sharedir</option></>
146 Print the location of architecture-independent support files.
152 <term><option>--sysconfdir</option></>
155 Print the location of system-wide configuration files.
161 <term><option>--pgxs</option></>
164 Print the location of extension makefiles.
170 <term><option>--configure</option></>
173 Print the options that were given to the <filename>configure</>
174 script when <productname>PostgreSQL</> was configured for building.
175 This can be used to reproduce the identical configuration, or
176 to find out with what options a binary package was built. (Note
177 however that binary packages often contain vendor-specific custom
178 patches.) See also the examples below.
184 <term><option>--cc</option></>
187 Print the value of the <varname>CC</varname> variable that was used for building
188 <productname>PostgreSQL</>. This shows the C compiler used.
194 <term><option>--cppflags</option></>
197 Print the value of the <varname>CPPFLAGS</varname> variable that was used for building
198 <productname>PostgreSQL</>. This shows C compiler switches needed
199 at preprocessing time (typically, <literal>-I</> switches).
205 <term><option>--cflags</option></>
208 Print the value of the <varname>CFLAGS</varname> variable that was used for building
209 <productname>PostgreSQL</>. This shows C compiler switches.
215 <term><option>--cflags_sl</option></>
218 Print the value of the <varname>CFLAGS_SL</varname> variable that was used for building
219 <productname>PostgreSQL</>. This shows extra C compiler switches
220 used for building shared libraries.
226 <term><option>--ldflags</option></>
229 Print the value of the <varname>LDFLAGS</varname> variable that was used for building
230 <productname>PostgreSQL</>. This shows linker switches.
236 <term><option>--ldflags_ex</option></>
239 Print the value of the <varname>LDFLAGS_EX</varname> variable that was used for building
240 <productname>PostgreSQL</>. This shows linker switches
241 used for building executables only.
247 <term><option>--ldflags_sl</option></>
250 Print the value of the <varname>LDFLAGS_SL</varname> variable that was used for building
251 <productname>PostgreSQL</>. This shows linker switches
252 used for building shared libraries only.
258 <term><option>--libs</option></>
261 Print the value of the <varname>LIBS</varname> variable that was used for building
262 <productname>PostgreSQL</>. This normally contains <literal>-l</>
263 switches for external libraries linked into <productname>PostgreSQL</>.
269 <term><option>--version</option></>
272 Print the version of <productname>PostgreSQL</>.
278 <term><option>-?</></term>
279 <term><option>--help</></term>
282 Show help about <application>pg_config</application> command line
289 If more than one option is given, the information is printed in that order,
290 one item per line. If no options are given, all available information
291 is printed, with labels.
300 The options <option>--docdir</option>, <option>--pkgincludedir</option>,
301 <option>--localedir</option>, <option>--mandir</option>,
302 <option>--sharedir</option>, <option>--sysconfdir</option>,
303 <option>--cc</option>, <option>--cppflags</option>,
304 <option>--cflags</option>, <option>--cflags_sl</option>,
305 <option>--ldflags</option>, <option>--ldflags_sl</option>,
306 and <option>--libs</option> were added in <productname>PostgreSQL</> 8.1.
307 The option <option>--htmldir</option> was added in <productname>PostgreSQL</> 8.4.
308 The option <option>--ldflags_ex</option> was added in <productname>PostgreSQL</> 9.0.
314 <title>Example</title>
317 To reproduce the build configuration of the current PostgreSQL
318 installation, run the following command:
320 eval ./configure `pg_config --configure`
322 The output of <literal>pg_config --configure</literal> contains
323 shell quotation marks so arguments with spaces are represented
324 correctly. Therefore, using <literal>eval</literal> is required