postgresql/doc/src/sgml/ref/pg_config-ref.sgml

279 lines
7.7 KiB
Plaintext
Raw Normal View History

<!-- $PostgreSQL: pgsql/doc/src/sgml/ref/pg_config-ref.sgml,v 1.21 2005/08/09 22:47:03 tgl Exp $ -->
<refentry id="app-pgconfig">
<refmeta>
<refentrytitle id="app-pgconfig-title">pg_config</refentrytitle>
<manvolnum>1</manvolnum>
<refmiscinfo>Application</refmiscinfo>
</refmeta>
<refnamediv>
<refname>pg_config</refname>
<refpurpose>retrieve information about the installed version of <productname>PostgreSQL</></refpurpose>
</refnamediv>
2003-08-31 19:32:24 +02:00
<indexterm zone="app-pgconfig">
<primary>pg_config</primary>
</indexterm>
<refsynopsisdiv>
<cmdsynopsis>
<command>pg_config</command>
<arg rep="repeat"><replaceable>option</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</>
<para>
The <application>pg_config</> utility prints configuration parameters
of the currently installed version of <productname>PostgreSQL</>. It is
intended, for example, to be used by software packages that want to interface
to <productname>PostgreSQL</> to facilitate finding the required header files
and libraries.
</para>
</refsect1>
<refsect1>
<title>Options</title>
<para>
To use <application>pg_config</>, supply one or more of the following
options:
<variablelist>
<varlistentry>
2002-01-20 23:19:57 +01:00
<term><option>--bindir</option></>
<listitem>
<para>
Print the location of user executables. Use this, for example, to find
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.
</para>
</listitem>
</varlistentry>
<varlistentry>
2002-01-20 23:19:57 +01:00
<term><option>--includedir</option></>
<listitem>
<para>
2002-10-12 01:03:48 +02:00
Print the location of C header files of the client interfaces.
</para>
</listitem>
</varlistentry>
<varlistentry>
2002-01-20 23:19:57 +01:00
<term><option>--includedir-server</option></>
<listitem>
<para>
2002-10-12 01:03:48 +02:00
Print the location of C header files for server
programming.
</para>
</listitem>
</varlistentry>
<varlistentry>
2002-01-20 23:19:57 +01:00
<term><option>--libdir</option></>
<listitem>
<para>
Print the location of object code libraries.
</para>
</listitem>
</varlistentry>
<varlistentry>
2002-01-20 23:19:57 +01:00
<term><option>--pkglibdir</option></>
<listitem>
<para>
Print the location of dynamically loadable modules, or where
the server would search for them. (Other
architecture-dependent data files may also be installed in this
directory.)
</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>
<varlistentry>
2002-01-20 23:19:57 +01:00
<term><option>--configure</option></>
<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.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--cc</option></>
<listitem>
<para>
Print the value of the CC macro that was used for building
<productname>PostgreSQL</>. This shows the C compiler used.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--cppflags</option></>
<listitem>
<para>
Print the value of the CPPFLAGS macro that was used for building
<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>
Print the value of the CFLAGS macro that was used for building
<productname>PostgreSQL</>. This shows C compiler switches.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--cflags_sl</option></>
<listitem>
<para>
Print the value of the CFLAGS_SL macro that was used for building
<productname>PostgreSQL</>. This shows extra C compiler switches
used for building shared libraries.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--ldflags</option></>
<listitem>
<para>
Print the value of the LDFLAGS macro that was used for building
<productname>PostgreSQL</>. This shows linker switches.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--ldflags_sl</option></>
<listitem>
<para>
Print the value of the LDFLAGS_SL macro that was used for building
<productname>PostgreSQL</>. This shows linker switches
used for building shared libraries.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>--libs</option></>
<listitem>
<para>
Print the value of the LIBS macro that was used for building
<productname>PostgreSQL</>. This normally contains <literal>-l</>
switches for external libraries linked into <productname>PostgreSQL</>.
</para>
</listitem>
</varlistentry>
<varlistentry>
2002-01-20 23:19:57 +01:00
<term><option>--version</option></>
<listitem>
<para>
Print the version of <productname>PostgreSQL</>.
</para>
</listitem>
</varlistentry>
</variablelist>
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.
</para>
</refsect1>
<refsect1>
<title>Notes</title>
<para>
The option <option>--includedir-server</option> was new in
2002-11-15 04:11:18 +01:00
<productname>PostgreSQL</> 7.2. In prior releases, the server include files were
installed in the same location as the client headers, which could
be queried with the option <option>--includedir</option>. To make your
package handle both cases, try the newer option first and test the
exit status to see whether it succeeded.
</para>
<para>
The options <option>--cc</option>, <option>--cppflags</option>,
<option>--cflags</option>, <option>--cflags_sl</option>,
<option>--ldflags</option>, <option>--ldflags_sl</option>,
and <option>--libs</option> are new in <productname>PostgreSQL</> 8.1.
</para>
<para>
2005-01-04 04:58:16 +01:00
In releases prior to <productname>PostgreSQL</> 7.1, before
<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>
<refsect1>
<title>History</title>
<para>
2002-11-15 04:11:18 +01:00
The <command>pg_config</command> utility first appeared in
<productname>PostgreSQL</> 7.1.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:nil
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../reference.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:"/usr/lib/sgml/catalog"
sgml-local-ecat-files:nil
End:
-->