diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.global.in | 6 | ||||
-rw-r--r-- | src/Makefile.shlib | 14 | ||||
-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 |
11 files changed, 36 insertions, 17 deletions
diff --git a/src/Makefile.global.in b/src/Makefile.global.in index 27dd83ba39..74dc091fee 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.105 2000/10/25 16:13:52 petere Exp $ +# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.106 2000/10/27 23:59:39 petere Exp $ #------------------------------------------------------------------------------ # All PostgreSQL makefiles include this file and use the variables it sets, @@ -115,6 +115,7 @@ with_tk = @with_tk@ enable_odbc = @enable_odbc@ MULTIBYTE = @MULTIBYTE@ enable_shared = @enable_shared@ +enable_rpath = @enable_rpath@ python_extmakefile = @python_extmakefile@ python_moduledir = @python_moduledir@ @@ -213,6 +214,9 @@ ELF_SYSTEM= @ELF_SYS@ # Pull in platform-specific magic include $(top_builddir)/src/Makefile.port +ifeq ($(enable_rpath), yes) +LDFLAGS += $(rpath) +endif ########################################################################## # diff --git a/src/Makefile.shlib b/src/Makefile.shlib index a1495971f4..8f60f3a196 100644 --- a/src/Makefile.shlib +++ b/src/Makefile.shlib @@ -6,7 +6,7 @@ # Copyright (c) 1998, Regents of the University of California # # IDENTIFICATION -# $Header: /cvsroot/pgsql/src/Makefile.shlib,v 1.29 2000/10/27 20:09:48 petere Exp $ +# $Header: /cvsroot/pgsql/src/Makefile.shlib,v 1.30 2000/10/27 23:59:39 petere Exp $ # #------------------------------------------------------------------------- @@ -137,9 +137,6 @@ ifeq ($(PORTNAME), netbsd) shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION) ifdef ELF_SYSTEM LINK.shared = $(COMPILER) -shared -Wl,-soname -Wl,$(soname) - ifneq ($(SHLIB_LINK),) - LINK.shared += -Wl,-R$(libdir) - endif else LINK.shared = $(LD) -x -Bshareable -Bforcearchive endif @@ -148,12 +145,12 @@ endif ifeq ($(PORTNAME), hpux) # HPUX doesn't believe in version numbers for shlibs shlib := lib$(NAME)$(DLSUFFIX) - LINK.shared = $(LD) -b + LINK.shared = $(LD) -b +b $(libdir) endif ifeq ($(PORTNAME), irix5) shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION) - LINK.shared := $(COMPILER) -shared -rpath $(libdir) -set_version sgi$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION) + LINK.shared = $(COMPILER) -shared -set_version sgi$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION) endif ifeq ($(PORTNAME), linux) @@ -197,6 +194,7 @@ ifeq ($(PORTNAME), unixware) LINK.shared = $(CXX) -G endif endif + LINK.shared += -Wl,-z,text endif ifeq ($(PORTNAME), win) @@ -215,6 +213,10 @@ endif # Pull in any extra -L options that the user might have specified. SHLIB_LINK := $(filter -L%, $(LDFLAGS)) $(SHLIB_LINK) +ifeq ($(enable_rpath), yes) +SHLIB_LINK += $(rpath) +endif + endif # enable_shared 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 |