summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2005-03-25 18:17:14 +0000
committerBruce Momjian <bruce@momjian.us>2005-03-25 18:17:14 +0000
commit6b7ef076b52f89178ab567f49170786cb2d83645 (patch)
tree65c7dba9a9b76bd20f1233700b48d1154df8931b
parent410fede0dd8e2effd05aa97baba9fe0fbb23b915 (diff)
downloadpostgresql-6b7ef076b52f89178ab567f49170786cb2d83645.tar.gz
Have libpgport link before libpq so that PG client applications are more
immunte to changes in libpq's usage of pgport between major versions.
-rw-r--r--contrib/dbase/Makefile4
-rw-r--r--contrib/findoidjoins/Makefile4
-rw-r--r--contrib/oid2name/Makefile4
-rw-r--r--contrib/pg_autovacuum/Makefile2
-rw-r--r--contrib/pg_dumplo/Makefile4
-rw-r--r--contrib/pgbench/Makefile4
-rw-r--r--contrib/vacuumlo/Makefile4
-rw-r--r--src/Makefile.global.in19
-rw-r--r--src/bin/initdb/Makefile4
-rw-r--r--src/bin/pg_ctl/Makefile4
-rw-r--r--src/bin/pg_dump/Makefile8
-rw-r--r--src/bin/psql/Makefile4
-rw-r--r--src/bin/scripts/Makefile4
-rw-r--r--src/test/examples/Makefile2
14 files changed, 43 insertions, 28 deletions
diff --git a/contrib/dbase/Makefile b/contrib/dbase/Makefile
index a39b5a8a57..f3dd96c831 100644
--- a/contrib/dbase/Makefile
+++ b/contrib/dbase/Makefile
@@ -1,9 +1,9 @@
-# $PostgreSQL: pgsql/contrib/dbase/Makefile,v 1.6 2004/08/20 20:13:02 momjian Exp $
+# $PostgreSQL: pgsql/contrib/dbase/Makefile,v 1.7 2005/03/25 18:17:10 momjian Exp $
PROGRAM = dbf2pg
OBJS = dbf.o dbf2pg.o endian.o
PG_CPPFLAGS = -I$(libpq_srcdir)
-PG_LIBS = $(libpq)
+PG_LIBS = $(libpq_pgport)
# Uncomment this to provide charset translation
#PG_CPPFLAGS += -DHAVE_ICONV_H
diff --git a/contrib/findoidjoins/Makefile b/contrib/findoidjoins/Makefile
index 9a0a1de89f..a15378a2a2 100644
--- a/contrib/findoidjoins/Makefile
+++ b/contrib/findoidjoins/Makefile
@@ -1,10 +1,10 @@
-# $PostgreSQL: pgsql/contrib/findoidjoins/Makefile,v 1.16 2004/08/20 20:13:03 momjian Exp $
+# $PostgreSQL: pgsql/contrib/findoidjoins/Makefile,v 1.17 2005/03/25 18:17:10 momjian Exp $
PROGRAM = findoidjoins
OBJS = findoidjoins.o
PG_CPPFLAGS = -I$(libpq_srcdir)
-PG_LIBS = $(libpq)
+PG_LIBS = $(libpq_pgport)
SCRIPTS = make_oidjoins_check
DOCS = README.findoidjoins
diff --git a/contrib/oid2name/Makefile b/contrib/oid2name/Makefile
index 191e9362f2..56ca83c026 100644
--- a/contrib/oid2name/Makefile
+++ b/contrib/oid2name/Makefile
@@ -1,10 +1,10 @@
-# $PostgreSQL: pgsql/contrib/oid2name/Makefile,v 1.6 2004/08/20 20:13:05 momjian Exp $
+# $PostgreSQL: pgsql/contrib/oid2name/Makefile,v 1.7 2005/03/25 18:17:11 momjian Exp $
PROGRAM = oid2name
OBJS = oid2name.o
PG_CPPFLAGS = -I$(libpq_srcdir)
-PG_LIBS = $(libpq)
+PG_LIBS = $(libpq_pgport)
DOCS = README.oid2name
diff --git a/contrib/pg_autovacuum/Makefile b/contrib/pg_autovacuum/Makefile
index 00b1b3fe95..c512d18b7e 100644
--- a/contrib/pg_autovacuum/Makefile
+++ b/contrib/pg_autovacuum/Makefile
@@ -2,7 +2,7 @@ PROGRAM = pg_autovacuum
OBJS = pg_autovacuum.o dllist.o
PG_CPPFLAGS = -I$(libpq_srcdir) -DFRONTEND
-PG_LIBS = $(libpq)
+PG_LIBS = $(libpq_pgport)
DOCS = README.pg_autovacuum
diff --git a/contrib/pg_dumplo/Makefile b/contrib/pg_dumplo/Makefile
index f3e43f0985..ed862b6ec7 100644
--- a/contrib/pg_dumplo/Makefile
+++ b/contrib/pg_dumplo/Makefile
@@ -1,10 +1,10 @@
-# $PostgreSQL: pgsql/contrib/pg_dumplo/Makefile,v 1.13 2004/08/20 20:13:05 momjian Exp $
+# $PostgreSQL: pgsql/contrib/pg_dumplo/Makefile,v 1.14 2005/03/25 18:17:11 momjian Exp $
PROGRAM = pg_dumplo
OBJS = main.o lo_export.o lo_import.o utils.o
PG_CPPFLAGS = -I$(libpq_srcdir)
-PG_LIBS = $(libpq)
+PG_LIBS = $(libpq_pgport)
DOCS = README.pg_dumplo
diff --git a/contrib/pgbench/Makefile b/contrib/pgbench/Makefile
index a2a743a7dc..55e1c68114 100644
--- a/contrib/pgbench/Makefile
+++ b/contrib/pgbench/Makefile
@@ -1,10 +1,10 @@
-# $PostgreSQL: pgsql/contrib/pgbench/Makefile,v 1.12 2004/08/20 20:13:06 momjian Exp $
+# $PostgreSQL: pgsql/contrib/pgbench/Makefile,v 1.13 2005/03/25 18:17:11 momjian Exp $
PROGRAM = pgbench
OBJS = pgbench.o
PG_CPPFLAGS = -I$(libpq_srcdir)
-PG_LIBS = $(libpq)
+PG_LIBS = $(libpq_pgport)
DOCS = README.pgbench README.pgbench_jis
diff --git a/contrib/vacuumlo/Makefile b/contrib/vacuumlo/Makefile
index 7e21a064a8..b75296ef68 100644
--- a/contrib/vacuumlo/Makefile
+++ b/contrib/vacuumlo/Makefile
@@ -1,10 +1,10 @@
-# $PostgreSQL: pgsql/contrib/vacuumlo/Makefile,v 1.13 2004/08/20 20:13:10 momjian Exp $
+# $PostgreSQL: pgsql/contrib/vacuumlo/Makefile,v 1.14 2005/03/25 18:17:12 momjian Exp $
PROGRAM = vacuumlo
OBJS = vacuumlo.o
PG_CPPFLAGS = -I$(libpq_srcdir)
-PG_LIBS = $(libpq)
+PG_LIBS = $(libpq_pgport)
DOCS = README.vacuumlo
diff --git a/src/Makefile.global.in b/src/Makefile.global.in
index 5ef19a1e43..99faf46b80 100644
--- a/src/Makefile.global.in
+++ b/src/Makefile.global.in
@@ -1,5 +1,5 @@
# -*-makefile-*-
-# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.211 2005/03/24 23:53:48 tgl Exp $
+# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.212 2005/03/25 18:17:12 momjian Exp $
#------------------------------------------------------------------------------
# All PostgreSQL makefiles include this file and use the variables it sets,
@@ -306,8 +306,10 @@ libpq_srcdir = $(top_srcdir)/src/interfaces/libpq
libpq_builddir = $(top_builddir)/src/interfaces/libpq
endif
+# This is for use for libraries linking to libpq. Because libpqport
+# isn't created with the same link flags as libpq, it can't be used.
libpq = -L$(libpq_builddir) -lpq
-
+
# If doing static linking, shared library dependency can't be
# used so we specify pthread libs for every usage of libpq
ifeq ($(enable_shared), no)
@@ -320,6 +322,19 @@ libpq += $(PTHREAD_LIBS)
endif
endif
+# Force clients to pull symbols from the non-shared library libpgport
+# rather than pulling some libpgport symbols from libpq just because
+# libpq uses those functions too. This makes applications less
+# dependent on changes in libpq's usage of pgport. To do this we link to
+# pgport before libpq. This does cause duplicate -lpgport's to appear
+# on client link lines.
+ifdef PGXS
+libpq_pgport = -L$(libdir) -lpgport $(libpq)
+else
+libpq_pgport = -L$(top_builddir)/src/port -lpgport $(libpq)
+endif
+
+
submake-libpq:
$(MAKE) -C $(libpq_builddir) all
diff --git a/src/bin/initdb/Makefile b/src/bin/initdb/Makefile
index 7f218991a6..cf62d7928b 100644
--- a/src/bin/initdb/Makefile
+++ b/src/bin/initdb/Makefile
@@ -5,7 +5,7 @@
# Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California
#
-# $PostgreSQL: pgsql/src/bin/initdb/Makefile,v 1.48 2004/12/31 22:02:59 pgsql Exp $
+# $PostgreSQL: pgsql/src/bin/initdb/Makefile,v 1.49 2005/03/25 18:17:12 momjian Exp $
#
#-------------------------------------------------------------------------
@@ -21,7 +21,7 @@ OBJS= initdb.o $(WIN32RES)
all: submake-libpq submake-libpgport initdb
initdb: $(OBJS) $(libpq_builddir)/libpq.a
- $(CC) $(CFLAGS) $(OBJS) $(libpq) $(LDFLAGS) $(LIBS) -o $@$(X)
+ $(CC) $(CFLAGS) $(OBJS) $(libpq_pgport) $(LDFLAGS) $(LIBS) -o $@$(X)
install: all installdirs
$(INSTALL_PROGRAM) initdb$(X) $(DESTDIR)$(bindir)/initdb$(X)
diff --git a/src/bin/pg_ctl/Makefile b/src/bin/pg_ctl/Makefile
index a64aa94e71..fd50b83cea 100644
--- a/src/bin/pg_ctl/Makefile
+++ b/src/bin/pg_ctl/Makefile
@@ -5,7 +5,7 @@
# Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California
#
-# $PostgreSQL: pgsql/src/bin/pg_ctl/Makefile,v 1.19 2004/12/31 22:03:05 pgsql Exp $
+# $PostgreSQL: pgsql/src/bin/pg_ctl/Makefile,v 1.20 2005/03/25 18:17:13 momjian Exp $
#
#-------------------------------------------------------------------------
@@ -21,7 +21,7 @@ OBJS= pg_ctl.o $(WIN32RES)
all: submake-libpq submake-libpgport pg_ctl
pg_ctl: $(OBJS) $(libpq_builddir)/libpq.a
- $(CC) $(CFLAGS) $(OBJS) $(libpq) $(LDFLAGS) $(LIBS) -o $@$(X)
+ $(CC) $(CFLAGS) $(OBJS) $(libpq_pgport) $(LDFLAGS) $(LIBS) -o $@$(X)
install: all installdirs
$(INSTALL_PROGRAM) pg_ctl$(X) $(DESTDIR)$(bindir)/pg_ctl$(X)
diff --git a/src/bin/pg_dump/Makefile b/src/bin/pg_dump/Makefile
index 61c13db7a2..9b980b203b 100644
--- a/src/bin/pg_dump/Makefile
+++ b/src/bin/pg_dump/Makefile
@@ -5,7 +5,7 @@
# Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California
#
-# $PostgreSQL: pgsql/src/bin/pg_dump/Makefile,v 1.59 2005/01/01 20:44:23 tgl Exp $
+# $PostgreSQL: pgsql/src/bin/pg_dump/Makefile,v 1.60 2005/03/25 18:17:13 momjian Exp $
#
#-------------------------------------------------------------------------
@@ -25,13 +25,13 @@ EXTRA_OBJS = $(top_builddir)/src/backend/parser/keywords.o
all: submake-libpq submake-libpgport submake-backend pg_dump pg_restore pg_dumpall
pg_dump: pg_dump.o common.o pg_dump_sort.o $(OBJS) $(libpq_builddir)/libpq.a
- $(CC) $(CFLAGS) pg_dump.o common.o pg_dump_sort.o $(OBJS) $(EXTRA_OBJS) $(libpq) $(LDFLAGS) $(LIBS) -o $@$(X)
+ $(CC) $(CFLAGS) pg_dump.o common.o pg_dump_sort.o $(OBJS) $(EXTRA_OBJS) $(libpq_pgport) $(LDFLAGS) $(LIBS) -o $@$(X)
pg_restore: pg_restore.o $(OBJS) $(libpq_builddir)/libpq.a
- $(CC) $(CFLAGS) pg_restore.o $(OBJS) $(EXTRA_OBJS) $(libpq) $(LDFLAGS) $(LIBS) -o $@$(X)
+ $(CC) $(CFLAGS) pg_restore.o $(OBJS) $(EXTRA_OBJS) $(libpq_pgport) $(LDFLAGS) $(LIBS) -o $@$(X)
pg_dumpall: pg_dumpall.o dumputils.o $(libpq_builddir)/libpq.a
- $(CC) $(CFLAGS) pg_dumpall.o dumputils.o $(EXTRA_OBJS) $(WIN32RES) $(libpq) $(LDFLAGS) $(LIBS) -o $@$(X)
+ $(CC) $(CFLAGS) pg_dumpall.o dumputils.o $(EXTRA_OBJS) $(WIN32RES) $(libpq_pgport) $(LDFLAGS) $(LIBS) -o $@$(X)
.PHONY: submake-backend
submake-backend:
diff --git a/src/bin/psql/Makefile b/src/bin/psql/Makefile
index 6533421fba..f72de15085 100644
--- a/src/bin/psql/Makefile
+++ b/src/bin/psql/Makefile
@@ -5,7 +5,7 @@
# Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California
#
-# $PostgreSQL: pgsql/src/bin/psql/Makefile,v 1.52 2005/01/01 20:44:25 tgl Exp $
+# $PostgreSQL: pgsql/src/bin/psql/Makefile,v 1.53 2005/03/25 18:17:13 momjian Exp $
#
#-------------------------------------------------------------------------
@@ -29,7 +29,7 @@ FLEXFLAGS = -Cfe
all: submake-libpq submake-libpgport psql
psql: $(OBJS) $(libpq_builddir)/libpq.a
- $(CC) $(CFLAGS) $(OBJS) $(libpq) $(LDFLAGS) $(LIBS) -o $@$(X)
+ $(CC) $(CFLAGS) $(OBJS) $(libpq_pgport) $(LDFLAGS) $(LIBS) -o $@$(X)
help.o: $(srcdir)/sql_help.h
diff --git a/src/bin/scripts/Makefile b/src/bin/scripts/Makefile
index 12de34ea38..355a5ebfd0 100644
--- a/src/bin/scripts/Makefile
+++ b/src/bin/scripts/Makefile
@@ -5,7 +5,7 @@
# Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California
#
-# $PostgreSQL: pgsql/src/bin/scripts/Makefile,v 1.32 2005/01/01 20:44:26 tgl Exp $
+# $PostgreSQL: pgsql/src/bin/scripts/Makefile,v 1.33 2005/03/25 18:17:14 momjian Exp $
#
#-------------------------------------------------------------------------
@@ -21,7 +21,7 @@ override CPPFLAGS := -DFRONTEND -I$(top_srcdir)/src/bin/pg_dump -I$(top_srcdir)/
all: submake-libpq submake-backend $(PROGRAMS)
%: %.o $(WIN32RES)
- $(CC) $(CFLAGS) $^ $(libpq) $(LDFLAGS) $(LIBS) -o $@$(X)
+ $(CC) $(CFLAGS) $^ $(libpq_pgport) $(LDFLAGS) $(LIBS) -o $@$(X)
createdb: createdb.o common.o dumputils.o $(top_builddir)/src/backend/parser/keywords.o
createlang: createlang.o common.o print.o mbprint.o
diff --git a/src/test/examples/Makefile b/src/test/examples/Makefile
index 0326d42911..b55405d737 100644
--- a/src/test/examples/Makefile
+++ b/src/test/examples/Makefile
@@ -7,7 +7,7 @@ top_builddir = ../../..
include $(top_builddir)/src/Makefile.global
override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS)
-override LDLIBS := $(libpq) -lpgport $(LDLIBS)
+override LDLIBS := $(libpq_pgport) $(LDLIBS)
PROGS = testlibpq testlibpq2 testlibpq3 testlibpq4 testlo