6
6
# Copyright (c) 1998, Regents of the University of California
7
7
#
8
8
# IDENTIFICATION
9
- # $PostgreSQL: pgsql/src/Makefile.shlib,v 1.94 2005/07/13 02:11:57 momjian Exp $
9
+ # $PostgreSQL: pgsql/src/Makefile.shlib,v 1.95 2005/07/13 17:00:44 tgl Exp $
10
10
#
11
11
#-------------------------------------------------------------------------
12
12
@@ -73,6 +73,9 @@ LINK.static = $(AR) $(AROPT)
73
73
74
74
ifeq ($(enable_shared), yes)
75
75
76
+ # Insert -L from LDFLAGS after any -L already present in SHLIB_LINK
77
+ SHLIB_LINK := $(filter -L%, $(SHLIB_LINK)) $(filter -L%, $(LDFLAGS)) $(filter-out -L%, $(SHLIB_LINK))
78
+
76
79
# Default shlib naming convention used by the majority of platforms
77
80
shlib = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
78
81
shlib_major = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
@@ -150,9 +153,6 @@ endif
150
153
151
154
ifeq ($(PORTNAME), hpux)
152
155
shlib = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
153
- ifeq ($(GCC), yes)
154
- SHLIB_LINK += `$(CC) $(LDFLAGS) -print-libgcc-file-name`
155
- endif
156
156
ifeq ($(with_gnu_ld), yes)
157
157
LINK.shared = $(CC) $(LDFLAGS) -shared -Wl,-h -Wl,$(soname)
158
158
else
@@ -168,9 +168,13 @@ ifeq ($(PORTNAME), hpux)
168
168
# ld can find the same libraries gcc does. Make sure it goes after any
169
169
# -L switches provided explicitly.
170
170
ifeq ($(GCC), yes)
171
- SHLIB_LINK += -L /usr/local/lib
171
+ SHLIB_LINK := $(filter -L%, $(SHLIB_LINK)) -L /usr/local/lib $(filter-out -L%, $(SHLIB_LINK))
172
172
endif
173
173
endif
174
+ # do this last so above filtering doesn't pull out -L switches in LDFLAGS
175
+ ifeq ($(GCC), yes)
176
+ SHLIB_LINK += `$(CC) $(LDFLAGS) -print-libgcc-file-name`
177
+ endif
174
178
endif
175
179
176
180
ifeq ($(PORTNAME), irix)
@@ -247,7 +251,6 @@ ifeq ($(PORTNAME), beos)
247
251
SHLIB_LINK += -ltermcap -lstdc++.r4 -lbind -lsocket -L/boot/develop/lib/x86
248
252
endif
249
253
250
- SHLIB_LINK := $(filter -L%, $(SHLIB_LINK)) $(filter -L%, $(LDFLAGS)) $(filter-out -L%, $(SHLIB_LINK))
251
254
ifeq ($(enable_rpath), yes)
252
255
SHLIB_LINK += $(rpath)
253
256
endif
0 commit comments