2010-09-20 22:08:53 +02:00
|
|
|
<!-- doc/src/sgml/ref/pg_config-ref.sgml -->
|
2000-08-26 15:08:16 +02:00
|
|
|
|
2000-10-20 15:44:39 +02:00
|
|
|
<refentry id="app-pgconfig">
|
2000-08-26 15:08:16 +02:00
|
|
|
<refmeta>
|
2010-04-03 09:23:02 +02:00
|
|
|
<refentrytitle>pg_config</refentrytitle>
|
2000-11-12 00:01:45 +01:00
|
|
|
<manvolnum>1</manvolnum>
|
|
|
|
<refmiscinfo>Application</refmiscinfo>
|
2000-08-26 15:08:16 +02:00
|
|
|
</refmeta>
|
|
|
|
|
|
|
|
<refnamediv>
|
2000-11-12 00:01:45 +01:00
|
|
|
<refname>pg_config</refname>
|
2001-09-03 14:57:50 +02:00
|
|
|
<refpurpose>retrieve information about the installed version of <productname>PostgreSQL</></refpurpose>
|
2000-08-26 15:08:16 +02:00
|
|
|
</refnamediv>
|
|
|
|
|
2003-08-31 19:32:24 +02:00
|
|
|
<indexterm zone="app-pgconfig">
|
|
|
|
<primary>pg_config</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
2000-08-26 15:08:16 +02:00
|
|
|
<refsynopsisdiv>
|
2000-11-12 00:01:45 +01:00
|
|
|
<cmdsynopsis>
|
|
|
|
<command>pg_config</command>
|
2005-08-10 00:47:03 +02:00
|
|
|
<arg rep="repeat"><replaceable>option</replaceable></arg>
|
2000-11-12 00:01:45 +01:00
|
|
|
</cmdsynopsis>
|
2000-08-26 15:08:16 +02:00
|
|
|
</refsynopsisdiv>
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>Description</>
|
|
|
|
<para>
|
2001-08-28 16:20:28 +02:00
|
|
|
The <application>pg_config</> utility prints configuration parameters
|
2000-08-26 15:08:16 +02:00
|
|
|
of the currently installed version of <productname>PostgreSQL</>. It is
|
|
|
|
intended, for example, to be used by software packages that want to interface
|
2001-08-28 16:20:28 +02:00
|
|
|
to <productname>PostgreSQL</> to facilitate finding the required header files
|
2000-08-26 15:08:16 +02:00
|
|
|
and libraries.
|
|
|
|
</para>
|
2001-08-28 16:20:28 +02:00
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>Options</title>
|
2000-08-26 15:08:16 +02:00
|
|
|
|
|
|
|
<para>
|
2005-08-10 00:47:03 +02:00
|
|
|
To use <application>pg_config</>, supply one or more of the following
|
|
|
|
options:
|
2000-08-26 15:08:16 +02:00
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
2002-01-20 23:19:57 +01:00
|
|
|
<term><option>--bindir</option></>
|
2000-08-26 15:08:16 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Print the location of user executables. Use this, for example, to find
|
2003-03-24 15:32:51 +01:00
|
|
|
the <command>psql</> program. This is normally also the location
|
2000-10-11 00:03:31 +02:00
|
|
|
where the <filename>pg_config</> program resides.
|
2000-08-26 15:08:16 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
2005-09-27 19:39:35 +02:00
|
|
|
<varlistentry>
|
|
|
|
<term><option>--docdir</option></>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2008-02-18 15:51:48 +01:00
|
|
|
Print the location of documentation files.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term><option>--htmldir</option></>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Print the location of HTML documentation files.
|
2005-09-27 19:39:35 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
2000-08-26 15:08:16 +02:00
|
|
|
<varlistentry>
|
2002-01-20 23:19:57 +01:00
|
|
|
<term><option>--includedir</option></>
|
2000-08-26 15:08:16 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
2002-10-12 01:03:48 +02:00
|
|
|
Print the location of C header files of the client interfaces.
|
2001-08-28 16:20:28 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
2005-09-27 19:39:35 +02:00
|
|
|
<varlistentry>
|
|
|
|
<term><option>--pkgincludedir</option></>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Print the location of other C header files.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
2001-08-28 16:20:28 +02:00
|
|
|
<varlistentry>
|
2002-01-20 23:19:57 +01:00
|
|
|
<term><option>--includedir-server</option></>
|
2001-08-28 16:20:28 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
2005-09-27 19:39:35 +02:00
|
|
|
Print the location of C header files for server programming.
|
2000-08-26 15:08:16 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
2002-01-20 23:19:57 +01:00
|
|
|
<term><option>--libdir</option></>
|
2000-08-26 15:08:16 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Print the location of object code libraries.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
2001-09-16 18:11:11 +02:00
|
|
|
<varlistentry>
|
2002-01-20 23:19:57 +01:00
|
|
|
<term><option>--pkglibdir</option></>
|
2001-09-16 18:11:11 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Print the location of dynamically loadable modules, or where
|
|
|
|
the server would search for them. (Other
|
Update reference documentation on may/can/might:
Standard English uses "may", "can", and "might" in different ways:
may - permission, "You may borrow my rake."
can - ability, "I can lift that log."
might - possibility, "It might rain today."
Unfortunately, in conversational English, their use is often mixed, as
in, "You may use this variable to do X", when in fact, "can" is a better
choice. Similarly, "It may crash" is better stated, "It might crash".
2007-02-01 00:26:05 +01:00
|
|
|
architecture-dependent data files might also be installed in this
|
2001-09-16 18:11:11 +02:00
|
|
|
directory.)
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
2005-09-27 19:39:35 +02:00
|
|
|
<varlistentry>
|
|
|
|
<term><option>--localedir</option></>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Print the location of locale support files. (This will be an empty
|
|
|
|
string if locale support was not configured when
|
|
|
|
<productname>PostgreSQL</> was built.)
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term><option>--mandir</option></>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Print the location of manual pages.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term><option>--sharedir</option></>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Print the location of architecture-independent support files.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term><option>--sysconfdir</option></>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Print the location of system-wide configuration files.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
2004-08-02 14:34:14 +02:00
|
|
|
<varlistentry>
|
|
|
|
<term><option>--pgxs</option></>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Print the location of extension makefiles.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
2000-08-26 15:08:16 +02:00
|
|
|
<varlistentry>
|
2002-01-20 23:19:57 +01:00
|
|
|
<term><option>--configure</option></>
|
2000-08-26 15:08:16 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Print the options that were given to the <filename>configure</>
|
|
|
|
script when <productname>PostgreSQL</> was configured for building.
|
|
|
|
This can be used to reproduce the identical configuration, or
|
|
|
|
to find out with what options a binary package was built. (Note
|
|
|
|
however that binary packages often contain vendor-specific custom
|
2005-06-09 20:15:05 +02:00
|
|
|
patches.) See also the examples below.
|
2000-08-26 15:08:16 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
2005-08-10 00:47:03 +02:00
|
|
|
<varlistentry>
|
|
|
|
<term><option>--cc</option></>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2006-10-23 20:10:32 +02:00
|
|
|
Print the value of the <varname>CC</varname> variable that was used for building
|
2005-08-10 00:47:03 +02:00
|
|
|
<productname>PostgreSQL</>. This shows the C compiler used.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term><option>--cppflags</option></>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2006-10-23 20:10:32 +02:00
|
|
|
Print the value of the <varname>CPPFLAGS</varname> variable that was used for building
|
2005-08-10 00:47:03 +02:00
|
|
|
<productname>PostgreSQL</>. This shows C compiler switches needed
|
|
|
|
at preprocessing time (typically, <literal>-I</> switches).
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term><option>--cflags</option></>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2006-10-23 20:10:32 +02:00
|
|
|
Print the value of the <varname>CFLAGS</varname> variable that was used for building
|
2005-08-10 00:47:03 +02:00
|
|
|
<productname>PostgreSQL</>. This shows C compiler switches.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term><option>--cflags_sl</option></>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2006-10-23 20:10:32 +02:00
|
|
|
Print the value of the <varname>CFLAGS_SL</varname> variable that was used for building
|
2005-08-10 00:47:03 +02:00
|
|
|
<productname>PostgreSQL</>. This shows extra C compiler switches
|
|
|
|
used for building shared libraries.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term><option>--ldflags</option></>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2006-10-23 20:10:32 +02:00
|
|
|
Print the value of the <varname>LDFLAGS</varname> variable that was used for building
|
2005-08-10 00:47:03 +02:00
|
|
|
<productname>PostgreSQL</>. This shows linker switches.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
2010-07-05 20:54:38 +02:00
|
|
|
<varlistentry>
|
|
|
|
<term><option>--ldflags_ex</option></>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Print the value of the <varname>LDFLAGS_EX</varname> variable that was used for building
|
|
|
|
<productname>PostgreSQL</>. This shows linker switches
|
|
|
|
used for building executables only.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
2005-08-10 00:47:03 +02:00
|
|
|
<varlistentry>
|
|
|
|
<term><option>--ldflags_sl</option></>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2006-10-23 20:10:32 +02:00
|
|
|
Print the value of the <varname>LDFLAGS_SL</varname> variable that was used for building
|
2005-08-10 00:47:03 +02:00
|
|
|
<productname>PostgreSQL</>. This shows linker switches
|
2010-07-05 20:54:38 +02:00
|
|
|
used for building shared libraries only.
|
2005-08-10 00:47:03 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term><option>--libs</option></>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2006-10-23 20:10:32 +02:00
|
|
|
Print the value of the <varname>LIBS</varname> variable that was used for building
|
2005-08-10 00:47:03 +02:00
|
|
|
<productname>PostgreSQL</>. This normally contains <literal>-l</>
|
|
|
|
switches for external libraries linked into <productname>PostgreSQL</>.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
2000-08-26 15:08:16 +02:00
|
|
|
<varlistentry>
|
2002-01-20 23:19:57 +01:00
|
|
|
<term><option>--version</option></>
|
2000-08-26 15:08:16 +02:00
|
|
|
<listitem>
|
|
|
|
<para>
|
2005-08-10 00:47:03 +02:00
|
|
|
Print the version of <productname>PostgreSQL</>.
|
2000-08-26 15:08:16 +02:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
|
2005-08-10 00:47:03 +02:00
|
|
|
If more than one option is given, the information is printed in that order,
|
|
|
|
one item per line. If no options are given, all available information
|
|
|
|
is printed, with labels.
|
2000-08-26 15:08:16 +02:00
|
|
|
</para>
|
|
|
|
</refsect1>
|
2001-08-28 16:20:28 +02:00
|
|
|
|
|
|
|
|
|
|
|
<refsect1>
|
|
|
|
<title>Notes</title>
|
|
|
|
|
|
|
|
<para>
|
2010-07-05 20:54:38 +02:00
|
|
|
The option <option>--includedir-server</option> was added in
|
2002-11-15 04:11:18 +01:00
|
|
|
<productname>PostgreSQL</> 7.2. In prior releases, the server include files were
|
2001-08-28 16:20:28 +02:00
|
|
|
installed in the same location as the client headers, which could
|
2003-03-24 15:32:51 +01:00
|
|
|
be queried with the option <option>--includedir</option>. To make your
|
2001-08-28 16:20:28 +02:00
|
|
|
package handle both cases, try the newer option first and test the
|
|
|
|
exit status to see whether it succeeded.
|
|
|
|
</para>
|
|
|
|
|
2005-08-10 00:47:03 +02:00
|
|
|
<para>
|
2005-11-01 22:09:51 +01:00
|
|
|
The options <option>--docdir</option>, <option>--pkgincludedir</option>,
|
|
|
|
<option>--localedir</option>, <option>--mandir</option>,
|
|
|
|
<option>--sharedir</option>, <option>--sysconfdir</option>,
|
|
|
|
<option>--cc</option>, <option>--cppflags</option>,
|
2005-08-10 00:47:03 +02:00
|
|
|
<option>--cflags</option>, <option>--cflags_sl</option>,
|
|
|
|
<option>--ldflags</option>, <option>--ldflags_sl</option>,
|
2010-07-05 20:54:38 +02:00
|
|
|
and <option>--libs</option> were added in <productname>PostgreSQL</> 8.1.
|
|
|
|
The option <option>--htmldir</option> was added in <productname>PostgreSQL</> 8.4.
|
|
|
|
The option <option>--ldflags_ex</option> was added in <productname>PostgreSQL</> 9.0.
|
2005-08-10 00:47:03 +02:00
|
|
|
</para>
|
|
|
|
|
2001-08-28 16:20:28 +02:00
|
|
|
<para>
|
2005-01-04 04:58:16 +01:00
|
|
|
In releases prior to <productname>PostgreSQL</> 7.1, before
|
2001-08-28 16:20:28 +02:00
|
|
|
<command>pg_config</command> came to be, a method for finding the
|
|
|
|
equivalent configuration information did not exist.
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
|
2005-06-09 20:15:05 +02:00
|
|
|
<refsect1>
|
|
|
|
<title>Example</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
To reproduce the build configuration of the current PostgreSQL
|
|
|
|
installation, run the following command:
|
|
|
|
<programlisting>
|
|
|
|
eval ./configure `pg_config --configure`
|
|
|
|
</programlisting>
|
|
|
|
The output of <literal>pg_config --configure</literal> contains
|
|
|
|
shell quotation marks so arguments with spaces are represented
|
|
|
|
correctly. Therefore, using <literal>eval</literal> is required
|
|
|
|
for proper results.
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
2000-08-26 15:08:16 +02:00
|
|
|
</refentry>
|