Patches for Kaffe 1.0.b1

Alexandre Oliva kaffe@rufus.w3.org
15 Jul 1998 02:54:22 -0300


--Multipart_Wed_Jul_15_02:54:22_1998-1
Content-Type: text/plain; charset=US-ASCII

Alexandre Oliva <oliva@dcc.unicamp.br> writes:

> `kaffe', the only script that actually calls `Kaffe', now defines both
> LD_LIBRARY_PATH and CLASSPATH.

Please disregard the first MIME attachment from the previous message
(the one that modifies kaffe.in), and use the attached one instead; it 
is safer WRT quoting argument lists and configure-defined strings.

I think Kaffe (the program, not the script) should live in
$libexecdir, not $bindir, since it is not supposed to be called
directly.  What do you think?

-- 
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil

--Multipart_Wed_Jul_15_02:54:22_1998-1
Content-Type: application/octet-stream; type=patch
Content-Disposition: attachment; filename="kaffe.in.diff"
Content-Transfer-Encoding: 7bit

Index: kaffe/scripts/kaffe.in
===================================================================
RCS file: /home/msc/oliva/src/.cvs/kaffe/kaffe/scripts/kaffe.in,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 kaffe.in
--- kaffe/scripts/kaffe.in	1998/07/15 01:56:54	1.1.1.1
+++ kaffe/scripts/kaffe.in	1998/07/15 05:49:59
@@ -1,10 +1,32 @@
 #! /bin/sh
 
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-KAFFE_LIB=@libdir@
-# Pretend Kaffe is Java
-LD_LIBRARY_PATH=$KAFFE_LIB:$LD_LIBRARY_PATH
+prefix="@prefix@"
+exec_prefix="@exec_prefix@"
+: ${KAFFE_BINDIR="@bindir@"}
+: ${KAFFE_CLASSDIR="@datadir@/kaffe"}
+: ${KAFFE_LIB="@libdir@"}
+CLASSPATH="${CLASSPATH-.}:$KAFFE_CLASSDIR/Klasses.jar:$KAFFE_CLASSDIR/pizza.jar"`test -f $KAFFE_CLASSDIR/classes.zip && echo ":$KAFFE_CLASSDIR/classes.zip"`
+export CLASSPATH
+LD_LIBRARY_PATH="$KAFFE_LIB"${LD_LIBRARY_PATH+":$LD_LIBRARY_PATH"}
 export LD_LIBRARY_PATH
 
-exec Kaffe $@
+if test x"${KAFFE_DEBUG+set}"x != x"set"x; then
+    exec $KAFFE_BINDIR/Kaffe ${1+"$@"}
+else
+    case "`"$KAFFE_DEBUG" --version 0</dev/null 2>/dev/null`" in
+    "GNU gdb"*)
+	{
+	    echo "shell rm -f /tmp/.gdbinit.$$"
+	    echo "cd `pwd`"
+	    echo "set args $*"
+	} >/tmp/.gdbinit.$$
+	exec "$KAFFE_DEBUG" -command /tmp/.gdbinit.$$ $KAFFE_BINDIR/Kaffe
+	rm -f /tmp/.gdbinit.$$;;
+    "GNU Emacs"*)
+	exec "$KAFFE_DEBUG" -eval "(progn (gdb \"gdb $KAFFE_BINDIR/Kaffe\") (gud-call \"cd `pwd`\") (gud-call \"set args $*\"))";;
+    XEmacs*)
+	exec "$KAFFE_DEBUG" -eval "(progn (gdb \"$KAFFE_BINDIR/Kaffe\") (gdb-call \"cd `pwd`\") (gdb-call \"set args $*\"))";;
+    *) echo you must set KAFFE_DEBUG to either emacs or gdb >&2;;
+    esac
+fi
+exit 1

--Multipart_Wed_Jul_15_02:54:22_1998-1--