diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.global.in | 19 | ||||
-rw-r--r-- | src/bin/initdb/Makefile | 4 | ||||
-rw-r--r-- | src/bin/pg_ctl/Makefile | 4 | ||||
-rw-r--r-- | src/bin/pg_dump/Makefile | 8 | ||||
-rw-r--r-- | src/bin/psql/Makefile | 4 | ||||
-rw-r--r-- | src/bin/scripts/Makefile | 4 | ||||
-rw-r--r-- | src/test/examples/Makefile | 2 |
7 files changed, 30 insertions, 15 deletions
diff --git a/src/Makefile.global.in b/src/Makefile.global.in index 752866a3dcc..e57265e35f6 100644 --- a/src/Makefile.global.in +++ b/src/Makefile.global.in @@ -1,5 +1,5 @@ # -*-makefile-*- -# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.208.4.3 2005/03/24 23:54:01 tgl Exp $ +# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.208.4.4 2005/03/25 18:18:39 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 7f218991a62..dc7fda24347 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.48.4.1 2005/03/25 18:18:39 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 a64aa94e713..fb3fb075cbd 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.19.4.1 2005/03/25 18:18:40 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 61c13db7a2f..1805d59ffbf 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.59.4.1 2005/03/25 18:18:40 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 6533421fbac..06fe45133f0 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.52.4.1 2005/03/25 18:18:40 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 12de34ea389..269b9e3880d 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.32.4.1 2005/03/25 18:18:41 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 0326d429112..b55405d7372 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 |