Index: etc/config/sunpro.config
===================================================================
--- etc/config/sunpro.config	(revision 475263)
+++ etc/config/sunpro.config	(working copy)
@@ -17,7 +17,7 @@
 CXXFLAGS        = -library=%none
 CXXPRELINK      = 
 CPPFLAGS        =
-LDFLAGS         = -library=%none -L$(LIBDIR)
+LDFLAGS         = -library=%none
 LDSOFLAGS       = -G
 
 # use CC to invoke the compiler (needed to pick up template
@@ -62,8 +62,8 @@
     LIBTHREAD  = -lthread
 endif
 
-MULTI_LDFLAGS_POSIX    = -mt $(LIBTHREAD)
-MULTI_LDFLAGS_SOLARIS  = -mt $(LIBPTHREAD)
+MULTI_LDFLAGS_POSIX    = -mt $(LIBPTHREAD)
+MULTI_LDFLAGS_SOLARIS  = -mt $(LIBTHREAD)
 MULTI_LDFLAGS_DCE      =
 
 # POSIX
Index: etc/config/acc.config
===================================================================
--- etc/config/acc.config	(revision 475263)
+++ etc/config/acc.config	(working copy)
@@ -58,14 +58,14 @@
 CXXFLAGS        = -AA "$$"(_CXXOPTS)
 CXXPRELINK      = 
 CPPFLAGS        = "$$"(_CPPOPTS)
-LDFLAGS         = -AA +nostl -Wl,+s -L$(LIBDIR) "$$"(_LDOPTS)
+LDFLAGS         = -AA +nostl -Wl,+s "$$"(_LDOPTS)
 else
 CXXFLAGS        = -Aa +nostl "$$"(_CXXOPTS)
 CXXPRELINK      = 
 CPPFLAGS        = -I$(TOPDIR)/include/ansi -I/usr/include "$$"(_CPPOPTS)
 # -Wl,+s allows the dynamic loader to consider LD_LIBRARY_PATH (LP64)
 # and SHLIB_PATH when loading an executable into memory
-LDFLAGS         = -Aa +nostl -Wl,+s -Wl,+vnocompatwarnings -L$(LIBDIR) "$$"(_LDOPTS)
+LDFLAGS         = -Aa +nostl -Wl,+s -Wl,+vnocompatwarnings "$$"(_LDOPTS)
 endif
 
 
@@ -79,7 +79,7 @@
 # shared/static library options
 SHARED_CXXFLAGS =
 SHARED_CPPFLAGS =
-SHARED_LDFLAGS  =
+SHARED_LDFLAGS  = -Wl,+b$(LIBDIR)
 SHARED_SUFFIX   = .sl
 
 STATIC_CXXFLAGS =
Index: etc/config/mipspro.config
===================================================================
--- etc/config/mipspro.config	(revision 475263)
+++ etc/config/mipspro.config	(working copy)
@@ -27,7 +27,7 @@
 
 
 # disable warnings about libs that aren't being used to resolve any symbols
-LDFLAGS         = -Wl,-woff,84 -L$(LIBDIR)
+LDFLAGS         = -Wl,-woff,84
 
 # use the undocumented -LANG:std=off option to prevent linking
 # with the native C++ Standard Library
@@ -47,7 +47,7 @@
 # shared/static library options
 SHARED_CXXFLAGS =
 SHARED_CPPFLAGS =
-SHARED_LDFLAGS  =
+SHARED_LDFLAGS  = -Wl,-rpath,$(LIBDIR)
 
 STATIC_CXXFLAGS =
 STATIC_CPPFLAGS =
Index: etc/config/gcc.config
===================================================================
--- etc/config/gcc.config	(revision 475263)
+++ etc/config/gcc.config	(working copy)
@@ -132,7 +132,31 @@
 # shared/static library options
 SHARED_CXXFLAGS = 
 SHARED_CPPFLAGS =
-SHARED_LDFLAGS  =
+ifeq ($(OSNAME),Linux)
+  SHARED_LDFLAGS = -Wl,-R$(LIBDIR)
+else
+  ifeq ($(OSNAME),SunOS)
+    SHARED_LDFLAGS = -Wl,-R$(LIBDIR)
+  else
+    ifeq ($(OSNAME),AIX)
+      SHARED_LDFLAGS = -Wl,-bsvr4,-R$(LIBDIR)
+    else
+      ifeq ($(OSNAME),HP-UX)
+        SHARED_LDFLAGS = -Wl,+b$(LIBDIR)
+      else
+        ifeq ($(OSNAME),IRIX64)
+          SHARED_LDFLAGS = -Wl,-rpath,$(LIBDIR)
+        else
+          ifeq ($(OSNAME),OSF1)
+            SHARED_LDFLAGS = -Wl,-rpath,$(LIBDIR)
+          else
+            SHARED_LDFLAGS =
+          endif
+        endif
+      endif
+    endif
+  endif
+endif
 
 ifeq ($(OSNAME),AIX)
   SHARED_SUFFIX   = .a
Index: etc/config/icc.config
===================================================================
--- etc/config/icc.config	(revision 475263)
+++ etc/config/icc.config	(working copy)
@@ -42,7 +42,7 @@
 # shared/archive library options
 SHARED_CXXFLAGS =
 SHARED_CPPFLAGS =
-SHARED_LDFLAGS  =
+SHARED_LDFLAGS  = -Wl,-R$(LIBDIR)
 
 STATIC_CXXFLAGS =
 STATIC_CPPFLAGS =
Index: etc/config/makefile.rules
===================================================================
--- etc/config/makefile.rules	(revision 475263)
+++ etc/config/makefile.rules	(working copy)
@@ -86,7 +86,7 @@
 
 # produce a .out file by running the executable
 %.out: %
-	LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(LIBDIR) ./$< >$@ 2>&1
+	./$< >$@ 2>&1
 
 # create a script that when run first builds the executable and then runs it
 # done to save even more space than `NO_DOT_O' on constrained systems
@@ -111,10 +111,9 @@
 # for all "top level" tests that failed to build, find and build all
 # subtests (the little tests the main test consists of)
 run runall run_all: $(BINDIR)/exec
-	@(LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(LIBDIR);                    \
-        PATH=$$PATH:.;                                                    \
+	@(PATH=$$PATH:.;                                                    \
         TOPDIR=$(TOPDIR);                                                 \
-        export LD_LIBRARY_PATH PATH TOPDIR;                               \
+        export PATH TOPDIR;                                               \
         report=../$(REPORTFILE)-`date +%m.%d.%y-%H:%M`;                   \
         if [ -z "$(RUNTARGET)" ];  then                                   \
             trap "rm $$report" 2 ;                                        \
Index: etc/config/osf_cxx.config
===================================================================
--- etc/config/osf_cxx.config	(revision 475263)
+++ etc/config/osf_cxx.config	(working copy)
@@ -35,7 +35,7 @@
 # shared/static library option
 SHARED_CXXFLAGS = 
 SHARED_CPPFLAGS = -D_RWSTD_SHARED_LIB
-SHARED_LDFLAGS  =
+SHARED_LDFLAGS  = -rpath $(LIBDIR)
 
 STATIC_CXXFLAGS =
 STATIC_CPPFLAGS =
Index: etc/config/vacpp.config
===================================================================
--- etc/config/vacpp.config	(revision 475263)
+++ etc/config/vacpp.config	(working copy)
@@ -111,7 +111,7 @@
 # shared/archive library options
 SHARED_CXXFLAGS = 
 SHARED_CPPFLAGS =
-SHARED_LDFLAGS  = 
+SHARED_LDFLAGS  = -Wl,-bsvr4,-R$(LIBDIR)
 
 ifeq ($(rtl_enabled),1)
   SHARED_SUFFIX = .so

