Skip to content

Commit 4ee24cb

Browse files
committed
Install a cleaner solution to the AIX libpq linking problem, as per
an earlier discussion. Centralize assumptions about what libpq depends on in one place in Makefile.global. I am unconvinced that this list is complete, but since ecpg seems to have gotten along with just these entries, we'll try it this way and see what happens.
1 parent 723af8e commit 4ee24cb

File tree

4 files changed

+17
-21
lines changed

4 files changed

+17
-21
lines changed

contrib/dblink/Makefile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $PostgreSQL: pgsql/contrib/dblink/Makefile,v 1.12 2006/09/10 21:38:26 tgl Exp $
1+
# $PostgreSQL: pgsql/contrib/dblink/Makefile,v 1.13 2006/09/10 22:07:02 tgl Exp $
22

33
MODULE_big = dblink
44
PG_CPPFLAGS = -I$(libpq_srcdir)
@@ -20,6 +20,3 @@ top_builddir = ../..
2020
include $(top_builddir)/src/Makefile.global
2121
include $(top_srcdir)/contrib/contrib-global.mk
2222
endif
23-
24-
# Apparently AIX requires that we mention everything libpq depends on :-(
25-
SHLIB_LINK += $(filter -lintl -lssl -lcrypto, $(LIBS))

src/Makefile.global.in

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*-makefile-*-
2-
# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.227 2006/09/09 03:15:40 tgl Exp $
2+
# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.228 2006/09/10 22:07:02 tgl Exp $
33

44
#------------------------------------------------------------------------------
55
# All PostgreSQL makefiles include this file and use the variables it sets,
@@ -336,23 +336,24 @@ libpq_srcdir = $(top_srcdir)/src/interfaces/libpq
336336
libpq_builddir = $(top_builddir)/src/interfaces/libpq
337337
endif
338338

339-
# This is for use for libraries linking to libpq. Because libpqport
340-
# isn't created with the same link flags as libpq, it can't be used.
341-
libpq = -L$(libpq_builddir) -lpq
339+
# This macro is for use by libraries linking to libpq. (Because libpgport
340+
# isn't created with the same link flags as libpq, it can't be used.)
341+
libpq := -L$(libpq_builddir) -lpq
342342

343-
# If doing static linking, shared library dependency can't be
344-
# used so we specify pthread libs for every usage of libpq
343+
# If doing static linking, shared library dependency info isn't available,
344+
# so add in the libraries that libpq depends on.
345345
ifeq ($(enable_shared), no)
346-
libpq += $(PTHREAD_LIBS)
346+
libpq += $(filter -lintl -lssl -lcrypto -lkrb5 -lcrypt, $(LIBS)) $(PTHREAD_LIBS)
347347
else
348-
# AIX libraries do not remember their required libs so we have to force
349-
# thread dependent libraires in the link
348+
# On AIX even shared libraries do not remember their required libs,
349+
# so again add in what libpq depends on.
350350
ifeq ($(PORTNAME), aix)
351-
libpq += $(PTHREAD_LIBS)
351+
libpq += $(filter -lintl -lssl -lcrypto -lkrb5 -lcrypt, $(LIBS)) $(PTHREAD_LIBS)
352352
endif
353353
endif
354354

355-
# Force clients to pull symbols from the non-shared library libpgport
355+
# This macro is for use by client executables (not libraries) that use libpq.
356+
# We force clients to pull symbols from the non-shared library libpgport
356357
# rather than pulling some libpgport symbols from libpq just because
357358
# libpq uses those functions too. This makes applications less
358359
# dependent on changes in libpq's usage of pgport. To do this we link to

src/interfaces/ecpg/compatlib/Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Copyright (c) 1994, Regents of the University of California
66
#
7-
# $PostgreSQL: pgsql/src/interfaces/ecpg/compatlib/Makefile,v 1.24 2006/08/28 16:13:10 tgl Exp $
7+
# $PostgreSQL: pgsql/src/interfaces/ecpg/compatlib/Makefile,v 1.25 2006/09/10 22:07:02 tgl Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -20,8 +20,7 @@ DLTYPE= library
2020
override CPPFLAGS := -I../include -I$(top_srcdir)/src/interfaces/ecpg/include \
2121
-I$(libpq_srcdir) -I$(top_srcdir)/src/include/utils $(CPPFLAGS)
2222
override CFLAGS += $(PTHREAD_CFLAGS)
23-
SHLIB_LINK = -L../ecpglib -lecpg -L../pgtypeslib -lpgtypes $(libpq) \
24-
$(filter -lintl -lssl -lcrypto -lkrb5 -lcrypt -lm, $(LIBS)) \
23+
SHLIB_LINK = -L../ecpglib -lecpg -L../pgtypeslib -lpgtypes $(libpq) -lm \
2524
$(PTHREAD_LIBS)
2625

2726
OBJS= informix.o

src/interfaces/ecpg/ecpglib/Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Copyright (c) 1994, Regents of the University of California
66
#
7-
# $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/Makefile,v 1.41 2006/08/28 16:13:11 tgl Exp $
7+
# $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/Makefile,v 1.42 2006/09/10 22:07:02 tgl Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -34,8 +34,7 @@ ifneq ($(PORTNAME), win32)
3434
OBJS += thread.o
3535
endif
3636

37-
SHLIB_LINK = -L../pgtypeslib -lpgtypes $(libpq) \
38-
$(filter -lintl -lssl -lcrypto -lkrb5 -lcrypt -lm, $(LIBS)) $(PTHREAD_LIBS)
37+
SHLIB_LINK = -L../pgtypeslib -lpgtypes $(libpq) -lm $(PTHREAD_LIBS)
3938

4039
ifeq ($(PORTNAME), win32)
4140
# Link to shfolder.dll instead of shell32.dll

0 commit comments

Comments
 (0)