changeset 3578:be82ef218872

7192916: Hotspot development launcher should use DYLD_LIBRARY_PATH on OS X Reviewed-by: dholmes, dsamersoff, nloodin
author sla
date Wed, 22 Aug 2012 10:01:51 +0200
parents fce6d7280776
children b3602ff9c1b8
files src/os/posix/launcher/launcher.script
diffstat 1 files changed, 25 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/src/os/posix/launcher/launcher.script	Fri Aug 17 11:57:46 2012 -0700
+++ b/src/os/posix/launcher/launcher.script	Wed Aug 22 10:01:51 2012 +0200
@@ -29,7 +29,7 @@
 # inside Emacs".
 #
 # If the first parameter is "-dbx", HotSpot will be launched inside dbx.
-# 
+#
 # If the first parameter is "-valgrind", HotSpot will be launched
 # inside Valgrind (http://valgrind.kde.org) using the Memcheck skin,
 # and with memory leak detection enabled.  This currently (2005jan19)
@@ -45,19 +45,19 @@
 
 # This is the name of the gdb binary to use
 if [ ! "$GDB" ]
-then 
+then
     GDB=gdb
 fi
 
 # This is the name of the gdb binary to use
 if [ ! "$DBX" ]
-then 
+then
     DBX=dbx
 fi
 
 # This is the name of the Valgrind binary to use
 if [ ! "$VALGRIND" ]
-then 
+then
     VALGRIND=valgrind
 fi
 
@@ -98,7 +98,7 @@
 JDK=
 if [ "${ALT_JAVA_HOME}" = "" ]; then
     . ${MYDIR}/jdkpath.sh
-else 
+else
     JDK=${ALT_JAVA_HOME%%/jre};
 fi
 
@@ -114,22 +114,34 @@
 # any.
 JRE=$JDK/jre
 JAVA_HOME=$JDK
+export JAVA_HOME
+
 ARCH=@@LIBARCH@@
-
 SBP=${MYDIR}:${JRE}/lib/${ARCH}
 
-# Set up a suitable LD_LIBRARY_PATH
 
-if [ -z "$LD_LIBRARY_PATH" ]
+# Set up a suitable LD_LIBRARY_PATH or DYLD_LIBRARY_PATH
+OS=`uname -s`
+if [ "${OS}" = "Darwin" ]
 then
-    LD_LIBRARY_PATH="$SBP"
+    if [ -z "$DYLD_LIBRARY_PATH" ]
+    then
+        DYLD_LIBRARY_PATH="$SBP"
+    else
+        DYLD_LIBRARY_PATH="$SBP:$DYLD_LIBRARY_PATH"
+    fi
+    export DYLD_LIBRARY_PATH
 else
-    LD_LIBRARY_PATH="$SBP:$LD_LIBRARY_PATH"
+    # not 'Darwin'
+    if [ -z "$LD_LIBRARY_PATH" ]
+    then
+        LD_LIBRARY_PATH="$SBP"
+    else
+        LD_LIBRARY_PATH="$SBP:$LD_LIBRARY_PATH"
+    fi
+    export LD_LIBRARY_PATH
 fi
 
-export LD_LIBRARY_PATH
-export JAVA_HOME
-
 JPARMS="$@ $JAVA_ARGS";
 
 # Locate the gamma development launcher