1
1
# -*-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 $
3
3
4
4
# ------------------------------------------------------------------------------
5
5
# All PostgreSQL makefiles include this file and use the variables it sets,
@@ -306,8 +306,10 @@ libpq_srcdir = $(top_srcdir)/src/interfaces/libpq
306
306
libpq_builddir =$(top_builddir ) /src/interfaces/libpq
307
307
endif
308
308
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.
309
311
libpq = -L$(libpq_builddir ) -lpq
310
-
312
+
311
313
# If doing static linking, shared library dependency can't be
312
314
# used so we specify pthread libs for every usage of libpq
313
315
ifeq ($(enable_shared ) , no)
@@ -320,6 +322,19 @@ libpq += $(PTHREAD_LIBS)
320
322
endif
321
323
endif
322
324
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
+
323
338
submake-libpq :
324
339
$(MAKE ) -C$(libpq_builddir ) all
325
340