Modify the platform-specific makefiles so that macro 'rpath' is defined
authorTom Lane <[email protected]>
Fri, 19 Nov 2004 00:41:39 +0000 (00:41 +0000)
committerTom Lane <[email protected]>
Fri, 19 Nov 2004 00:41:39 +0000 (00:41 +0000)
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.

src/Makefile.global.in
src/makefiles/Makefile.bsdi
src/makefiles/Makefile.freebsd
src/makefiles/Makefile.hpux
src/makefiles/Makefile.irix
src/makefiles/Makefile.linux
src/makefiles/Makefile.netbsd
src/makefiles/Makefile.openbsd
src/makefiles/Makefile.osf
src/makefiles/Makefile.solaris
src/makefiles/Makefile.unixware

index 79241363cc03e5f92e0d880509c6e67af34c9ca1..24c2296c7271e10281ae59a494fc401dfa600791 100644 (file)
@@ -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
index 99be3eebb10fc6e6c27654396cb3ed911476cd81..0257f6367a46128245dfbf23f3db647fa8d82386 100644 (file)
@@ -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
index a9e59604d5a4448c5da0cee8835f685db805ae75..8f41ea4d867ed4cf2debaee3e5bd549d155a858e 100644 (file)
@@ -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
 
index 2ffd791e40109d1ac71d47718ed5bb454a746995..4a1e551ec148456f8585689698bc4d22fd61fb62 100644 (file)
@@ -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
index 4062161d9ef58587b5a68a0683e656ddf8db705d..4486ed05e09d57481052442edbfd22bedd7d0b2f 100644 (file)
@@ -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
index e48ad5a6b105015b973ecef105c22166addf8e71..c473214466e2aa6c459d79955f52f80c65e7a154 100644 (file)
@@ -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
index 531fc1356b5f77433e7013f9298239634bfa7a20..2b6a1e13fd25560f1df6b3a49f47bdb2aa0507cb 100644 (file)
@@ -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
index 66671e675fb074a64dc5c5b1c1e16586d8c23ed7..e35739573cdba6080611899b52bb4fdfb49f583a 100644 (file)
@@ -2,7 +2,7 @@ AROPT = cr
 
 ifdef ELF_SYSTEM
 export_dynamic = -Wl,-E
-rpath = -R$(libdir)
+rpath = -R$(rpathdir)
 shlib_symbolic = -Wl,-Bsymbolic
 endif
 
index 4ee46ccd756b19cefc8692f75a937bdbb1591317..ebd6c30149bcd8c51640fcdd6deca29c896af131 100644 (file)
@@ -1,7 +1,7 @@
 AROPT = crs
 DLSUFFIX = .so
 CFLAGS_SL =
-rpath = -rpath $(libdir)
+rpath = -rpath $(rpathdir)
 
 %.so: %.o
        $(LD) -shared -expect_unresolved '*' -o $@ $<
index a8368a0488ef2313b7682572092e8f79d76150a0..674979abf14c526d7b68745918a5420bde4213a8 100644 (file)
@@ -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
 
index 3372a8e5747003cf61f01cd75e00a5388002267b..e8953756a678110f79db17b92a1edad2593c2240 100644 (file)
@@ -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