Commit a9ddd649 authored by Tom Lane's avatar Tom Lane

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.
parent b6038484
# -*-makefile-*- # -*-makefile-*-
# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.204 2004/10/20 02:12:07 neilc Exp $ # $PostgreSQL: pgsql/src/Makefile.global.in,v 1.205 2004/11/19 00:41:38 tgl Exp $
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# All PostgreSQL makefiles include this file and use the variables it sets, # All PostgreSQL makefiles include this file and use the variables it sets,
...@@ -284,6 +284,10 @@ ELF_SYSTEM= @ELF_SYS@ ...@@ -284,6 +284,10 @@ ELF_SYSTEM= @ELF_SYS@
# Pull in platform-specific magic # Pull in platform-specific magic
include $(top_builddir)/src/Makefile.port 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) ifeq ($(enable_rpath), yes)
LDFLAGS += $(rpath) LDFLAGS += $(rpath)
endif endif
......
...@@ -14,7 +14,7 @@ endif ...@@ -14,7 +14,7 @@ endif
ifeq ($(DLSUFFIX), .so) ifeq ($(DLSUFFIX), .so)
CFLAGS_SL = -fpic CFLAGS_SL = -fpic
rpath = -Wl,-rpath,$(libdir) rpath = -Wl,-rpath,$(rpathdir)
export_dynamic = -export-dynamic export_dynamic = -export-dynamic
shlib_symbolic = -Wl,-Bsymbolic shlib_symbolic = -Wl,-Bsymbolic
else else
......
...@@ -2,7 +2,7 @@ AROPT = cr ...@@ -2,7 +2,7 @@ AROPT = cr
ifdef ELF_SYSTEM ifdef ELF_SYSTEM
export_dynamic = -export-dynamic export_dynamic = -export-dynamic
rpath = -R$(libdir) rpath = -R$(rpathdir)
shlib_symbolic = -Wl,-Bsymbolic -lc shlib_symbolic = -Wl,-Bsymbolic -lc
endif endif
......
...@@ -16,14 +16,12 @@ endif ...@@ -16,14 +16,12 @@ endif
# correctly in the LP64 data model. # correctly in the LP64 data model.
LIBS := -lxnet $(LIBS) LIBS := -lxnet $(LIBS)
# Embed 'libdir' as the shared library search path so that the executables # Set up rpath so that the executables don't need SHLIB_PATH to be set.
# don't need SHLIB_PATH to be set. (We do not observe the --enable-rpath # (Note: --disable-rpath is a really bad idea on this platform...)
# switch here because you'd get rather bizarre behavior if you leave this
# option off.)
ifeq ($(with_gnu_ld), yes) ifeq ($(with_gnu_ld), yes)
LDFLAGS += -Wl,-rpath -Wl,$(libdir) rpath = -Wl,-rpath,$(rpathdir)
else else
LDFLAGS += -Wl,+b -Wl,$(libdir) rpath = -Wl,+b,$(rpathdir)
endif endif
# catch null pointer dereferences # catch null pointer dereferences
......
MK_NO_LORDER= true MK_NO_LORDER= true
AROPT = crs AROPT = crs
rpath = -Wl,-rpath,$(libdir) rpath = -Wl,-rpath,$(rpathdir)
shlib_symbolic = -Wl,-B,symbolic shlib_symbolic = -Wl,-B,symbolic
DLSUFFIX = .so DLSUFFIX = .so
......
AROPT = crs AROPT = crs
export_dynamic = -Wl,-E export_dynamic = -Wl,-E
rpath = -Wl,-rpath,$(libdir) rpath = -Wl,-rpath,$(rpathdir)
shlib_symbolic = -Wl,-Bsymbolic shlib_symbolic = -Wl,-Bsymbolic
allow_nonpic_in_shlib = yes allow_nonpic_in_shlib = yes
DLSUFFIX = .so DLSUFFIX = .so
......
...@@ -2,10 +2,10 @@ AROPT = cr ...@@ -2,10 +2,10 @@ AROPT = cr
ifdef ELF_SYSTEM ifdef ELF_SYSTEM
export_dynamic = -Wl,-E export_dynamic = -Wl,-E
rpath = -Wl,-R$(libdir) rpath = -Wl,-R$(rpathdir)
shlib_symbolic = -Wl,-Bsymbolic -lc shlib_symbolic = -Wl,-Bsymbolic -lc
else else
rpath = -R$(libdir) rpath = -R$(rpathdir)
endif endif
DLSUFFIX = .so DLSUFFIX = .so
......
...@@ -2,7 +2,7 @@ AROPT = cr ...@@ -2,7 +2,7 @@ AROPT = cr
ifdef ELF_SYSTEM ifdef ELF_SYSTEM
export_dynamic = -Wl,-E export_dynamic = -Wl,-E
rpath = -R$(libdir) rpath = -R$(rpathdir)
shlib_symbolic = -Wl,-Bsymbolic shlib_symbolic = -Wl,-Bsymbolic
endif endif
......
AROPT = crs AROPT = crs
DLSUFFIX = .so DLSUFFIX = .so
CFLAGS_SL = CFLAGS_SL =
rpath = -rpath $(libdir) rpath = -rpath $(rpathdir)
%.so: %.o %.so: %.o
$(LD) -shared -expect_unresolved '*' -o $@ $< $(LD) -shared -expect_unresolved '*' -o $@ $<
......
# $PostgreSQL: pgsql/src/makefiles/Makefile.solaris,v 1.10 2003/11/29 19:52:12 pgsql Exp $ # $PostgreSQL: pgsql/src/makefiles/Makefile.solaris,v 1.11 2004/11/19 00:41:39 tgl Exp $
AROPT = crs AROPT = crs
ifeq ($(with_gnu_ld), yes) ifeq ($(with_gnu_ld), yes)
export_dynamic = -Wl,-E export_dynamic = -Wl,-E
rpath = -Wl,-rpath,$(libdir) rpath = -Wl,-rpath,$(rpathdir)
else else
rpath = -R$(libdir) rpath = -R$(rpathdir)
endif endif
shlib_symbolic = -Wl,-Bsymbolic shlib_symbolic = -Wl,-Bsymbolic
......
...@@ -7,9 +7,9 @@ endif ...@@ -7,9 +7,9 @@ endif
ifeq ($(ld_R_works), yes) ifeq ($(ld_R_works), yes)
ifeq ($(with_gnu_ld), yes) ifeq ($(with_gnu_ld), yes)
rpath = -Wl,-rpath,$(libdir) rpath = -Wl,-rpath,$(rpathdir)
else else
rpath = -Wl,-R$(libdir) rpath = -Wl,-R$(rpathdir)
endif endif
endif endif
shlib_symbolic = -Wl,-Bsymbolic shlib_symbolic = -Wl,-Bsymbolic
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment