Skip to content

Commit 6d4bcda

Browse files
committed
Fix out-of-order inclusion of -L switches from LDFLAGS on AIX and HPUX.
Per example from Dirk Pirschel.
1 parent d20901a commit 6d4bcda

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/Makefile.shlib

Lines changed: 6 additions & 3 deletions
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-
# $PostgreSQL: pgsql/src/Makefile.shlib,v 1.98 2005/10/28 17:32:22 tgl Exp $
9+
# $PostgreSQL: pgsql/src/Makefile.shlib,v 1.99 2005/12/03 20:16:31 tgl Exp $
1010
#
1111
#-------------------------------------------------------------------------
1212

@@ -76,6 +76,9 @@ ifeq ($(enable_shared), yes)
7676
# Insert -L from LDFLAGS after any -L already present in SHLIB_LINK
7777
SHLIB_LINK := $(filter -L%, $(SHLIB_LINK)) $(filter -L%, $(LDFLAGS)) $(filter-out -L%, $(SHLIB_LINK))
7878

79+
# Need a -L-free version of LDFLAGS to use in combination with SHLIB_LINK
80+
LDFLAGS_NO_L := $(filter-out -L%, $(LDFLAGS))
81+
7982
# Default shlib naming convention used by the majority of platforms
8083
shlib = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
8184
shlib_major = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
@@ -154,7 +157,7 @@ endif
154157
ifeq ($(PORTNAME), hpux)
155158
shlib = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
156159
ifeq ($(with_gnu_ld), yes)
157-
LINK.shared = $(CC) $(LDFLAGS) -shared -Wl,-h -Wl,$(soname)
160+
LINK.shared = $(CC) $(LDFLAGS_NO_L) -shared -Wl,-h -Wl,$(soname)
158161
else
159162
# can't use the CC-syntax rpath pattern here
160163
rpath =
@@ -309,7 +312,7 @@ else # PORTNAME == aix
309312
# AIX case
310313
$(shlib): lib$(NAME).a
311314
$(MKLDEXPORT) lib$(NAME).a > lib$(NAME)$(EXPSUFF)
312-
$(COMPILER) $(LDFLAGS) $(LDFLAGS_SL) -o $@ $< -Wl,-bE:lib$(NAME)$(EXPSUFF) $(SHLIB_LINK)
315+
$(COMPILER) $(LDFLAGS_NO_L) $(LDFLAGS_SL) -o $@ $< -Wl,-bE:lib$(NAME)$(EXPSUFF) $(SHLIB_LINK)
313316

314317
endif # PORTNAME == aix
315318

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy