The R Project SVN R

Rev

Blame | Last modification | View Log | Download | RSS feed

--- r-base-1.3.1.orig/src/scripts/R.sh.in
+++ r-base-1.3.1/src/scripts/R.sh.in
@@ -12,10 +12,27 @@
 ## NOTE:
 ## We must set this here rather than in the main binary.
 : ${R_LD_LIBRARY_PATH=${R_HOME}/bin:@R_LD_LIBRARY_PATH@}
+## NOTE:
+## We must read this to find Atlas' location (as long as ldconfig isn't fixed)
+if test -r /etc/ld.so.conf; then
+  ws="[        ]" # space and tab
+  PARSED_LD_LIBRARY_PATH=`cat /etc/ld.so.conf | \
+    sed "/^#/d; s/,/:/g; s/${ws}${ws}*/:/g" | grep atlas | \
+    tr '\n' ':' | sed 's/\(.*\):$/\1/' `
+fi
+## Now put them all together depending on the 2 x 2 cases
 if test -z "${@shlibpath_var@}"; then
-  @shlibpath_var@="${R_LD_LIBRARY_PATH}"
+  if test -z "${PARSED_LD_LIBRARY_PATH}"; then
+    @shlibpath_var@="${R_LD_LIBRARY_PATH}"
+  else
+    @shlibpath_var@="${PARSED_LD_LIBRARY_PATH}:${R_LD_LIBRARY_PATH}"
+  fi
 else
-  @shlibpath_var@="${R_LD_LIBRARY_PATH}:${@shlibpath_var@}"
+  if test -z "${PARSED_LD_LIBRARY_PATH}"; then
+    @shlibpath_var@="${R_LD_LIBRARY_PATH}:${@shlibpath_var@}"
+  else
+    @shlibpath_var@="${PARSED_LD_LIBRARY_PATH}:${R_LD_LIBRARY_PATH}:${@shlibpath_var@}"
+  fi
 fi
 export @shlibpath_var@