equal
deleted
inserted
replaced
47 if [ ! "$GDB" ] |
47 if [ ! "$GDB" ] |
48 then |
48 then |
49 GDB=gdb |
49 GDB=gdb |
50 fi |
50 fi |
51 |
51 |
52 # This is the name of the gdb binary to use |
52 # This is the name of the dbx binary to use |
53 if [ ! "$DBX" ] |
53 if [ ! "$DBX" ] |
54 then |
54 then |
55 DBX=dbx |
55 DBX=dbx |
56 fi |
56 fi |
57 |
57 |
65 EMACS=emacs |
65 EMACS=emacs |
66 |
66 |
67 # |
67 # |
68 # End of user changeable parameters ----------------------------------------- |
68 # End of user changeable parameters ----------------------------------------- |
69 # |
69 # |
|
70 |
|
71 OS=`uname -s` |
70 |
72 |
71 # Make sure the paths are fully specified, i.e. they must begin with /. |
73 # Make sure the paths are fully specified, i.e. they must begin with /. |
72 REL_MYDIR=`dirname $0` |
74 REL_MYDIR=`dirname $0` |
73 MYDIR=`cd $REL_MYDIR && pwd` |
75 MYDIR=`cd $REL_MYDIR && pwd` |
|
76 case "$OS" in |
|
77 CYGWIN*) |
|
78 MYDIR=`cygpath -m "$MYDIR"` |
|
79 ;; |
|
80 esac |
74 |
81 |
75 # |
82 # |
76 # Look whether the user wants to run inside gdb |
83 # Look whether the user wants to run inside gdb |
77 case "$1" in |
84 case "$1" in |
78 -gdb) |
85 -gdb) |
100 JDK=${ALT_JAVA_HOME%%/jre} |
107 JDK=${ALT_JAVA_HOME%%/jre} |
101 else |
108 else |
102 JDK=@@JDK_IMPORT_PATH@@ |
109 JDK=@@JDK_IMPORT_PATH@@ |
103 fi |
110 fi |
104 |
111 |
105 if [ "${JDK}" = "" ]; then |
112 if [ "${JDK}" != "" ]; then |
106 echo "Failed to find JDK. Either ALT_JAVA_HOME is not set or JDK_IMPORT_PATH is empty." |
113 case "$OS" in |
|
114 CYGWIN*) |
|
115 JDK=`cygpath -m "$JDK"` |
|
116 ;; |
|
117 esac |
|
118 |
|
119 else |
|
120 echo "Failed to find JDK." \ |
|
121 "Either ALT_JAVA_HOME is not set or JDK_IMPORT_PATH is empty." |
|
122 exit 1 |
107 fi |
123 fi |
108 |
124 |
109 # We will set the LD_LIBRARY_PATH as follows: |
125 # We will set the LD_LIBRARY_PATH as follows: |
110 # o $JVMPATH (directory portion only) |
126 # o $JVMPATH (directory portion only) |
111 # o $JRE/lib/$ARCH |
127 # o $JRE/lib/$ARCH |
118 ARCH=@@LIBARCH@@ |
134 ARCH=@@LIBARCH@@ |
119 SBP=${MYDIR}:${JRE}/lib/${ARCH} |
135 SBP=${MYDIR}:${JRE}/lib/${ARCH} |
120 |
136 |
121 |
137 |
122 # Set up a suitable LD_LIBRARY_PATH or DYLD_LIBRARY_PATH |
138 # Set up a suitable LD_LIBRARY_PATH or DYLD_LIBRARY_PATH |
123 OS=`uname -s` |
|
124 if [ "${OS}" = "Darwin" ] |
139 if [ "${OS}" = "Darwin" ] |
125 then |
140 then |
126 if [ -z "$DYLD_LIBRARY_PATH" ] |
141 if [ -z "$DYLD_LIBRARY_PATH" ] |
127 then |
142 then |
128 DYLD_LIBRARY_PATH="$SBP" |
143 DYLD_LIBRARY_PATH="$SBP" |
139 LD_LIBRARY_PATH="$SBP:$LD_LIBRARY_PATH" |
154 LD_LIBRARY_PATH="$SBP:$LD_LIBRARY_PATH" |
140 fi |
155 fi |
141 export LD_LIBRARY_PATH |
156 export LD_LIBRARY_PATH |
142 fi |
157 fi |
143 |
158 |
144 JPARMS="-Dsun.java.launcher=gamma -XXaltjvm=$MYDIR $@ $JAVA_ARGS"; |
159 JPARMS="-XXaltjvm=$MYDIR -Dsun.java.launcher.is_altjvm=true $@ $JAVA_ARGS"; |
145 |
160 |
146 # Locate the java launcher |
161 # Locate the java launcher |
147 LAUNCHER=$JDK/bin/java |
162 LAUNCHER=$JDK/bin/java |
148 if [ ! -x $LAUNCHER ] ; then |
163 if [ ! -x $LAUNCHER ] ; then |
149 echo Error: Cannot find the java launcher \"$LAUNCHER\" |
164 echo Error: Cannot find the java launcher \"$LAUNCHER\" |
150 exit 1 |
165 exit 1 |
151 fi |
166 fi |
152 |
167 |
153 GDBSRCDIR=$MYDIR |
168 GDBSRCDIR=$MYDIR |
154 BASEDIR=`cd $MYDIR/../../.. && pwd` |
169 BASEDIR=`cd $MYDIR/../../.. && pwd` |
|
170 case "$OS" in |
|
171 CYGWIN*) |
|
172 BASEDIR=`cygpath -m "$BASEDIR"` |
|
173 ;; |
|
174 esac |
155 |
175 |
156 init_gdb() { |
176 init_gdb() { |
157 # Create a gdb script in case we should run inside gdb |
177 # Create a gdb script in case we should run inside gdb |
158 GDBSCR=/tmp/hsl.$$ |
178 GDBSCR=/tmp/hsl.$$ |
159 rm -f $GDBSCR |
179 rm -f $GDBSCR |