diff -urN R-3.3.1.old/configure R-3.3.1/configure
--- R-3.3.1.old/configure	2016-10-21 13:04:51.588700987 +0100
+++ R-3.3.1/configure	2016-10-21 13:09:48.000000000 +0100
@@ -777,6 +777,7 @@
 USE_EXPORTFILES_TRUE
 SHLIB_EXT
 SHLIB_LIBADD
+RPATH_LDFLAGS
 DYLIB_UNDEFINED_ALLOWED_FALSE
 DYLIB_UNDEFINED_ALLOWED_TRUE
 INTERNET_LIBS
@@ -22355,7 +22356,7 @@
 
 ### * Checks for libraries.
 
-## Set up LD_LIBRARY_PATH or equivalent.
+## Add -Wl,-rpath, entries to RPATH_LDFLAGS.
 ## <FIXME>
 ## What is this doing *HERE*?
 ## Should be needed for tests using AC_RUN_IFELSE()?
@@ -22388,6 +22389,13 @@
 else
   R_LD_LIBRARY_PATH="${R_LD_LIBRARY_PATH}${separator}${lib}"
 fi
+          separator=""
+test -z "${separator}" && separator=" "
+if test -z "${RPATH_LDFLAGS}"; then
+  RPATH_LDFLAGS="-Wl,-rpath,${lib}"
+else
+  RPATH_LDFLAGS="${RPATH_LDFLAGS}${separator}-Wl,-rpath,${lib}"
+fi
 	  ;;
       esac
     done
@@ -22407,13 +22415,20 @@
     Rshlibpath_var=${shlibpath_var}
 esac
 
-## Export LD_LIBRARY_PATH or equivalent.
+## Export LD_LIBRARY_PATH or equivalent (except we do not want to do that
+## instead we want to use -Wl,-rpath .. only doing this for Linux for now).
 if eval "test -z \"\${${Rshlibpath_var}}\""; then
   eval "${Rshlibpath_var}=\"${R_LD_LIBRARY_PATH}\""
 else
   eval "${Rshlibpath_var}=\"${R_LD_LIBRARY_PATH}${PATH_SEPARATOR}\${${Rshlibpath_var}}\""
 fi
-eval "export ${Rshlibpath_var}"
+case "${host_os}" in
+  linux*)
+    ;;
+  *)
+    eval "export ${Rshlibpath_var}"
+    ;;
+esac
 
 
 ## record how to strip shared/dynamic libraries.
@@ -25074,7 +25089,7 @@
 # flags.
 r_save_CFLAGS=$CFLAGS
 CFLAGS="$CFLAGS $r_verb"
-(eval echo $as_me:25077: \"$ac_link\") >&5
+(eval echo $as_me:25109: \"$ac_link\") >&5
 r_c_v_output=`eval $ac_link 5>&1 2>&1 | grep -v 'Driving:'`
 echo "$r_c_v_output" >&5
 CFLAGS=$r_save_CFLAGS
@@ -25149,7 +25164,7 @@
 # flags.
 r_save_CFLAGS=$CFLAGS
 CFLAGS="$CFLAGS $r_cv_prog_c_v"
-(eval echo $as_me:25152: \"$ac_link\") >&5
+(eval echo $as_me:25184: \"$ac_link\") >&5
 r_c_v_output=`eval $ac_link 5>&1 2>&1 | grep -v 'Driving:'`
 echo "$r_c_v_output" >&5
 CFLAGS=$r_save_CFLAGS
diff -urN R-3.3.1.old/configure.ac R-3.3.1/configure.ac
--- R-3.3.1.old/configure.ac	2016-10-21 13:04:45.171835484 +0100
+++ R-3.3.1/configure.ac	2016-10-21 13:10:13.000000000 +0100
@@ -663,7 +663,7 @@
 
 ### * Checks for libraries.
 
-## Set up LD_LIBRARY_PATH or equivalent.
+## Add -Wl,-rpath, entries to RPATH_LDFLAGS.
 ## <FIXME>
 ## What is this doing *HERE*?
 ## Should be needed for tests using AC_RUN_IFELSE()?
@@ -690,6 +690,7 @@
         -L*)
 	  lib=`echo ${arg} | sed "s/^-L//"`
 	  R_SH_VAR_ADD(R_LD_LIBRARY_PATH, [${lib}], [${PATH_SEPARATOR}])
+          R_SH_VAR_ADD(RPATH_LDFLAGS, [-Wl,-rpath,${lib}])
 	  ;;
       esac
     done
@@ -709,13 +710,20 @@
     Rshlibpath_var=${shlibpath_var}
 esac
 AC_SUBST(shlibpath_var)
-## Export LD_LIBRARY_PATH or equivalent.
+## Export LD_LIBRARY_PATH or equivalent (except we do not want to do that
+## instead we want to use -Wl,-rpath .. only doing this for Linux for now).
 if eval "test -z \"\${${Rshlibpath_var}}\""; then
   eval "${Rshlibpath_var}=\"${R_LD_LIBRARY_PATH}\""
 else
   eval "${Rshlibpath_var}=\"${R_LD_LIBRARY_PATH}${PATH_SEPARATOR}\${${Rshlibpath_var}}\""
 fi
-eval "export ${Rshlibpath_var}"
+case "${host_os}" in
+  linux*)
+    ;;
+  *)
+    eval "export ${Rshlibpath_var}"
+    ;;
+esac
 AC_SUBST(Rshlibpath_var)
 
 ## record how to strip shared/dynamic libraries.
@@ -1706,6 +1714,7 @@
 
 AC_SUBST(MAIN_LD)
 AC_SUBST(MAIN_LDFLAGS)
+AC_SUBST(RPATH_LDFLAGS)
 AC_SUBST(CPICFLAGS)
 AC_SUBST(CXXPICFLAGS)
 AC_SUBST(DYLIB_LD)
diff -urN R-3.3.1.old/etc/ldpaths.in R-3.3.1/etc/ldpaths.in
--- R-3.3.1.old/etc/ldpaths.in	2016-01-09 23:15:11.000000000 +0000
+++ R-3.3.1/etc/ldpaths.in	2016-10-21 13:05:20.052916181 +0100
@@ -1,3 +1,17 @@
+# https://github.com/conda/conda/issues/1679:
+#  Internally R_system() calls system() which
+# uses /bin/sh to launch various programs. If
+# /bin/sh is called with LD_LIBRARY_PATH that
+# loads condas shared libraries things break.
+#  It may be that not setting LD_LIBRARY_PATH
+# causes other things to break, in which case
+# R_system() will need to be modified so that
+# it calls execve() with an environment which
+# has these modifications to LD_LIBRARY_PATH
+# removed which may be tricky to orchestrate
+if [ "$(uname -s)" == "Linux" ]; then
+  return 0
+fi
 : ${JAVA_HOME=@JAVA_HOME@}
 : ${R_JAVA_LD_LIBRARY_PATH=@R_JAVA_LD_LIBRARY_PATH@}
 if test -n "@R_LD_LIBRARY_PATH@"; then
diff -urN R-3.3.1.old/etc/Makeconf.in R-3.3.1/etc/Makeconf.in
--- R-3.3.1.old/etc/Makeconf.in	2016-03-16 23:04:44.000000000 +0000
+++ R-3.3.1/etc/Makeconf.in	2016-10-21 13:05:20.052916181 +0100
@@ -71,7 +71,8 @@
 ## needed to build applications linking to static libR
 MAIN_LD = @MAIN_LD@
 MAIN_LDFLAGS = @MAIN_LDFLAGS@
-MAIN_LINK = $(MAIN_LD) $(MAIN_LDFLAGS) $(LDFLAGS)
+RPATH_LDFLAGS = -Wl,-rpath,$(abs_top_builddir)/lib @RPATH_LDFLAGS@
+MAIN_LINK = $(MAIN_LD) $(MAIN_LDFLAGS) $(LDFLAGS) $(RPATH_LDFLAGS)
 MKINSTALLDIRS = $(R_HOME)/bin/mkinstalldirs
 OBJC = @OBJC@
 OBJCFLAGS = @OBJCFLAGS@ $(LTO)
diff -urN R-3.3.1.old/Makeconf.in R-3.3.1/Makeconf.in
--- R-3.3.1.old/Makeconf.in	2015-09-08 23:15:15.000000000 +0100
+++ R-3.3.1/Makeconf.in	2016-10-21 13:05:20.052916181 +0100
@@ -63,7 +63,8 @@
 MAIN_FFLAGS = @MAIN_FFLAGS@
 MAIN_LD = @MAIN_LD@@BUILD_LTO_TRUE@ $(CFLAGS)
 MAIN_LDFLAGS = @MAIN_LDFLAGS@ @WANT_R_SHLIB_FALSE@ @USE_EXPORTFILES_TRUE@ -Wl,-bE:$(top_builddir)/etc/R.exp
-MAIN_LINK = $(MAIN_LD) $(MAIN_LDFLAGS) $(LIBR0) $(LDFLAGS)
+RPATH_LDFLAGS = -Wl,-rpath,$(abs_top_builddir)/lib @RPATH_LDFLAGS@
+MAIN_LINK = $(MAIN_LD) $(MAIN_LDFLAGS) $(LIBR0) $(LDFLAGS) $(RPATH_LDFLAGS)
 ## need this for bootstrapping
 MKINSTALLDIRS = @R_SHELL@ $(top_srcdir)/src/scripts/mkinstalldirs.in
 NOTANGLE = @NOTANGLE@
