aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2002-11-10 00:37:28 +0000
committerBruce Momjian <bruce@momjian.us>2002-11-10 00:37:28 +0000
commitc600a6ac4724ac24cfcbf852837dad4ff772bc47 (patch)
tree451e964b4a540081f0b9a17bd592bca76e33a7e7 /src
parentcfd2728100b1493cea54e2d0ae0f3d545c27805c (diff)
downloadpostgresql-c600a6ac4724ac24cfcbf852837dad4ff772bc47.tar.gz
postgresql-c600a6ac4724ac24cfcbf852837dad4ff772bc47.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.global.in5
-rw-r--r--src/makefiles/Makefile.unixware18
2 files changed, 20 insertions, 3 deletions
diff --git a/src/Makefile.global.in b/src/Makefile.global.in
index e0fd91dc92d..fb4592ec985 100644
--- a/src/Makefile.global.in
+++ b/src/Makefile.global.in
@@ -1,5 +1,5 @@
# -*-makefile-*-
-# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.155 2002/09/04 22:54:18 petere Exp $
+# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.156 2002/11/10 00:37:28 momjian Exp $
#------------------------------------------------------------------------------
# All PostgreSQL makefiles include this file and use the variables it sets,
@@ -189,6 +189,9 @@ LIBS = @LIBS@
LD = @LD@
with_gnu_ld = @with_gnu_ld@
ld_R_works = @ld_R_works@
+# Set trpath to a list of library paths included in LDFLAGS
+# These paths can be added to rpath in the port specific makefiles if needed.
+trpath = $(filter -L%,@LDFLAGS@)
LDFLAGS = @LDFLAGS@
LDREL = -r
LDOUT = -o
diff --git a/src/makefiles/Makefile.unixware b/src/makefiles/Makefile.unixware
index 9e4d715932a..76b52a5cd88 100644
--- a/src/makefiles/Makefile.unixware
+++ b/src/makefiles/Makefile.unixware
@@ -7,9 +7,23 @@ endif
ifeq ($(ld_R_works), yes)
ifeq ($(with_gnu_ld), yes)
- rpath = -Wl,-rpath,$(libdir)
+ # Convert the list of library search paths into -rpath options
+ # (i.e. "-LpathA -LpathB" -> ",-rpath,pathA,-rpath,pathB"), adding
+ # the contents of LD_LIBRARY_PATH if it exists.
+ tpath1=$(shell echo $(trpath) | sed -e 's/ *-L/,-rpath,/g')
+ifdef LD_LIBRARY_PATH
+ tpath2 = ,-rpath,tpath+=$(shell echo $(LD_LIBRARY_PATH) | sed -e 's/:/,-rpath,/g')
+endif
+ rpath = -Wl,-rpath,$(libdir)$(tpath)$(tpath2)
else
- rpath = -Wl,-R$(libdir)
+ # Convert the list of library search paths into a -R option path
+ # (i.e. "-LpathA -LpathB" -> ":pathA:pathB"), adding the contents of
+ # LD_LIBRARY_PATH if it exists.
+ tpath1 = $(shell echo $(trpath) | sed -e 's/ *-L/:/g')
+ifdef LD_LIBRARY_PATH
+ tpath2 = :$(LD_LIBRARY_PATH)
+endif
+ rpath = -Wl,-R$(libdir)$(tpath1)$(tpath2)
endif
endif
shlib_symbolic = -Wl,-Bsymbolic