diff options
| author | Peter Eisentraut <peter_e@gmx.net> | 2000-10-27 23:59:39 +0000 |
|---|---|---|
| committer | Peter Eisentraut <peter_e@gmx.net> | 2000-10-27 23:59:39 +0000 |
| commit | 6707ede8134a3809409364f3cd3d0c6ca2bbfb7d (patch) | |
| tree | 66fe6873489f5999d5d0bf2c1fc553b3e1f25ec3 /src/makefiles | |
| parent | 81024e7d80827620ba4d71e3b5440f8cb43d2652 (diff) | |
| download | postgresql-6707ede8134a3809409364f3cd3d0c6ca2bbfb7d.tar.gz | |
Make use of system-specific linker option to embed shared library search
path into executables and shared libraries (-rpath or -R for most). Can be
disabled with --disable-rpath, since some binary packaging standards do not
like this option.
Diffstat (limited to 'src/makefiles')
| -rw-r--r-- | src/makefiles/Makefile.freebsd | 1 | ||||
| -rw-r--r-- | src/makefiles/Makefile.hpux | 18 | ||||
| -rw-r--r-- | src/makefiles/Makefile.irix5 | 1 | ||||
| -rw-r--r-- | src/makefiles/Makefile.linux | 1 | ||||
| -rw-r--r-- | src/makefiles/Makefile.netbsd | 1 | ||||
| -rw-r--r-- | src/makefiles/Makefile.openbsd | 1 | ||||
| -rw-r--r-- | src/makefiles/Makefile.osf | 3 | ||||
| -rw-r--r-- | src/makefiles/Makefile.solaris | 6 | ||||
| -rw-r--r-- | src/makefiles/Makefile.unixware | 1 |
9 files changed, 23 insertions, 10 deletions
diff --git a/src/makefiles/Makefile.freebsd b/src/makefiles/Makefile.freebsd index 56bb93e809..b9ca6579f9 100644 --- a/src/makefiles/Makefile.freebsd +++ b/src/makefiles/Makefile.freebsd @@ -2,6 +2,7 @@ AROPT = cq ifdef ELF_SYSTEM export_dynamic = -export-dynamic +rpath = -R$(libdir) endif DLSUFFIX = .so diff --git a/src/makefiles/Makefile.hpux b/src/makefiles/Makefile.hpux index 17b3a98c0d..a3eb0ec1cd 100644 --- a/src/makefiles/Makefile.hpux +++ b/src/makefiles/Makefile.hpux @@ -2,13 +2,13 @@ # which we do by linking -lc before -lcurses. (Unfortunately we can't # just not use libcurses.) This also ensures that we get the POSIX signal # routines in libc, not the BSD-like ones in libBSD. -LDFLAGS:= -lc $(LDFLAGS) +LIBS := -lc $(LIBS) # On the other hand, if we don't have POSIX signals, we need to use the # libBSD signal routines. (HPUX 9 and early HPUX 10 releases don't have # POSIX signals.) Make sure libBSD comes before libc in that case. ifeq ($(HAVE_POSIX_SIGNALS), no) - LDFLAGS:= -lBSD $(LDFLAGS) + LIBS := -lBSD $(LIBS) endif # On HPUX 9, rint() is provided only in the PA1.1 version of libm. @@ -19,11 +19,15 @@ ifneq ($(HPUXMATHLIB),) LDFLAGS:= -L /lib/pa1.1 $(LDFLAGS) endif -# On all HPUX versions, embed `libdir' as the shared library search path -# so that the executables don't need SHLIB_PATH to be set, specify -z -# to catch null pointer dereferences, and specify -E to make all symbols -# visible to dynamically linked shared libraries. -LDFLAGS+= -Wl,+b -Wl,$(libdir) -Wl,-z +# 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.) +LDFLAGS += -Wl,+b -Wl,$(libdir) + +# catch null pointer dereferences +LDFLAGS += -Wl,-z + export_dynamic = -Wl,-E AROPT = crs diff --git a/src/makefiles/Makefile.irix5 b/src/makefiles/Makefile.irix5 index cc018523bf..cc5aaf0dad 100644 --- a/src/makefiles/Makefile.irix5 +++ b/src/makefiles/Makefile.irix5 @@ -2,6 +2,7 @@ RANLIB= touch MK_NO_LORDER= true AROPT = crs +rpath = -Wl,-rpath,$(libdir) DLSUFFIX = .so CFLAGS_SL = diff --git a/src/makefiles/Makefile.linux b/src/makefiles/Makefile.linux index 268beb05aa..3834552ec3 100644 --- a/src/makefiles/Makefile.linux +++ b/src/makefiles/Makefile.linux @@ -1,5 +1,6 @@ AROPT = crs export_dynamic = -export-dynamic +rpath = -Wl,-rpath,$(libdir) DLSUFFIX = .so CFLAGS_SL = -fpic diff --git a/src/makefiles/Makefile.netbsd b/src/makefiles/Makefile.netbsd index 79684ecfc1..425267b81b 100644 --- a/src/makefiles/Makefile.netbsd +++ b/src/makefiles/Makefile.netbsd @@ -2,6 +2,7 @@ AROPT = cq ifdef ELF_SYSTEM export_dynamic = -Wl,-E +rpath = -Wl,-R$(libdir) endif DLSUFFIX = .so diff --git a/src/makefiles/Makefile.openbsd b/src/makefiles/Makefile.openbsd index 79684ecfc1..6f2611e063 100644 --- a/src/makefiles/Makefile.openbsd +++ b/src/makefiles/Makefile.openbsd @@ -2,6 +2,7 @@ AROPT = cq ifdef ELF_SYSTEM export_dynamic = -Wl,-E +rpath = -R$(libdir) endif DLSUFFIX = .so diff --git a/src/makefiles/Makefile.osf b/src/makefiles/Makefile.osf index 23156edc9d..2bf0cfe249 100644 --- a/src/makefiles/Makefile.osf +++ b/src/makefiles/Makefile.osf @@ -1,8 +1,7 @@ AROPT = crs DLSUFFIX = .so CFLAGS_SL = +rpath = -rpath $(libdir) %.so: %.o $(LD) -shared -expect_unresolved '*' -o $@ $< - -LDFLAGS += -rpath $(libdir) diff --git a/src/makefiles/Makefile.solaris b/src/makefiles/Makefile.solaris index 8c08f79e03..cf06450062 100644 --- a/src/makefiles/Makefile.solaris +++ b/src/makefiles/Makefile.solaris @@ -1,11 +1,15 @@ -# $Header: /cvsroot/pgsql/src/makefiles/Makefile.solaris,v 1.3 2000/10/21 22:36:13 petere Exp $ +# $Header: /cvsroot/pgsql/src/makefiles/Makefile.solaris,v 1.4 2000/10/27 23:59:39 petere Exp $ AROPT = crs ifeq ($(with_gnu_ld), yes) export_dynamic = -Wl,-E +rpath = -Wl,-rpath,$(libdir) +else +rpath = -Wl,-R$(libdir) endif + DLSUFFIX = .so ifeq ($(GCC), yes) CFLAGS_SL = -fPIC diff --git a/src/makefiles/Makefile.unixware b/src/makefiles/Makefile.unixware index 7e007adc2e..709e2b5c6f 100644 --- a/src/makefiles/Makefile.unixware +++ b/src/makefiles/Makefile.unixware @@ -1,5 +1,6 @@ AROPT = crs export_dynamic = -Wl,-Bexport +rpath = -Wl,-R$(libdir) DLSUFFIX = .so ifeq ($(GCC), yes) CFLAGS_SL = -fpic |
