summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2004-11-19 00:41:39 +0000
committerTom Lane2004-11-19 00:41:39 +0000
commit6d7cb4477ef9b38c675ff4632b66c9497f73aa81 (patch)
treea6c2d6eb69783e45965d6db2aa85f700d7270a59
parent0801f63f537ef107d59908e21b761ddae9f21176 (diff)
Modify the platform-specific makefiles so that macro 'rpath' is defined
in terms of macro 'rpathdir', as I proposed a few weeks ago. In itself this commit shouldn't change the behavior at all, but it opens the door to using special rpaths for the PL shared libraries, as seems to be needed for plperl in particular.
-rw-r--r--src/Makefile.global.in4
-rw-r--r--src/makefiles/Makefile.bsdi2
-rw-r--r--src/makefiles/Makefile.freebsd2
-rw-r--r--src/makefiles/Makefile.hpux10
-rw-r--r--src/makefiles/Makefile.irix2
-rw-r--r--src/makefiles/Makefile.linux2
-rw-r--r--src/makefiles/Makefile.netbsd4
-rw-r--r--src/makefiles/Makefile.openbsd2
-rw-r--r--src/makefiles/Makefile.osf2
-rw-r--r--src/makefiles/Makefile.solaris4
-rw-r--r--src/makefiles/Makefile.unixware4
11 files changed, 20 insertions, 18 deletions
diff --git a/src/Makefile.global.in b/src/Makefile.global.in
index 79241363cc..24c2296c72 100644
--- a/src/Makefile.global.in
+++ b/src/Makefile.global.in
@@ -284,6 +284,10 @@ ELF_SYSTEM= @ELF_SYS@
# Pull in platform-specific magic
include $(top_builddir)/src/Makefile.port
+# Set up rpath if enabled. By default it will point to our libdir,
+# but individual Makefiles can force other rpath paths if needed.
+rpathdir = $(libdir)
+
ifeq ($(enable_rpath), yes)
LDFLAGS += $(rpath)
endif
diff --git a/src/makefiles/Makefile.bsdi b/src/makefiles/Makefile.bsdi
index 99be3eebb1..0257f6367a 100644
--- a/src/makefiles/Makefile.bsdi
+++ b/src/makefiles/Makefile.bsdi
@@ -14,7 +14,7 @@ endif
ifeq ($(DLSUFFIX), .so)
CFLAGS_SL = -fpic
-rpath = -Wl,-rpath,$(libdir)
+rpath = -Wl,-rpath,$(rpathdir)
export_dynamic = -export-dynamic
shlib_symbolic = -Wl,-Bsymbolic
else
diff --git a/src/makefiles/Makefile.freebsd b/src/makefiles/Makefile.freebsd
index a9e59604d5..8f41ea4d86 100644
--- a/src/makefiles/Makefile.freebsd
+++ b/src/makefiles/Makefile.freebsd
@@ -2,7 +2,7 @@ AROPT = cr
ifdef ELF_SYSTEM
export_dynamic = -export-dynamic
-rpath = -R$(libdir)
+rpath = -R$(rpathdir)
shlib_symbolic = -Wl,-Bsymbolic -lc
endif
diff --git a/src/makefiles/Makefile.hpux b/src/makefiles/Makefile.hpux
index 2ffd791e40..4a1e551ec1 100644
--- a/src/makefiles/Makefile.hpux
+++ b/src/makefiles/Makefile.hpux
@@ -16,14 +16,12 @@ endif
# correctly in the LP64 data model.
LIBS := -lxnet $(LIBS)
-# Embed 'libdir' as the shared library search path so that the executables
-# don't need SHLIB_PATH to be set. (We do not observe the --enable-rpath
-# switch here because you'd get rather bizarre behavior if you leave this
-# option off.)
+# Set up rpath so that the executables don't need SHLIB_PATH to be set.
+# (Note: --disable-rpath is a really bad idea on this platform...)
ifeq ($(with_gnu_ld), yes)
- LDFLAGS += -Wl,-rpath -Wl,$(libdir)
+ rpath = -Wl,-rpath,$(rpathdir)
else
- LDFLAGS += -Wl,+b -Wl,$(libdir)
+ rpath = -Wl,+b,$(rpathdir)
endif
# catch null pointer dereferences
diff --git a/src/makefiles/Makefile.irix b/src/makefiles/Makefile.irix
index 4062161d9e..4486ed05e0 100644
--- a/src/makefiles/Makefile.irix
+++ b/src/makefiles/Makefile.irix
@@ -1,6 +1,6 @@
MK_NO_LORDER= true
AROPT = crs
-rpath = -Wl,-rpath,$(libdir)
+rpath = -Wl,-rpath,$(rpathdir)
shlib_symbolic = -Wl,-B,symbolic
DLSUFFIX = .so
diff --git a/src/makefiles/Makefile.linux b/src/makefiles/Makefile.linux
index e48ad5a6b1..c473214466 100644
--- a/src/makefiles/Makefile.linux
+++ b/src/makefiles/Makefile.linux
@@ -1,6 +1,6 @@
AROPT = crs
export_dynamic = -Wl,-E
-rpath = -Wl,-rpath,$(libdir)
+rpath = -Wl,-rpath,$(rpathdir)
shlib_symbolic = -Wl,-Bsymbolic
allow_nonpic_in_shlib = yes
DLSUFFIX = .so
diff --git a/src/makefiles/Makefile.netbsd b/src/makefiles/Makefile.netbsd
index 531fc1356b..2b6a1e13fd 100644
--- a/src/makefiles/Makefile.netbsd
+++ b/src/makefiles/Makefile.netbsd
@@ -2,10 +2,10 @@ AROPT = cr
ifdef ELF_SYSTEM
export_dynamic = -Wl,-E
-rpath = -Wl,-R$(libdir)
+rpath = -Wl,-R$(rpathdir)
shlib_symbolic = -Wl,-Bsymbolic -lc
else
-rpath = -R$(libdir)
+rpath = -R$(rpathdir)
endif
DLSUFFIX = .so
diff --git a/src/makefiles/Makefile.openbsd b/src/makefiles/Makefile.openbsd
index 66671e675f..e35739573c 100644
--- a/src/makefiles/Makefile.openbsd
+++ b/src/makefiles/Makefile.openbsd
@@ -2,7 +2,7 @@ AROPT = cr
ifdef ELF_SYSTEM
export_dynamic = -Wl,-E
-rpath = -R$(libdir)
+rpath = -R$(rpathdir)
shlib_symbolic = -Wl,-Bsymbolic
endif
diff --git a/src/makefiles/Makefile.osf b/src/makefiles/Makefile.osf
index 4ee46ccd75..ebd6c30149 100644
--- a/src/makefiles/Makefile.osf
+++ b/src/makefiles/Makefile.osf
@@ -1,7 +1,7 @@
AROPT = crs
DLSUFFIX = .so
CFLAGS_SL =
-rpath = -rpath $(libdir)
+rpath = -rpath $(rpathdir)
%.so: %.o
$(LD) -shared -expect_unresolved '*' -o $@ $<
diff --git a/src/makefiles/Makefile.solaris b/src/makefiles/Makefile.solaris
index a8368a0488..674979abf1 100644
--- a/src/makefiles/Makefile.solaris
+++ b/src/makefiles/Makefile.solaris
@@ -4,9 +4,9 @@ AROPT = crs
ifeq ($(with_gnu_ld), yes)
export_dynamic = -Wl,-E
-rpath = -Wl,-rpath,$(libdir)
+rpath = -Wl,-rpath,$(rpathdir)
else
-rpath = -R$(libdir)
+rpath = -R$(rpathdir)
endif
shlib_symbolic = -Wl,-Bsymbolic
diff --git a/src/makefiles/Makefile.unixware b/src/makefiles/Makefile.unixware
index 3372a8e574..e8953756a6 100644
--- a/src/makefiles/Makefile.unixware
+++ b/src/makefiles/Makefile.unixware
@@ -7,9 +7,9 @@ endif
ifeq ($(ld_R_works), yes)
ifeq ($(with_gnu_ld), yes)
- rpath = -Wl,-rpath,$(libdir)
+ rpath = -Wl,-rpath,$(rpathdir)
else
- rpath = -Wl,-R$(libdir)
+ rpath = -Wl,-R$(rpathdir)
endif
endif
shlib_symbolic = -Wl,-Bsymbolic