Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit cd75f94

Browse files
committed
Adjust Darwin build to use the default 'two level namespace' linking
method. Fix a number of places where shared libraries were linked without mentioning all the libraries they depend on; the Darwin and AIX ports are known to require this, and it doesn't seem to hurt any other supported platforms. (Hence, remove code in pl/tcl makefile that tried to avoid mentioning other libs if not needed.)
1 parent e9ff025 commit cd75f94

File tree

6 files changed

+18
-37
lines changed

6 files changed

+18
-37
lines changed

src/Makefile.shlib

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Copyright (c) 1998, Regents of the University of California
77
#
88
# IDENTIFICATION
9-
# $Header: /cvsroot/pgsql/src/Makefile.shlib,v 1.70 2003/09/20 21:26:20 tgl Exp $
9+
# $Header: /cvsroot/pgsql/src/Makefile.shlib,v 1.71 2003/09/27 19:35:32 tgl Exp $
1010
#
1111
#-------------------------------------------------------------------------
1212

@@ -82,7 +82,7 @@ endif
8282

8383
ifeq ($(PORTNAME), darwin)
8484
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
85-
LINK.shared = $(COMPILER) $(DARWIN_NAMESPACE_SPEC) -bundle -undefined suppress
85+
LINK.shared = $(COMPILER) -bundle
8686
endif
8787

8888
ifeq ($(PORTNAME), openbsd)

src/interfaces/ecpg/compatlib/Makefile

+3-2
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-
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/compatlib/Makefile,v 1.9 2003/09/27 15:32:47 momjian Exp $
7+
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/compatlib/Makefile,v 1.10 2003/09/27 19:35:32 tgl Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -17,7 +17,8 @@ SO_MAJOR_VERSION= 1
1717
SO_MINOR_VERSION= 0
1818

1919
override CPPFLAGS := -I$(top_srcdir)/src/interfaces/ecpg/include -I$(libpq_srcdir) -I$(top_srcdir)/src/include/utils $(CPPFLAGS) $(THREAD_CPPFLAGS)
20-
SHLIB_LINK = -L../pgtypeslib -lpgtypes -L../ecpglib -lecpg $(THREAD_LIBS)
20+
SHLIB_LINK = -L../ecpglib -lecpg -L../pgtypeslib -lpgtypes $(libpq) \
21+
$(filter -lssl -lcrypto -lcrypt -lm, $(LIBS)) $(THREAD_LIBS)
2122

2223
OBJS= informix.o
2324

src/interfaces/ecpg/ecpglib/Makefile

+3-2
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-
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/Makefile,v 1.8 2003/09/27 15:32:47 momjian Exp $
7+
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/ecpglib/Makefile,v 1.9 2003/09/27 19:35:32 tgl Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -21,7 +21,8 @@ override CPPFLAGS := -I$(top_srcdir)/src/interfaces/ecpg/include -I$(libpq_srcdi
2121
OBJS= execute.o typename.o descriptor.o data.o error.o prepare.o memory.o \
2222
connect.o misc.o
2323

24-
SHLIB_LINK = -L../pgtypeslib -lpgtypes $(libpq) $(THREAD_LIBS)
24+
SHLIB_LINK = -L../pgtypeslib -lpgtypes $(libpq) \
25+
$(filter -lssl -lcrypto -lcrypt -lm, $(LIBS)) $(THREAD_LIBS)
2526

2627
all: all-lib
2728

src/interfaces/libpgtcl/Makefile

+3-7
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-
# $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/Makefile,v 1.30 2002/12/30 17:19:52 tgl Exp $
7+
# $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/Makefile,v 1.31 2003/09/27 19:35:32 tgl Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -20,12 +20,8 @@ override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS) $(TCL_INCLUDE_SPEC)
2020

2121
OBJS= pgtcl.o pgtclCmds.o pgtclId.o
2222

23-
SHLIB_LINK = $(libpq)
24-
25-
# If crypt is a separate library, rather than part of libc, it may need
26-
# to be referenced separately to keep (broken) linkers happy. (This is
27-
# braindead; users of libpq should not need to know what it depends on.)
28-
SHLIB_LINK+= $(filter -L%, $(LDFLAGS)) $(filter -lcrypt, $(LIBS))
23+
SHLIB_LINK = $(TCL_LIB_SPEC) $(TCL_LIBS) $(libpq) \
24+
$(filter -lssl -lcrypto -lcrypt, $(LIBS)) $(THREAD_LIBS)
2925

3026
all: submake-libpq all-lib
3127

src/makefiles/Makefile.darwin

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ AWK= awk
33

44
DLSUFFIX = .so
55
CFLAGS_SL =
6-
ifeq (,$(filter $(host_os), darwin1.0 darwin1.1 darwin1.2))
7-
DARWIN_NAMESPACE_SPEC = -flat_namespace
8-
endif
6+
BE_DLLLIBS= -bundle_loader $(top_builddir)/src/backend/postgres
97

8+
# Rule for building shared libs (currently used only for regression test
9+
# shlib ... should go away, since this is not really enough knowledge)
1010
%.so: %.o
11-
$(CC) $(DARWIN_NAMESPACE_SPEC) -bundle -undefined suppress -o $@ $<
11+
$(CC) -bundle -o $@ $< $(BE_DLLLIBS)
1212

1313
sqlmansect = 7

src/pl/tcl/Makefile

+3-20
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Makefile for the pltcl shared object
44
#
5-
# $Header: /cvsroot/pgsql/src/pl/tcl/Makefile,v 1.39 2002/12/30 17:19:54 tgl Exp $
5+
# $Header: /cvsroot/pgsql/src/pl/tcl/Makefile,v 1.40 2003/09/27 19:35:32 tgl Exp $
66
#
77
#-------------------------------------------------------------------------
88

@@ -11,7 +11,7 @@ top_builddir = ../../..
1111
include $(top_builddir)/src/Makefile.global
1212

1313

14-
override CPPFLAGS := $(CPPFLAGS) $(TCL_INCLUDE_SPEC)
14+
override CPPFLAGS += $(TCL_INCLUDE_SPEC)
1515

1616

1717
# Find out whether Tcl was built as a shared library --- if not, we
@@ -29,24 +29,7 @@ endif
2929
endif
3030

3131

32-
# The following attempts to figure out what libraries need to be
33-
# linked with pltcl. The information comes from the tclConfig.sh
34-
# file, but it's mostly bogus. This just might work.
35-
36-
ifneq ($(TCL_SHLIB_LD_LIBS),)
37-
# link command for a shared lib must mention shared libs it uses
38-
SHLIB_LINK = $(TCL_LIB_SPEC) $(TCL_LIBS) -lc
39-
else
40-
ifeq ($(PORTNAME), hpux)
41-
# link command for a shared lib must mention shared libs it uses,
42-
# even though Tcl doesn't think so...
43-
SHLIB_LINK = $(TCL_LIB_SPEC) $(TCL_LIBS) -lc
44-
else
45-
# link command for a shared lib must NOT mention shared libs it uses
46-
SHLIB_LINK = $(TCL_LIB_SPEC)
47-
endif
48-
endif
49-
32+
SHLIB_LINK = $(BE_DLLLIBS) $(TCL_LIB_SPEC) $(TCL_LIBS) -lc
5033

5134
NAME = pltcl
5235
SO_MAJOR_VERSION = 2

0 commit comments

Comments
 (0)