1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Split the LDFLAGS make variable into two parts: LDFLAGS is now used for

linking both executables and shared libraries, and we add on LDFLAGS_EX when
linking executables or LDFLAGS_SL when linking shared libraries.  This
provides a significantly cleaner way of dealing with link-time switches than
the former behavior.  Also, make sure that the various platform-specific
%.so: %.o rules incorporate LDFLAGS and LDFLAGS_SL; most of them missed that
before.  (I did not add these variables for the platforms that invoke $(LD)
directly, however.  It's not clear if we can do that safely, since for the
most part we assume these variables use CC command-line syntax.)

Per gripe from Aaron Swenson and subsequent investigation.
This commit is contained in:
Tom Lane
2010-07-05 18:54:38 +00:00
parent eb81b6509f
commit 291a957745
49 changed files with 183 additions and 135 deletions

View File

@ -1,4 +1,4 @@
<!-- $PostgreSQL: pgsql/doc/src/sgml/installation.sgml,v 1.347 2010/06/29 22:29:13 momjian Exp $ -->
<!-- $PostgreSQL: pgsql/doc/src/sgml/installation.sgml,v 1.348 2010/07/05 18:54:37 tgl Exp $ -->
<chapter id="installation">
<title><![%standalone-include[<productname>PostgreSQL</>]]>
@ -1468,7 +1468,16 @@ su - postgres
<term><envar>LDFLAGS</envar></term>
<listitem>
<para>
options to pass to the link editor
options to use when linking either executables or shared libraries
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><envar>LDFLAGS_EX</envar></term>
<listitem>
<para>
additional options for linking executables only
</para>
</listitem>
</varlistentry>
@ -1477,7 +1486,7 @@ su - postgres
<term><envar>LDFLAGS_SL</envar></term>
<listitem>
<para>
linker options for shared library linking
additional options for linking shared libraries only
</para>
</listitem>
</varlistentry>

View File

@ -1,4 +1,4 @@
<!-- $PostgreSQL: pgsql/doc/src/sgml/ref/pg_config-ref.sgml,v 1.29 2010/04/03 07:23:01 petere Exp $ -->
<!-- $PostgreSQL: pgsql/doc/src/sgml/ref/pg_config-ref.sgml,v 1.30 2010/07/05 18:54:37 tgl Exp $ -->
<refentry id="app-pgconfig">
<refmeta>
@ -232,13 +232,24 @@
</listitem>
</varlistentry>
<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>
<varlistentry>
<term><option>--ldflags_sl</option></>
<listitem>
<para>
Print the value of the <varname>LDFLAGS_SL</varname> variable that was used for building
<productname>PostgreSQL</>. This shows linker switches
used for building shared libraries.
used for building shared libraries only.
</para>
</listitem>
</varlistentry>
@ -275,7 +286,7 @@
<title>Notes</title>
<para>
The option <option>--includedir-server</option> was new in
The option <option>--includedir-server</option> was added in
<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
@ -290,8 +301,9 @@
<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.
The option <option>--htmldir</option> is new in <productname>PostgreSQL</> 8.4.
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.
</para>
<para>