Skip to content

Commit c600a6a

Browse files
committed
I am attaching a patch file that will replace the previous one. It only
contains the patches to Makefile.global.in and Makefile.unixware. The Makefile.unixware patch has been updated to include the contents of LD_LIBRARY_PATH, if present, to the -rpath (-R) option. This change will simplify configuring and building PostgreSQL on systems that support LD_LIBRARY_PATH. You can set LD_LIBRARY_PATH to include all the directorys you want to have searched for additional libraries, run configure, then run make. The paths in LD_LIBRARY_PATH will then be embedded in the executables via the -rpath (-R) option to the linker, and so will not require LD_LIBRARY_PATH in order to run. Billy G. Allie
1 parent cfd2728 commit c600a6a

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

src/Makefile.global.in

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*-makefile-*-
2-
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.155 2002/09/04 22:54:18 petere Exp $
2+
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.156 2002/11/10 00:37:28 momjian Exp $
33

44
#------------------------------------------------------------------------------
55
# All PostgreSQL makefiles include this file and use the variables it sets,
@@ -189,6 +189,9 @@ LIBS = @LIBS@
189189
LD = @LD@
190190
with_gnu_ld = @with_gnu_ld@
191191
ld_R_works = @ld_R_works@
192+
# Set trpath to a list of library paths included in LDFLAGS
193+
# These paths can be added to rpath in the port specific makefiles if needed.
194+
trpath = $(filter -L%,@LDFLAGS@)
192195
LDFLAGS = @LDFLAGS@
193196
LDREL = -r
194197
LDOUT = -o

src/makefiles/Makefile.unixware

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,23 @@ endif
77

88
ifeq ($(ld_R_works), yes)
99
ifeq ($(with_gnu_ld), yes)
10-
rpath = -Wl,-rpath,$(libdir)
10+
# Convert the list of library search paths into -rpath options
11+
# (i.e. "-LpathA -LpathB" -> ",-rpath,pathA,-rpath,pathB"), adding
12+
# the contents of LD_LIBRARY_PATH if it exists.
13+
tpath1=$(shell echo $(trpath) | sed -e 's/ *-L/,-rpath,/g')
14+
ifdef LD_LIBRARY_PATH
15+
tpath2 = ,-rpath,tpath+=$(shell echo $(LD_LIBRARY_PATH) | sed -e 's/:/,-rpath,/g')
16+
endif
17+
rpath = -Wl,-rpath,$(libdir)$(tpath)$(tpath2)
1118
else
12-
rpath = -Wl,-R$(libdir)
19+
# Convert the list of library search paths into a -R option path
20+
# (i.e. "-LpathA -LpathB" -> ":pathA:pathB"), adding the contents of
21+
# LD_LIBRARY_PATH if it exists.
22+
tpath1 = $(shell echo $(trpath) | sed -e 's/ *-L/:/g')
23+
ifdef LD_LIBRARY_PATH
24+
tpath2 = :$(LD_LIBRARY_PATH)
25+
endif
26+
rpath = -Wl,-R$(libdir)$(tpath1)$(tpath2)
1327
endif
1428
endif
1529
shlib_symbolic = -Wl,-Bsymbolic

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