equal
deleted
inserted
replaced
1 #!/bin/sh |
1 #!/bin/sh |
2 |
2 |
3 # Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. |
3 # Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved. |
4 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
5 # |
5 # |
6 # This code is free software; you can redistribute it and/or modify it |
6 # This code is free software; you can redistribute it and/or modify it |
7 # under the terms of the GNU General Public License version 2 only, as |
7 # under the terms of the GNU General Public License version 2 only, as |
8 # published by the Free Software Foundation. |
8 # published by the Free Software Foundation. |
67 # |
67 # |
68 # End of user changeable parameters ----------------------------------------- |
68 # End of user changeable parameters ----------------------------------------- |
69 # |
69 # |
70 |
70 |
71 # Make sure the paths are fully specified, i.e. they must begin with /. |
71 # Make sure the paths are fully specified, i.e. they must begin with /. |
72 SCRIPT=$(cd $(dirname $0) && pwd)/$(basename $0) |
72 REL_MYDIR=`dirname $0` |
73 RUNDIR=$(pwd) |
73 MYDIR=`cd $REL_MYDIR && pwd` |
74 |
74 |
75 # Look whether the user wants to run inside gdb |
75 # Look whether the user wants to run inside gdb |
76 case "$1" in |
76 case "$1" in |
77 -gdb) |
77 -gdb) |
78 MODE=gdb |
78 MODE=gdb |
93 *) |
93 *) |
94 MODE=run |
94 MODE=run |
95 ;; |
95 ;; |
96 esac |
96 esac |
97 |
97 |
98 # Find out the absolute path to this script |
|
99 MYDIR=$(cd $(dirname $SCRIPT) && pwd) |
|
100 |
|
101 JDK= |
98 JDK= |
102 if [ "${ALT_JAVA_HOME}" = "" ]; then |
99 if [ "${ALT_JAVA_HOME}" = "" ]; then |
103 source ${MYDIR}/jdkpath.sh |
100 . ${MYDIR}/jdkpath.sh |
104 else |
101 else |
105 JDK=${ALT_JAVA_HOME%%/jre}; |
102 JDK=${ALT_JAVA_HOME%%/jre}; |
106 fi |
103 fi |
107 |
104 |
108 if [ "${JDK}" = "" ]; then |
105 if [ "${JDK}" = "" ]; then |
117 # any. |
114 # any. |
118 JRE=$JDK/jre |
115 JRE=$JDK/jre |
119 JAVA_HOME=$JDK |
116 JAVA_HOME=$JDK |
120 ARCH=@@LIBARCH@@ |
117 ARCH=@@LIBARCH@@ |
121 |
118 |
122 # Find out the absolute path to this script |
|
123 MYDIR=$(cd $(dirname $SCRIPT) && pwd) |
|
124 |
|
125 SBP=${MYDIR}:${JRE}/lib/${ARCH} |
119 SBP=${MYDIR}:${JRE}/lib/${ARCH} |
126 |
120 |
127 # Set up a suitable LD_LIBRARY_PATH |
121 # Set up a suitable LD_LIBRARY_PATH |
128 |
122 |
129 if [ -z "$LD_LIBRARY_PATH" ] |
123 if [ -z "$LD_LIBRARY_PATH" ] |
144 echo Error: Cannot find the gamma development launcher \"$LAUNCHER\" |
138 echo Error: Cannot find the gamma development launcher \"$LAUNCHER\" |
145 exit 1 |
139 exit 1 |
146 fi |
140 fi |
147 |
141 |
148 GDBSRCDIR=$MYDIR |
142 GDBSRCDIR=$MYDIR |
149 BASEDIR=$(cd $MYDIR/../../.. && pwd) |
143 BASEDIR=`cd $MYDIR/../../.. && pwd` |
150 |
144 |
151 init_gdb() { |
145 init_gdb() { |
152 # Create a gdb script in case we should run inside gdb |
146 # Create a gdb script in case we should run inside gdb |
153 GDBSCR=/tmp/hsl.$$ |
147 GDBSCR=/tmp/hsl.$$ |
154 rm -f $GDBSCR |
148 rm -f $GDBSCR |
177 ;; |
171 ;; |
178 gud) |
172 gud) |
179 init_gdb |
173 init_gdb |
180 # First find out what emacs version we're using, so that we can |
174 # First find out what emacs version we're using, so that we can |
181 # use the new pretty GDB mode if emacs -version >= 22.1 |
175 # use the new pretty GDB mode if emacs -version >= 22.1 |
182 case $($EMACS -version 2> /dev/null) in |
176 case `$EMACS -version 2> /dev/null` in |
183 *GNU\ Emacs\ 2[23]*) |
177 *GNU\ Emacs\ 2[23]*) |
184 emacs_gud_cmd="gdba" |
178 emacs_gud_cmd="gdba" |
185 emacs_gud_args="--annotate=3" |
179 emacs_gud_args="--annotate=3" |
186 ;; |
180 ;; |
187 *) |
181 *) |