1
0
mirror of https://github.com/postgres/postgres.git synced 2025-04-22 23:02:54 +03:00

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.
This commit is contained in:
Tom Lane 2006-09-10 22:07:02 +00:00
parent 723af8e67a
commit 4ee24cbb55
4 changed files with 17 additions and 21 deletions

View File

@ -1,4 +1,4 @@
# $PostgreSQL: pgsql/contrib/dblink/Makefile,v 1.12 2006/09/10 21:38:26 tgl Exp $ # $PostgreSQL: pgsql/contrib/dblink/Makefile,v 1.13 2006/09/10 22:07:02 tgl Exp $
MODULE_big = dblink MODULE_big = dblink
PG_CPPFLAGS = -I$(libpq_srcdir) PG_CPPFLAGS = -I$(libpq_srcdir)
@ -20,6 +20,3 @@ top_builddir = ../..
include $(top_builddir)/src/Makefile.global include $(top_builddir)/src/Makefile.global
include $(top_srcdir)/contrib/contrib-global.mk include $(top_srcdir)/contrib/contrib-global.mk
endif endif
# Apparently AIX requires that we mention everything libpq depends on :-(
SHLIB_LINK += $(filter -lintl -lssl -lcrypto, $(LIBS))

View File

@ -1,5 +1,5 @@
# -*-makefile-*- # -*-makefile-*-
# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.227 2006/09/09 03:15:40 tgl Exp $ # $PostgreSQL: pgsql/src/Makefile.global.in,v 1.228 2006/09/10 22:07:02 tgl Exp $
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# All PostgreSQL makefiles include this file and use the variables it sets, # All PostgreSQL makefiles include this file and use the variables it sets,
@ -336,23 +336,24 @@ libpq_srcdir = $(top_srcdir)/src/interfaces/libpq
libpq_builddir = $(top_builddir)/src/interfaces/libpq libpq_builddir = $(top_builddir)/src/interfaces/libpq
endif endif
# This is for use for libraries linking to libpq. Because libpqport # This macro is for use by libraries linking to libpq. (Because libpgport
# isn't created with the same link flags as libpq, it can't be used. # isn't created with the same link flags as libpq, it can't be used.)
libpq = -L$(libpq_builddir) -lpq libpq := -L$(libpq_builddir) -lpq
# If doing static linking, shared library dependency can't be # If doing static linking, shared library dependency info isn't available,
# used so we specify pthread libs for every usage of libpq # so add in the libraries that libpq depends on.
ifeq ($(enable_shared), no) ifeq ($(enable_shared), no)
libpq += $(PTHREAD_LIBS) libpq += $(filter -lintl -lssl -lcrypto -lkrb5 -lcrypt, $(LIBS)) $(PTHREAD_LIBS)
else else
# AIX libraries do not remember their required libs so we have to force # On AIX even shared libraries do not remember their required libs,
# thread dependent libraires in the link # so again add in what libpq depends on.
ifeq ($(PORTNAME), aix) ifeq ($(PORTNAME), aix)
libpq += $(PTHREAD_LIBS) libpq += $(filter -lintl -lssl -lcrypto -lkrb5 -lcrypt, $(LIBS)) $(PTHREAD_LIBS)
endif endif
endif endif
# Force clients to pull symbols from the non-shared library libpgport # This macro is for use by client executables (not libraries) that use libpq.
# We force clients to pull symbols from the non-shared library libpgport
# rather than pulling some libpgport symbols from libpq just because # rather than pulling some libpgport symbols from libpq just because
# libpq uses those functions too. This makes applications less # libpq uses those functions too. This makes applications less
# dependent on changes in libpq's usage of pgport. To do this we link to # dependent on changes in libpq's usage of pgport. To do this we link to

View File

@ -4,7 +4,7 @@
# #
# Copyright (c) 1994, Regents of the University of California # Copyright (c) 1994, Regents of the University of California
# #
# $PostgreSQL: pgsql/src/interfaces/ecpg/compatlib/Makefile,v 1.24 2006/08/28 16:13:10 tgl Exp $ # $PostgreSQL: pgsql/src/interfaces/ecpg/compatlib/Makefile,v 1.25 2006/09/10 22:07:02 tgl Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
@ -20,8 +20,7 @@ DLTYPE= library
override CPPFLAGS := -I../include -I$(top_srcdir)/src/interfaces/ecpg/include \ override CPPFLAGS := -I../include -I$(top_srcdir)/src/interfaces/ecpg/include \
-I$(libpq_srcdir) -I$(top_srcdir)/src/include/utils $(CPPFLAGS) -I$(libpq_srcdir) -I$(top_srcdir)/src/include/utils $(CPPFLAGS)
override CFLAGS += $(PTHREAD_CFLAGS) override CFLAGS += $(PTHREAD_CFLAGS)
SHLIB_LINK = -L../ecpglib -lecpg -L../pgtypeslib -lpgtypes $(libpq) \ SHLIB_LINK = -L../ecpglib -lecpg -L../pgtypeslib -lpgtypes $(libpq) -lm \
$(filter -lintl -lssl -lcrypto -lkrb5 -lcrypt -lm, $(LIBS)) \
$(PTHREAD_LIBS) $(PTHREAD_LIBS)
OBJS= informix.o OBJS= informix.o

View File

@ -4,7 +4,7 @@
# #
# Copyright (c) 1994, Regents of the University of California # Copyright (c) 1994, Regents of the University of California
# #
# $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/Makefile,v 1.41 2006/08/28 16:13:11 tgl Exp $ # $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/Makefile,v 1.42 2006/09/10 22:07:02 tgl Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
@ -34,8 +34,7 @@ ifneq ($(PORTNAME), win32)
OBJS += thread.o OBJS += thread.o
endif endif
SHLIB_LINK = -L../pgtypeslib -lpgtypes $(libpq) \ SHLIB_LINK = -L../pgtypeslib -lpgtypes $(libpq) -lm $(PTHREAD_LIBS)
$(filter -lintl -lssl -lcrypto -lkrb5 -lcrypt -lm, $(LIBS)) $(PTHREAD_LIBS)
ifeq ($(PORTNAME), win32) ifeq ($(PORTNAME), win32)
# Link to shfolder.dll instead of shell32.dll # Link to shfolder.dll instead of shell32.dll