Fix xslt_process() to ensure that it inserts a NULL terminator after the
[PostgreSQL.git] / doc / src / sgml / ref / pg_config-ref.sgml
blob7d5a0fe9300028a228347d71ef8910d71e8a45ae
1 <!-- $PostgreSQL$ -->
3 <refentry id="app-pgconfig">
4 <refmeta>
5 <refentrytitle id="app-pgconfig-title">pg_config</refentrytitle>
6 <manvolnum>1</manvolnum>
7 <refmiscinfo>Application</refmiscinfo>
8 </refmeta>
10 <refnamediv>
11 <refname>pg_config</refname>
12 <refpurpose>retrieve information about the installed version of <productname>PostgreSQL</></refpurpose>
13 </refnamediv>
15 <indexterm zone="app-pgconfig">
16 <primary>pg_config</primary>
17 </indexterm>
19 <refsynopsisdiv>
20 <cmdsynopsis>
21 <command>pg_config</command>
22 <arg rep="repeat"><replaceable>option</replaceable></arg>
23 </cmdsynopsis>
24 </refsynopsisdiv>
26 <refsect1>
27 <title>Description</>
28 <para>
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
33 and libraries.
34 </para>
35 </refsect1>
38 <refsect1>
39 <title>Options</title>
41 <para>
42 To use <application>pg_config</>, supply one or more of the following
43 options:
44 <variablelist>
45 <varlistentry>
46 <term><option>--bindir</option></>
47 <listitem>
48 <para>
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.
52 </para>
53 </listitem>
54 </varlistentry>
56 <varlistentry>
57 <term><option>--docdir</option></>
58 <listitem>
59 <para>
60 Print the location of documentation files.
61 </para>
62 </listitem>
63 </varlistentry>
65 <varlistentry>
66 <term><option>--htmldir</option></>
67 <listitem>
68 <para>
69 Print the location of HTML documentation files.
70 </para>
71 </listitem>
72 </varlistentry>
74 <varlistentry>
75 <term><option>--includedir</option></>
76 <listitem>
77 <para>
78 Print the location of C header files of the client interfaces.
79 </para>
80 </listitem>
81 </varlistentry>
83 <varlistentry>
84 <term><option>--pkgincludedir</option></>
85 <listitem>
86 <para>
87 Print the location of other C header files.
88 </para>
89 </listitem>
90 </varlistentry>
92 <varlistentry>
93 <term><option>--includedir-server</option></>
94 <listitem>
95 <para>
96 Print the location of C header files for server programming.
97 </para>
98 </listitem>
99 </varlistentry>
101 <varlistentry>
102 <term><option>--libdir</option></>
103 <listitem>
104 <para>
105 Print the location of object code libraries.
106 </para>
107 </listitem>
108 </varlistentry>
110 <varlistentry>
111 <term><option>--pkglibdir</option></>
112 <listitem>
113 <para>
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
117 directory.)
118 </para>
119 </listitem>
120 </varlistentry>
122 <varlistentry>
123 <term><option>--localedir</option></>
124 <listitem>
125 <para>
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.)
129 </para>
130 </listitem>
131 </varlistentry>
133 <varlistentry>
134 <term><option>--mandir</option></>
135 <listitem>
136 <para>
137 Print the location of manual pages.
138 </para>
139 </listitem>
140 </varlistentry>
142 <varlistentry>
143 <term><option>--sharedir</option></>
144 <listitem>
145 <para>
146 Print the location of architecture-independent support files.
147 </para>
148 </listitem>
149 </varlistentry>
151 <varlistentry>
152 <term><option>--sysconfdir</option></>
153 <listitem>
154 <para>
155 Print the location of system-wide configuration files.
156 </para>
157 </listitem>
158 </varlistentry>
160 <varlistentry>
161 <term><option>--pgxs</option></>
162 <listitem>
163 <para>
164 Print the location of extension makefiles.
165 </para>
166 </listitem>
167 </varlistentry>
169 <varlistentry>
170 <term><option>--configure</option></>
171 <listitem>
172 <para>
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.
179 </para>
180 </listitem>
181 </varlistentry>
183 <varlistentry>
184 <term><option>--cc</option></>
185 <listitem>
186 <para>
187 Print the value of the <varname>CC</varname> variable that was used for building
188 <productname>PostgreSQL</>. This shows the C compiler used.
189 </para>
190 </listitem>
191 </varlistentry>
193 <varlistentry>
194 <term><option>--cppflags</option></>
195 <listitem>
196 <para>
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).
200 </para>
201 </listitem>
202 </varlistentry>
204 <varlistentry>
205 <term><option>--cflags</option></>
206 <listitem>
207 <para>
208 Print the value of the <varname>CFLAGS</varname> variable that was used for building
209 <productname>PostgreSQL</>. This shows C compiler switches.
210 </para>
211 </listitem>
212 </varlistentry>
214 <varlistentry>
215 <term><option>--cflags_sl</option></>
216 <listitem>
217 <para>
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.
221 </para>
222 </listitem>
223 </varlistentry>
225 <varlistentry>
226 <term><option>--ldflags</option></>
227 <listitem>
228 <para>
229 Print the value of the <varname>LDFLAGS</varname> variable that was used for building
230 <productname>PostgreSQL</>. This shows linker switches.
231 </para>
232 </listitem>
233 </varlistentry>
235 <varlistentry>
236 <term><option>--ldflags_sl</option></>
237 <listitem>
238 <para>
239 Print the value of the <varname>LDFLAGS_SL</varname> variable that was used for building
240 <productname>PostgreSQL</>. This shows linker switches
241 used for building shared libraries.
242 </para>
243 </listitem>
244 </varlistentry>
246 <varlistentry>
247 <term><option>--libs</option></>
248 <listitem>
249 <para>
250 Print the value of the <varname>LIBS</varname> variable that was used for building
251 <productname>PostgreSQL</>. This normally contains <literal>-l</>
252 switches for external libraries linked into <productname>PostgreSQL</>.
253 </para>
254 </listitem>
255 </varlistentry>
257 <varlistentry>
258 <term><option>--version</option></>
259 <listitem>
260 <para>
261 Print the version of <productname>PostgreSQL</>.
262 </para>
263 </listitem>
264 </varlistentry>
265 </variablelist>
267 If more than one option is given, the information is printed in that order,
268 one item per line. If no options are given, all available information
269 is printed, with labels.
270 </para>
271 </refsect1>
274 <refsect1>
275 <title>Notes</title>
277 <para>
278 The option <option>--includedir-server</option> was new in
279 <productname>PostgreSQL</> 7.2. In prior releases, the server include files were
280 installed in the same location as the client headers, which could
281 be queried with the option <option>--includedir</option>. To make your
282 package handle both cases, try the newer option first and test the
283 exit status to see whether it succeeded.
284 </para>
286 <para>
287 The options <option>--docdir</option>, <option>--pkgincludedir</option>,
288 <option>--localedir</option>, <option>--mandir</option>,
289 <option>--sharedir</option>, <option>--sysconfdir</option>,
290 <option>--cc</option>, <option>--cppflags</option>,
291 <option>--cflags</option>, <option>--cflags_sl</option>,
292 <option>--ldflags</option>, <option>--ldflags_sl</option>,
293 and <option>--libs</option> are new in <productname>PostgreSQL</> 8.1.
294 The option <option>--htmldir</option> is new in <productname>PostgreSQL</> 8.4.
295 </para>
297 <para>
298 In releases prior to <productname>PostgreSQL</> 7.1, before
299 <command>pg_config</command> came to be, a method for finding the
300 equivalent configuration information did not exist.
301 </para>
302 </refsect1>
305 <refsect1>
306 <title>Example</title>
308 <para>
309 To reproduce the build configuration of the current PostgreSQL
310 installation, run the following command:
311 <programlisting>
312 eval ./configure `pg_config --configure`
313 </programlisting>
314 The output of <literal>pg_config --configure</literal> contains
315 shell quotation marks so arguments with spaces are represented
316 correctly. Therefore, using <literal>eval</literal> is required
317 for proper results.
318 </para>
319 </refsect1>
321 </refentry>