11# -*-makefile-*-
2- # $PostgreSQL: pgsql/src/Makefile.global.in,v 1.211 2005/03/24 23:53:48 tgl Exp $
2+ # $PostgreSQL: pgsql/src/Makefile.global.in,v 1.212 2005/03/25 18:17:12 momjian Exp $
33
44# ------------------------------------------------------------------------------
55# All PostgreSQL makefiles include this file and use the variables it sets,
@@ -306,8 +306,10 @@ libpq_srcdir = $(top_srcdir)/src/interfaces/libpq
306306libpq_builddir = $(top_builddir ) /src/interfaces/libpq
307307endif
308308
309+ # This is for use for libraries linking to libpq. Because libpqport
310+ # isn't created with the same link flags as libpq, it can't be used.
309311libpq = -L$(libpq_builddir ) -lpq
310-
312+
311313# If doing static linking, shared library dependency can't be
312314# used so we specify pthread libs for every usage of libpq
313315ifeq ($(enable_shared ) , no)
@@ -320,6 +322,19 @@ libpq += $(PTHREAD_LIBS)
320322endif
321323endif
322324
325+ # Force clients to pull symbols from the non-shared library libpgport
326+ # rather than pulling some libpgport symbols from libpq just because
327+ # libpq uses those functions too. This makes applications less
328+ # dependent on changes in libpq's usage of pgport. To do this we link to
329+ # pgport before libpq. This does cause duplicate -lpgport's to appear
330+ # on client link lines.
331+ ifdef PGXS
332+ libpq_pgport = -L$(libdir ) -lpgport $(libpq )
333+ else
334+ libpq_pgport = -L$(top_builddir ) /src/port -lpgport $(libpq )
335+ endif
336+
337+
323338submake-libpq :
324339 $(MAKE ) -C $(libpq_builddir ) all
325340
0 commit comments