Index: kaffe/configure
diff -u kaffe/configure:1.1.1.6 kaffe/configure:1.9
--- kaffe/configure:1.1.1.6	Sat Feb  7 06:14:56 1998
+++ kaffe/configure	Wed Feb 25 15:21:16 1998
@@ -1110,6 +1110,9 @@
 	if test "$LIBEXT" = ".a" ; then
 		LINKLIB='$(AR) $(LIB) $(OBJECT)\
 		$(RANLIB) $(LIB)'
+	elif "$CC" -v 2>&1 | grep "gcc" >/dev/null; then
+		LIBSHARE="-shared"
+		LINKLIB='$(CC) $(LDFLAGS) -o $(LIB) $(OBJECT) $(LDTAIL)'
 	else
 		LINKLIB='$(LD) $(LDFLAGS) -o $(LIB) $(OBJECT) $(LDTAIL)'
 	fi
@@ -1178,14 +1181,14 @@
 	{ echo "configure: error: Configuration $host_cpu-$host_os does not support $want_engine mode" 1>&2; exit 1; }
 fi
 echo $ac_n "checking execution engine""... $ac_c" 1>&6
-echo "configure:1182: checking execution engine" >&5
+echo "configure:1185: checking execution engine" >&5
 echo "$ac_t""$with_engine" 1>&6
 
 engine_frag=$srcdir/kaffe/kaffevm/$with_engine/Makefile.frag
 
 
 echo $ac_n "checking library type""... $ac_c" 1>&6
-echo "configure:1189: checking library type" >&5
+echo "configure:1192: checking library type" >&5
 if test "$dynamic_libraries" = "no" ; then
 	echo "$ac_t""static" 1>&6
 else
@@ -1195,7 +1198,7 @@
 
 
 echo $ac_n "checking for native threads""... $ac_c" 1>&6
-echo "configure:1199: checking for native threads" >&5
+echo "configure:1202: checking for native threads" >&5
 if test -f $srcdir/config/$host_cpu/$host_os/thread-native.h ; then
 	link_from="$link_from config/$host_cpu/$host_os/thread-native.h"
 	link_to="$link_to kaffe/kaffevm/thread-native.h"
@@ -1209,7 +1212,7 @@
 fi
 
 echo $ac_n "checking for native locks""... $ac_c" 1>&6
-echo "configure:1213: checking for native locks" >&5
+echo "configure:1216: checking for native locks" >&5
 if test -f $srcdir/config/$host_cpu/$host_os/locks-native.h ; then
 	link_from="$link_from config/$host_cpu/$host_os/locks-native.h"
 	link_to="$link_to kaffe/kaffevm/locks-native.h"
@@ -1224,7 +1227,7 @@
 
 if test "$with_engine" != "intrp" ; then
 	echo $ac_n "checking for trampolines""... $ac_c" 1>&6
-echo "configure:1228: checking for trampolines" >&5
+echo "configure:1231: checking for trampolines" >&5
 	if test -f $srcdir/config/$host_cpu/trampolines.c ; then
 		link_from="$link_from config/$host_cpu/trampolines.c"
 		link_to="$link_to kaffe/kaffevm/trampolines.c"
@@ -1283,7 +1286,7 @@
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1287: checking for a BSD compatible install" >&5
+echo "configure:1290: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1333,7 +1336,7 @@
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1337: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:1340: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1362,7 +1365,7 @@
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1366: checking for $ac_word" >&5
+echo "configure:1369: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1391,7 +1394,7 @@
 # Extract the first word of "ar", so it can be a program name with args.
 set dummy ar; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1395: checking for $ac_word" >&5
+echo "configure:1398: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1421,7 +1424,7 @@
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1425: checking for $ac_word" >&5
+echo "configure:1428: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_MKDIR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1453,7 +1456,7 @@
 # Extract the first word of "dlltool", so it can be a program name with args.
 set dummy dlltool; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1457: checking for $ac_word" >&5
+echo "configure:1460: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1483,7 +1486,7 @@
 
 if test "$LN_S" = "" ; then
 	echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1487: checking whether ln -s works" >&5
+echo "configure:1490: checking whether ln -s works" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1515,7 +1518,7 @@
 
 
 echo $ac_n "checking size of short""... $ac_c" 1>&6
-echo "configure:1519: checking size of short" >&5
+echo "configure:1522: checking size of short" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1523,7 +1526,7 @@
   ac_cv_sizeof_short=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 1527 "configure"
+#line 1530 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -1534,7 +1537,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:1538: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_short=`cat conftestval`
 else
@@ -1554,7 +1557,7 @@
 
 
 echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:1558: checking size of int" >&5
+echo "configure:1561: checking size of int" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1562,7 +1565,7 @@
   ac_cv_sizeof_int=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 1566 "configure"
+#line 1569 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -1573,7 +1576,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:1577: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_int=`cat conftestval`
 else
@@ -1593,7 +1596,7 @@
 
 
 echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:1597: checking size of long" >&5
+echo "configure:1600: checking size of long" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1601,7 +1604,7 @@
   ac_cv_sizeof_long=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 1605 "configure"
+#line 1608 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -1612,7 +1615,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:1616: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1619: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_long=`cat conftestval`
 else
@@ -1632,7 +1635,7 @@
 
 
 echo $ac_n "checking size of long long""... $ac_c" 1>&6
-echo "configure:1636: checking size of long long" >&5
+echo "configure:1639: checking size of long long" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1640,7 +1643,7 @@
   ac_cv_sizeof_long_long=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 1644 "configure"
+#line 1647 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -1651,7 +1654,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:1655: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_long_long=`cat conftestval`
 else
@@ -1671,7 +1674,7 @@
 
 
 echo $ac_n "checking size of __int64""... $ac_c" 1>&6
-echo "configure:1675: checking size of __int64" >&5
+echo "configure:1678: checking size of __int64" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof___int64'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1679,7 +1682,7 @@
   ac_cv_sizeof___int64=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 1683 "configure"
+#line 1686 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -1690,7 +1693,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:1694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof___int64=`cat conftestval`
 else
@@ -1710,7 +1713,7 @@
 
 
 echo $ac_n "checking size of void*""... $ac_c" 1>&6
-echo "configure:1714: checking size of void*" >&5
+echo "configure:1717: checking size of void*" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_voidp'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1718,7 +1721,7 @@
   ac_cv_sizeof_voidp=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 1722 "configure"
+#line 1725 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -1729,7 +1732,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:1733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_voidp=`cat conftestval`
 else
@@ -1751,7 +1754,7 @@
 
 
 echo $ac_n "checking alignment of void*""... $ac_c" 1>&6
-echo "configure:1755: checking alignment of void*" >&5
+echo "configure:1758: checking alignment of void*" >&5
 if eval "test \"`echo '$''{'ac_cv_alignmentof_voidp'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1759,7 +1762,7 @@
   ac_cv_alignmentof_voidp=1
 else
   cat > conftest.$ac_ext <<EOF
-#line 1763 "configure"
+#line 1766 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main() { struct { char c; void *p; } t; FILE *f;
@@ -1769,7 +1772,7 @@
   fprintf (f, "%d", ((char*) &t.p)-((char*) &t));
   fclose(f); exit (0); }
 EOF
-if { (eval echo configure:1773: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_alignmentof_voidp=`cat conftestdata`
 else
@@ -1791,12 +1794,12 @@
 
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:1795: checking return type of signal handlers" >&5
+echo "configure:1798: checking return type of signal handlers" >&5
 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1800 "configure"
+#line 1803 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -1813,7 +1816,7 @@
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:1817: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1820: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -1832,7 +1835,7 @@
 
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1836: checking how to run the C preprocessor" >&5
+echo "configure:1839: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -1847,13 +1850,13 @@
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 1851 "configure"
+#line 1854 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1857: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1860: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   :
@@ -1864,13 +1867,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 1868 "configure"
+#line 1871 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1874: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1877: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   :
@@ -1893,12 +1896,12 @@
 echo "$ac_t""$CPP" 1>&6
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1897: checking for ANSI C header files" >&5
+echo "configure:1900: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1902 "configure"
+#line 1905 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -1906,7 +1909,7 @@
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1910: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1913: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1923,7 +1926,7 @@
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1927 "configure"
+#line 1930 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -1941,7 +1944,7 @@
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1945 "configure"
+#line 1948 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -1962,7 +1965,7 @@
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 1966 "configure"
+#line 1969 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1973,7 +1976,7 @@
 exit (0); }
 
 EOF
-if { (eval echo configure:1977: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1980: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -1997,12 +2000,12 @@
 fi
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:2001: checking for size_t" >&5
+echo "configure:2004: checking for size_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2006 "configure"
+#line 2009 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -2030,12 +2033,12 @@
 fi
 
 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
-echo "configure:2034: checking for ssize_t" >&5
+echo "configure:2037: checking for ssize_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2039 "configure"
+#line 2042 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -2069,7 +2072,7 @@
 
 
 echo $ac_n "checking for printf in -lc""... $ac_c" 1>&6
-echo "configure:2073: checking for printf in -lc" >&5
+echo "configure:2076: checking for printf in -lc" >&5
 ac_lib_var=`echo c'_'printf | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2077,7 +2080,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lc  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2081 "configure"
+#line 2084 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2088,7 +2091,7 @@
 printf()
 ; return 0; }
 EOF
-if { (eval echo configure:2092: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2095: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2116,7 +2119,7 @@
 fi
 
 echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6
-echo "configure:2120: checking for sin in -lm" >&5
+echo "configure:2123: checking for sin in -lm" >&5
 ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2124,7 +2127,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2128 "configure"
+#line 2131 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2135,7 +2138,7 @@
 sin()
 ; return 0; }
 EOF
-if { (eval echo configure:2139: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2167,7 +2170,7 @@
 
 if test "$dynamic_libraries" = "yes" ; then
 		echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:2171: checking for dlopen in -ldl" >&5
+echo "configure:2174: checking for dlopen in -ldl" >&5
 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2175,7 +2178,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-ldl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2179 "configure"
+#line 2182 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2186,7 +2189,7 @@
 dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:2190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2193: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2215,7 +2218,7 @@
 
 	if test "$ac_cv_lib_dl_dlopen" = "no" ; then
 		echo $ac_n "checking for _dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:2219: checking for _dlopen in -ldl" >&5
+echo "configure:2222: checking for _dlopen in -ldl" >&5
 ac_lib_var=`echo dl'_'_dlopen | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2223,7 +2226,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-ldl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2227 "configure"
+#line 2230 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2234,7 +2237,7 @@
 _dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:2238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2241: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2263,7 +2266,7 @@
 
 		if test "$ac_cv_lib_dl__dlopen" = "no" ; then
 			echo $ac_n "checking for dld_init in -ldld""... $ac_c" 1>&6
-echo "configure:2267: checking for dld_init in -ldld" >&5
+echo "configure:2270: checking for dld_init in -ldld" >&5
 ac_lib_var=`echo dld'_'dld_init | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2271,7 +2274,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-ldld  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2275 "configure"
+#line 2278 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2282,7 +2285,7 @@
 dld_init()
 ; return 0; }
 EOF
-if { (eval echo configure:2286: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2289: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2316,7 +2319,7 @@
 
 
 echo $ac_n "checking for dial in -lnsl""... $ac_c" 1>&6
-echo "configure:2320: checking for dial in -lnsl" >&5
+echo "configure:2323: checking for dial in -lnsl" >&5
 ac_lib_var=`echo nsl'_'dial | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2324,7 +2327,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2328 "configure"
+#line 2331 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2335,7 +2338,7 @@
 dial()
 ; return 0; }
 EOF
-if { (eval echo configure:2339: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2342: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2363,7 +2366,7 @@
 fi
 
 echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
-echo "configure:2367: checking for socket in -lsocket" >&5
+echo "configure:2370: checking for socket in -lsocket" >&5
 ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2371,7 +2374,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2375 "configure"
+#line 2378 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2382,7 +2385,7 @@
 socket()
 ; return 0; }
 EOF
-if { (eval echo configure:2386: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2389: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2416,7 +2419,7 @@
 # Uses ac_ vars as temps to allow command line to override cache and checks.
 # --without-x overrides everything else, but does not touch the cache.
 echo $ac_n "checking for X""... $ac_c" 1>&6
-echo "configure:2420: checking for X" >&5
+echo "configure:2423: checking for X" >&5
 
 # Check whether --with-x or --without-x was given.
 if test "${with_x+set}" = set; then
@@ -2478,12 +2481,12 @@
 
   # First, try using that file with no special directory specified.
 cat > conftest.$ac_ext <<EOF
-#line 2482 "configure"
+#line 2485 "configure"
 #include "confdefs.h"
 #include <$x_direct_test_include>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2487: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2490: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2552,14 +2555,14 @@
   ac_save_LIBS="$LIBS"
   LIBS="-l$x_direct_test_library $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2556 "configure"
+#line 2559 "configure"
 #include "confdefs.h"
 
 int main() {
 ${x_direct_test_function}()
 ; return 0; }
 EOF
-if { (eval echo configure:2563: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2566: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   LIBS="$ac_save_LIBS"
 # We can link X programs with no special library path.
@@ -2655,7 +2658,7 @@
 
 
 echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
-echo "configure:2659: checking for shmat in -lipc" >&5
+echo "configure:2662: checking for shmat in -lipc" >&5
 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2663,7 +2666,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lipc  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2667 "configure"
+#line 2670 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2674,7 +2677,7 @@
 shmat()
 ; return 0; }
 EOF
-if { (eval echo configure:2678: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2705,12 +2708,12 @@
 
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2709: checking for ANSI C header files" >&5
+echo "configure:2712: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2714 "configure"
+#line 2717 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -2718,7 +2721,7 @@
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2722: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2725: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2735,7 +2738,7 @@
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 2739 "configure"
+#line 2742 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -2753,7 +2756,7 @@
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 2757 "configure"
+#line 2760 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -2774,7 +2777,7 @@
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 2778 "configure"
+#line 2781 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2785,7 +2788,7 @@
 exit (0); }
 
 EOF
-if { (eval echo configure:2789: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2792: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -2812,17 +2815,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2816: checking for $ac_hdr" >&5
+echo "configure:2819: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2821 "configure"
+#line 2824 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2826: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2829: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2853,12 +2856,12 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:2857: checking for $ac_hdr that defines DIR" >&5
+echo "configure:2860: checking for $ac_hdr that defines DIR" >&5
 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2862 "configure"
+#line 2865 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_hdr>
@@ -2866,7 +2869,7 @@
 DIR *dirp = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:2870: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2873: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_dirent_$ac_safe=yes"
 else
@@ -2891,7 +2894,7 @@
 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
 if test $ac_header_dirent = dirent.h; then
 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:2895: checking for opendir in -ldir" >&5
+echo "configure:2898: checking for opendir in -ldir" >&5
 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2899,7 +2902,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-ldir  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2903 "configure"
+#line 2906 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2910,7 +2913,7 @@
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:2914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2917: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2932,7 +2935,7 @@
 
 else
 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:2936: checking for opendir in -lx" >&5
+echo "configure:2939: checking for opendir in -lx" >&5
 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2940,7 +2943,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lx  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2944 "configure"
+#line 2947 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2951,7 +2954,7 @@
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:2955: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2977,12 +2980,12 @@
 
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:2981: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:2984: checking whether time.h and sys/time.h may both be included" >&5
 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2986 "configure"
+#line 2989 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -2991,7 +2994,7 @@
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:2995: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2998: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -3012,12 +3015,12 @@
 fi
 
 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:3016: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:3019: checking whether struct tm is in sys/time.h or time.h" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3021 "configure"
+#line 3024 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <time.h>
@@ -3025,7 +3028,7 @@
 struct tm *tp; tp->tm_sec;
 ; return 0; }
 EOF
-if { (eval echo configure:3029: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3032: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm=time.h
 else
@@ -3046,12 +3049,12 @@
 fi
 
 echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
-echo "configure:3050: checking for tm_zone in struct tm" >&5
+echo "configure:3053: checking for tm_zone in struct tm" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3055 "configure"
+#line 3058 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_cv_struct_tm>
@@ -3059,7 +3062,7 @@
 struct tm tm; tm.tm_zone;
 ; return 0; }
 EOF
-if { (eval echo configure:3063: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3066: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm_zone=yes
 else
@@ -3079,12 +3082,12 @@
 
 else
   echo $ac_n "checking for tzname""... $ac_c" 1>&6
-echo "configure:3083: checking for tzname" >&5
+echo "configure:3086: checking for tzname" >&5
 if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3088 "configure"
+#line 3091 "configure"
 #include "confdefs.h"
 #include <time.h>
 #ifndef tzname /* For SGI.  */
@@ -3094,7 +3097,7 @@
 atoi(*tzname);
 ; return 0; }
 EOF
-if { (eval echo configure:3098: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3101: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_var_tzname=yes
 else
@@ -3116,14 +3119,14 @@
 fi
 
 echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:3120: checking whether byte ordering is bigendian" >&5
+echo "configure:3123: checking whether byte ordering is bigendian" >&5
 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_cv_c_bigendian=unknown
 # See if sys/param.h defines the BYTE_ORDER macro.
 cat > conftest.$ac_ext <<EOF
-#line 3127 "configure"
+#line 3130 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -3134,11 +3137,11 @@
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:3138: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3141: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   # It does; now see whether it defined to BIG_ENDIAN or not.
 cat > conftest.$ac_ext <<EOF
-#line 3142 "configure"
+#line 3145 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -3149,7 +3152,7 @@
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:3153: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3156: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_bigendian=yes
 else
@@ -3169,7 +3172,7 @@
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 3173 "configure"
+#line 3176 "configure"
 #include "confdefs.h"
 main () {
   /* Are we little or big endian?  From Harbison&Steele.  */
@@ -3182,7 +3185,7 @@
   exit (u.c[sizeof (long) - 1] == 1);
 }
 EOF
-if { (eval echo configure:3186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3189: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_bigendian=no
 else
@@ -3206,14 +3209,14 @@
 fi
 
 echo $ac_n "checking whether char is unsigned""... $ac_c" 1>&6
-echo "configure:3210: checking whether char is unsigned" >&5
+echo "configure:3213: checking whether char is unsigned" >&5
 if eval "test \"`echo '$''{'ac_cv_c_char_unsigned'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test "$GCC" = yes; then
   # GCC predefines this symbol on systems where it applies.
 cat > conftest.$ac_ext <<EOF
-#line 3217 "configure"
+#line 3220 "configure"
 #include "confdefs.h"
 #ifdef __CHAR_UNSIGNED__
   yes
@@ -3235,7 +3238,7 @@
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 3239 "configure"
+#line 3242 "configure"
 #include "confdefs.h"
 /* volatile prevents gcc2 from optimizing the test away on sparcs.  */
 #if !defined(__STDC__) || __STDC__ != 1
@@ -3245,7 +3248,7 @@
   volatile char c = 255; exit(c < 0);
 }
 EOF
-if { (eval echo configure:3249: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3252: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_char_unsigned=yes
 else
@@ -3269,21 +3272,21 @@
 fi
 
 echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:3273: checking for inline" >&5
+echo "configure:3276: checking for inline" >&5
 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_cv_c_inline=no
 for ac_kw in inline __inline__ __inline; do
   cat > conftest.$ac_ext <<EOF
-#line 3280 "configure"
+#line 3283 "configure"
 #include "confdefs.h"
 
 int main() {
 } $ac_kw foo() {
 ; return 0; }
 EOF
-if { (eval echo configure:3287: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3290: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_inline=$ac_kw; break
 else
@@ -3311,12 +3314,12 @@
 
 
 echo $ac_n "checking for struct sigcontext""... $ac_c" 1>&6
-echo "configure:3315: checking for struct sigcontext" >&5
+echo "configure:3318: checking for struct sigcontext" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_sigcontext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3320 "configure"
+#line 3323 "configure"
 #include "confdefs.h"
 #include <asm/signal.h>
 #include <asm/sigcontext.h>
@@ -3324,7 +3327,7 @@
 struct sigcontext t;
 ; return 0; }
 EOF
-if { (eval echo configure:3328: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3331: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_sigcontext=yes
 else
@@ -3346,19 +3349,19 @@
 
 
 echo $ac_n "checking for struct sigcontext_struct (without asm/sigcontext.h)""... $ac_c" 1>&6
-echo "configure:3350: checking for struct sigcontext_struct (without asm/sigcontext.h)" >&5
+echo "configure:3353: checking for struct sigcontext_struct (without asm/sigcontext.h)" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_sigcontext_struct'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3355 "configure"
+#line 3358 "configure"
 #include "confdefs.h"
 #include <asm/signal.h>
 int main() {
 struct sigcontext_struct t;
 ; return 0; }
 EOF
-if { (eval echo configure:3362: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3365: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_sigcontext_struct=yes
 else
@@ -3373,12 +3376,12 @@
 echo "$ac_t""$ac_cv_struct_sigcontext_struct" 1>&6
 
 echo $ac_n "checking for struct sigcontext_struct (with asm/sigcontext.h)""... $ac_c" 1>&6
-echo "configure:3377: checking for struct sigcontext_struct (with asm/sigcontext.h)" >&5
+echo "configure:3380: checking for struct sigcontext_struct (with asm/sigcontext.h)" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_sigcontext_struct_with'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3382 "configure"
+#line 3385 "configure"
 #include "confdefs.h"
 #include <asm/signal.h>
 #include <asm/sigcontext.h>
@@ -3386,7 +3389,7 @@
 struct sigcontext_struct t;
 ; return 0; }
 EOF
-if { (eval echo configure:3390: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3393: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_sigcontext_struct_with=yes
 else
@@ -3410,12 +3413,12 @@
 
 
 echo $ac_n "checking for strftime""... $ac_c" 1>&6
-echo "configure:3414: checking for strftime" >&5
+echo "configure:3417: checking for strftime" >&5
 if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3419 "configure"
+#line 3422 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char strftime(); below.  */
@@ -3438,7 +3441,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3442: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_strftime=yes"
 else
@@ -3460,7 +3463,7 @@
   echo "$ac_t""no" 1>&6
 # strftime is in -lintl on SCO UNIX.
 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
-echo "configure:3464: checking for strftime in -lintl" >&5
+echo "configure:3467: checking for strftime in -lintl" >&5
 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3468,7 +3471,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lintl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3472 "configure"
+#line 3475 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3479,7 +3482,7 @@
 strftime()
 ; return 0; }
 EOF
-if { (eval echo configure:3483: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3486: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3509,17 +3512,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3513: checking for $ac_hdr" >&5
+echo "configure:3516: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3518 "configure"
+#line 3521 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3523: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3526: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3548,12 +3551,12 @@
 for ac_func in getpagesize
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3552: checking for $ac_func" >&5
+echo "configure:3555: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3557 "configure"
+#line 3560 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3576,7 +3579,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3583: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3601,7 +3604,7 @@
 done
 
 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:3605: checking for working mmap" >&5
+echo "configure:3608: checking for working mmap" >&5
 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3609,7 +3612,7 @@
   ac_cv_func_mmap_fixed_mapped=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 3613 "configure"
+#line 3616 "configure"
 #include "confdefs.h"
 
 /* Thanks to Mike Haertel and Jim Avera for this test.
@@ -3749,7 +3752,7 @@
 }
 
 EOF
-if { (eval echo configure:3753: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_mmap_fixed_mapped=yes
 else
@@ -3774,12 +3777,12 @@
 for ac_func in select socket getsockname
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3778: checking for $ac_func" >&5
+echo "configure:3781: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3783 "configure"
+#line 3786 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3802,7 +3805,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3806: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3809: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3829,12 +3832,12 @@
 for ac_func in memcpy memmove
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3833: checking for $ac_func" >&5
+echo "configure:3836: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3838 "configure"
+#line 3841 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3857,7 +3860,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3864: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3884,12 +3887,12 @@
 for ac_func in mkdir
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3888: checking for $ac_func" >&5
+echo "configure:3891: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3893 "configure"
+#line 3896 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3912,7 +3915,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3916: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3939,12 +3942,12 @@
 for ac_func in getcwd getwd gettimeofday ftime uname getuid
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3943: checking for $ac_func" >&5
+echo "configure:3946: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3948 "configure"
+#line 3951 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3967,7 +3970,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3971: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3974: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3994,12 +3997,12 @@
 for ac_func in remainder remainderf fmod drem rint floor ceil finite isinf isnan strtod strdup
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3998: checking for $ac_func" >&5
+echo "configure:4001: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4003 "configure"
+#line 4006 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4022,7 +4025,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4026: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4029: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4049,12 +4052,12 @@
 for ac_func in strerror hstrerror
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4053: checking for $ac_func" >&5
+echo "configure:4056: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4058 "configure"
+#line 4061 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4077,7 +4080,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4081: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4084: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4104,12 +4107,12 @@
 for ac_func in fcntl ioctl
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4108: checking for $ac_func" >&5
+echo "configure:4111: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4113 "configure"
+#line 4116 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4132,7 +4135,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4136: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4139: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4159,12 +4162,12 @@
 for ac_func in alarm setitimer
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4163: checking for $ac_func" >&5
+echo "configure:4166: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4168 "configure"
+#line 4171 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4187,7 +4190,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4191: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4194: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4214,12 +4217,12 @@
 for ac_func in sigprocmask sigsetmask sigemptyset sigaddset signal sigaction
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4218: checking for $ac_func" >&5
+echo "configure:4221: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4223 "configure"
+#line 4226 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4242,7 +4245,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4249: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4269,12 +4272,12 @@
 for ac_func in sbrk valloc memalign mallopt
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4273: checking for $ac_func" >&5
+echo "configure:4276: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4278 "configure"
+#line 4281 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4297,7 +4300,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4301: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4324,12 +4327,12 @@
 for ac_func in waitpid kill fork execve
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4328: checking for $ac_func" >&5
+echo "configure:4331: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4333 "configure"
+#line 4336 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4352,7 +4355,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4379,12 +4382,12 @@
 for ac_func in rld_load shl_load LoadLibrary dld_link
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4383: checking for $ac_func" >&5
+echo "configure:4386: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4388 "configure"
+#line 4391 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4407,7 +4410,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4433,12 +4436,12 @@
 
 
 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
-echo "configure:4437: checking for dlopen" >&5
+echo "configure:4440: checking for dlopen" >&5
 if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4442 "configure"
+#line 4445 "configure"
 #include "confdefs.h"
 #ifdef HAVE_DLFCN_H
 #include <dlfcn.h>
@@ -4449,7 +4452,7 @@
 dlopen(0, 0)
 ; return 0; }
 EOF
-if { (eval echo configure:4453: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4456: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_func_dlopen=yes
 else
@@ -4471,12 +4474,12 @@
 fi
 
 echo $ac_n "checking for dlerror""... $ac_c" 1>&6
-echo "configure:4475: checking for dlerror" >&5
+echo "configure:4478: checking for dlerror" >&5
 if eval "test \"`echo '$''{'ac_cv_func_dlerror'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4480 "configure"
+#line 4483 "configure"
 #include "confdefs.h"
 #ifdef HAVE_DLFCN_H
 #include <dlfcn.h>
@@ -4487,7 +4490,7 @@
 dlerror()
 ; return 0; }
 EOF
-if { (eval echo configure:4491: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4494: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_func_dlerror=yes
 else
@@ -4511,19 +4514,19 @@
 
 if test "$host_cpu" = "alpha" ; then
   echo $ac_n "checking for alpha support of amask instruction""... $ac_c" 1>&6
-echo "configure:4515: checking for alpha support of amask instruction" >&5
+echo "configure:4518: checking for alpha support of amask instruction" >&5
 if eval "test \"`echo '$''{'ac_cv_alpha_asm_amask'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4520 "configure"
+#line 4523 "configure"
 #include "confdefs.h"
 
 int main() {
  long r; __asm__("amask 1,%0" : "=r"(r)); return !r; 
 ; return 0; }
 EOF
-if { (eval echo configure:4527: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4530: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_alpha_asm_amask=yes
 else
@@ -4548,12 +4551,12 @@
 
 
 echo $ac_n "checking for declaration of select""... $ac_c" 1>&6
-echo "configure:4552: checking for declaration of select" >&5
+echo "configure:4555: checking for declaration of select" >&5
 if eval "test \"`echo '$''{'ac_cv_declared_select'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4557 "configure"
+#line 4560 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_UNISTD_H
@@ -4570,7 +4573,7 @@
  void *foo = select; 
 ; return 0; }
 EOF
-if { (eval echo configure:4574: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4577: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_declared_select=yes; cat >> confdefs.h <<\EOF
 #define HAVE_DECLARED_SELECT 1
@@ -4591,7 +4594,7 @@
 
 
 echo $ac_n "checking for underscore in dlsym""... $ac_c" 1>&6
-echo "configure:4595: checking for underscore in dlsym" >&5
+echo "configure:4598: checking for underscore in dlsym" >&5
 if eval "test \"`echo '$''{'ac_cv_underscore'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4600,13 +4603,13 @@
   ac_cv_underscore=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 4604 "configure"
+#line 4607 "configure"
 #include "confdefs.h"
 main()
 {void* lib = (void*)dlopen(_LIBC_);
   if (dlsym(lib, "_printf") != 0) { exit(0); } else { exit(1); } }
 EOF
-if { (eval echo configure:4610: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4613: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_underscore=yes
 else
@@ -4629,7 +4632,7 @@
 fi
 
 echo $ac_n "checking for underscore in C assembly names""... $ac_c" 1>&6
-echo "configure:4633: checking for underscore in C assembly names" >&5
+echo "configure:4636: checking for underscore in C assembly names" >&5
 if eval "test \"`echo '$''{'ac_cv_underscore_c_names'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4637,11 +4640,11 @@
   ac_cv_underscore_c_names=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 4641 "configure"
+#line 4644 "configure"
 #include "confdefs.h"
 extern int main_symbol();void* x;asm("\n_main_symbol:");main(){ x = &main_symbol; exit(0); }
 EOF
-if { (eval echo configure:4645: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_underscore_c_names=yes
 else
@@ -4692,9 +4695,9 @@
 EOF
 
 NOSHAREDLIBS=" \
--L../../packages/tjwassoc.co.uk/APIcore/lib -lkaffe_native \
--L../../packages/tjwassoc.co.uk/APInet/lib -lkaffe_net \
--L../../packages/tjwassoc.co.uk/APIzip/lib -lkaffe_zip \
+-L../../packages/tjwassoc.co.uk/APIcore/lib -lnative \
+-L../../packages/tjwassoc.co.uk/APInet/lib -lnet \
+-L../../packages/tjwassoc.co.uk/APIzip/lib -lzip \
 "
 
 if test -f $srcdir/packages/javasoft.com/Makefile.in ; then
@@ -4721,7 +4724,7 @@
 			packages/biss-net.com/APIawt/lib/Makefile \
 		"
 		NOSHAREDLIBS="$NOSHAREDLIBS \
-		    -L../../packages/biss-net.com/APIawt/lib -lkaffe_bissawt \
+		    -L../../packages/biss-net.com/APIawt/lib -lbissawt \
 		"
 	fi
 
@@ -4734,7 +4737,7 @@
 			packages/epfl.ch/APIawt/lib/Makefile \
 		"
 		NOSHAREDLIBS="$NOSHAREDLIBS \
-			-L../../packages/epfl.ch/APIawt/lib -lkaffe_sawt \
+			-L../../packages/epfl.ch/APIawt/lib -lsawt \
 		"
 	fi
 	NOSHAREDLIBS="$NOSHAREDLIBS $X_LIBRARIES"
@@ -4752,10 +4755,34 @@
 
 fi
 
+if test x"$enable_guarana" != xno &&
+   test -f $srcdir/packages/guarana.unicamp.br/Makefile.in ; then
+	packages="$packages guarana.unicamp.br"
+	make_output="$make_output \
+		packages/guarana.unicamp.br/Makefile \
+		packages/guarana.unicamp.br/APIguarana/Makefile \
+		packages/guarana.unicamp.br/APIguarana/lib/Makefile \
+	"
+	GUARANALIBS=" \
+		-L../../packages/guarana.unicamp.br/APIguarana/lib -lguarana \
+	"
+		GUARANA_CLASSPATH=\$libdir/libguarana.so:$datadir/kaffe/guarana.jar
+	cat >> confdefs.h <<\EOF
+#define HAVE_PACKAGE_GUARANA_UNICAMP_BR 1
+EOF
+
+	cat >> confdefs.h <<\EOF
+#define GUARANA 1
+EOF
+
+else
+	GUARANA_CLASSPATH=
+fi
+
 if test "$dynamic_libraries" = "yes" ; then
-	NOSHAREDLIBS="-L../kaffevm -lkaffevm"
+	NOSHAREDLIBS="-L../kaffevm -lkaffevm $GUARANALIBS"
 else
-	NOSHAREDLIBS="-L../kaffevm -lkaffevm $NOSHAREDLIBS -lkaffevm $LIBS"
+	NOSHAREDLIBS="-L../kaffevm -lkaffevm $GUARANALIBS $NOSHAREDLIBS -lkaffevm $LIBS"
 	PIC=""
 	PICVM=""
 	LIBSHARE=""
@@ -4775,6 +4802,15 @@
 
 
 
+if test x"$PATHSEP" = x; then
+	if test "$SYSTEM" = "win32" ; then
+		PATHSEP=";"
+	else
+		PATHSEP=":"
+	fi
+fi
+
+
 
 trap '' 1 2 15
 cat > confcache <<\EOF
@@ -4877,7 +4913,7 @@
 ac_given_srcdir=$srcdir
 ac_given_INSTALL="$INSTALL"
 
-trap 'rm -fr `echo "$make_output config/config.h include/jtypes.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+trap 'rm -fr `echo "$make_output config/config.h include/jtypes.h include/guarana.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
 EOF
 cat >> $CONFIG_STATUS <<EOF
 
@@ -4955,6 +4991,7 @@
 s%@X_LIBRARIES@%$X_LIBRARIES%g
 s%@subdirs@%$subdirs%g
 s%@packages@%$packages%g
+s%@PATHSEP@%$PATHSEP%g
 
 CEOF
 EOF
@@ -5077,7 +5114,7 @@
 if test "${CONFIG_HEADERS+set}" != set; then
 EOF
 cat >> $CONFIG_STATUS <<EOF
-  CONFIG_HEADERS="config/config.h include/jtypes.h"
+  CONFIG_HEADERS="config/config.h include/jtypes.h include/guarana.h"
 EOF
 cat >> $CONFIG_STATUS <<\EOF
 fi
@@ -5224,27 +5261,28 @@
 libdir=`eval echo $libdir` ; libdir=`eval echo $libdir`
 bindir=`eval echo $bindir` ; bindir=`eval echo $bindir`
 datadir=`eval echo $datadir`
+GUARANA_CLASSPATH=`eval echo $GUARANA_CLASSPATH`
 
 if test "$SYSTEM" = "unix" ; then
 	if test "$awt_toolkit" != "none" ; then
-		echo CLASSPATH=.:$datadir/kaffe/classes.zip:$datadir/kaffe/$awt_toolkit.zip > ENVIRONMENT
+		echo CLASSPATH=.${PATHSEP}$datadir/kaffe/classes.zip${PATHSEP}$datadir/kaffe/$awt_toolkit.zip${GUARANA_CLASSPATH+${PATHSEP}$GUARANA_CLASSPATH} > ENVIRONMENT
 	else
-		echo CLASSPATH=.:$datadir/kaffe/classes.zip > ENVIRONMENT
+		echo CLASSPATH=.${PATHSEP}$datadir/kaffe/classes.zip${GUARANA_CLASSPATH+${PATHSEP}$GUARANA_CLASSPATH} > ENVIRONMENT
 	fi
 	echo KAFFEHOME=$datadir/kaffe >> ENVIRONMENT
 	if test "$dynamic_libraries" = "yes" ; then
-		echo LD_LIBRARY_PATH=$libdir:\$LD_LIBRARY_PATH >> ENVIRONMENT
+		echo LD_LIBRARY_PATH=$libdir${PATHSEP}\$LD_LIBRARY_PATH >> ENVIRONMENT
 	fi
-	echo PATH=$bindir:\$PATH >> ENVIRONMENT
+	echo PATH=$bindir${PATHSEP}\$PATH >> ENVIRONMENT
 	echo export CLASSPATH KAFFEHOME LD_LIBRARY_PATH PATH >> ENVIRONMENT
 elif test "$SYSTEM" = "win32" ; then
 	echo @echo off > ENVIRONMENT.BAT
 	if test "$awt_toolkit" != "none" ; then
-		echo set CLASSPATH=.\;$datadir/kaffe/classes.zip\;$datadir/kaffe/$awt_toolkit >> ENVIRONMENT.BAT
+		echo set CLASSPATH=.${PATHSEP}$datadir/kaffe/classes.zip${PATHSEP}$datadir/kaffe/$awt_toolkit${GUARANA_CLASSPATH+${PATHSEP}$GUARANA_CLASSPATH} >> ENVIRONMENT.BAT
 	else
-		echo set CLASSPATH=.\;$datadir/kaffe/classes.zip >> ENVIRONMENT.BAT
+		echo set CLASSPATH=.${PATHSEP}$datadir/kaffe/classes.zip${GUARANA_CLASSPATH+${PATHSEP}$GUARANA_CLASSPATH} >> ENVIRONMENT.BAT
 	fi
 	echo set KAFFEHOME=$datadir/kaffe >> ENVIRONMENT.BAT
-	echo set PATH=%PATH%\;$bindir >> ENVIRONMENT.BAT
+	echo set PATH=%PATH%${PATHSEP}$bindir >> ENVIRONMENT.BAT
 fi
 
Index: kaffe/configure.in
diff -u kaffe/configure.in:1.1.1.5 kaffe/configure.in:1.9
--- kaffe/configure.in:1.1.1.5	Mon Oct  6 22:44:39 1997
+++ kaffe/configure.in	Wed Feb 25 15:21:18 1998
@@ -441,6 +441,9 @@
 	if test "$LIBEXT" = ".a" ; then
 		LINKLIB='$(AR) $(LIB) $(OBJECT)\
 		$(RANLIB) $(LIB)'
+	elif "$CC" -v 2>&1 | grep "gcc" >/dev/null; then
+		LIBSHARE="-shared"
+		LINKLIB='$(CC) $(LDFLAGS) -o $(LIB) $(OBJECT) $(LDTAIL)'
 	else
 		LINKLIB='$(LD) $(LDFLAGS) -o $(LIB) $(OBJECT) $(LDTAIL)'
 	fi
@@ -942,9 +945,9 @@
 changequote([, ])dnl
 AC_DEFINE(HAVE_PACKAGE_TJWASSOC_CO_UK)
 NOSHAREDLIBS=" \
--L../../packages/tjwassoc.co.uk/APIcore/lib -lkaffe_native \
--L../../packages/tjwassoc.co.uk/APInet/lib -lkaffe_net \
--L../../packages/tjwassoc.co.uk/APIzip/lib -lkaffe_zip \
+-L../../packages/tjwassoc.co.uk/APIcore/lib -lnative \
+-L../../packages/tjwassoc.co.uk/APInet/lib -lnet \
+-L../../packages/tjwassoc.co.uk/APIzip/lib -lzip \
 "
 
 changequote(<<, >>)dnl
@@ -975,7 +978,7 @@
 			packages/biss-net.com/APIawt/lib/Makefile \
 		"
 		NOSHAREDLIBS="$NOSHAREDLIBS \
-		    -L../../packages/biss-net.com/APIawt/lib -lkaffe_bissawt \
+		    -L../../packages/biss-net.com/APIawt/lib -lbissawt \
 		"
 	fi
 
@@ -989,7 +992,7 @@
 			packages/epfl.ch/APIawt/lib/Makefile \
 		"
 		NOSHAREDLIBS="$NOSHAREDLIBS \
-			-L../../packages/epfl.ch/APIawt/lib -lkaffe_sawt \
+			-L../../packages/epfl.ch/APIawt/lib -lsawt \
 		"
 	fi
 	NOSHAREDLIBS="$NOSHAREDLIBS $X_LIBRARIES"
@@ -1002,12 +1005,33 @@
   AC_DEFINE(HAVE_PACKAGE_EPFL_CH)
 fi
 
+changequote(<<, >>)dnl
+dnl Configure in the Guarana stuff.
+if test x"$enable_guarana" != xno &&
+   test -f $srcdir/packages/guarana.unicamp.br/Makefile.in ; then
+	packages="$packages guarana.unicamp.br"
+	make_output="$make_output \
+		packages/guarana.unicamp.br/Makefile \
+		packages/guarana.unicamp.br/APIguarana/Makefile \
+		packages/guarana.unicamp.br/APIguarana/lib/Makefile \
+	"
+	GUARANALIBS=" \
+		-L../../packages/guarana.unicamp.br/APIguarana/lib -lguarana \
+	"
+	changequote([, ])dnl
+	GUARANA_CLASSPATH=\$libdir/libguarana.so:$datadir/kaffe/guarana.jar
+	AC_DEFINE(HAVE_PACKAGE_GUARANA_UNICAMP_BR)
+	AC_DEFINE(GUARANA)
+else
+	GUARANA_CLASSPATH=
+fi
+
 dnl If we have share libraries, cancel all the non-shared ones.
 dnl  Otherwise, add on the machine again to help linking.
 if test "$dynamic_libraries" = "yes" ; then
-	NOSHAREDLIBS="-L../kaffevm -lkaffevm"
+	NOSHAREDLIBS="-L../kaffevm -lkaffevm $GUARANALIBS"
 else
-	NOSHAREDLIBS="-L../kaffevm -lkaffevm $NOSHAREDLIBS -lkaffevm $LIBS"
+	NOSHAREDLIBS="-L../kaffevm -lkaffevm $GUARANALIBS $NOSHAREDLIBS -lkaffevm $LIBS"
 	PIC=""
 	PICVM=""
 	LIBSHARE=""
@@ -1027,8 +1051,17 @@
 
 AC_SUBST(subdirs)
 AC_SUBST(packages)
+
+if test x"$PATHSEP" = x; then
+	if test "$SYSTEM" = "win32" ; then
+		PATHSEP=";"
+	else
+		PATHSEP=":"
+	fi
+fi
+AC_SUBST(PATHSEP)
 
-AC_CONFIG_HEADER(config/config.h include/jtypes.h)
+AC_CONFIG_HEADER(config/config.h include/jtypes.h include/guarana.h)
 AC_OUTPUT($make_output)
 
 dnl =========================================================================
@@ -1038,28 +1071,29 @@
 libdir=`eval echo $libdir` ; libdir=`eval echo $libdir`
 bindir=`eval echo $bindir` ; bindir=`eval echo $bindir`
 datadir=`eval echo $datadir`
+GUARANA_CLASSPATH=`eval echo $GUARANA_CLASSPATH`
 
 if test "$SYSTEM" = "unix" ; then
 	if test "$awt_toolkit" != "none" ; then
-		echo CLASSPATH=.:$datadir/kaffe/classes.zip:$datadir/kaffe/$awt_toolkit.zip > ENVIRONMENT
+		echo CLASSPATH=.${PATHSEP}$datadir/kaffe/classes.zip${PATHSEP}$datadir/kaffe/$awt_toolkit.zip${GUARANA_CLASSPATH+${PATHSEP}$GUARANA_CLASSPATH} > ENVIRONMENT
 	else
-		echo CLASSPATH=.:$datadir/kaffe/classes.zip > ENVIRONMENT
+		echo CLASSPATH=.${PATHSEP}$datadir/kaffe/classes.zip${GUARANA_CLASSPATH+${PATHSEP}$GUARANA_CLASSPATH} > ENVIRONMENT
 	fi
 	echo KAFFEHOME=$datadir/kaffe >> ENVIRONMENT
 	if test "$dynamic_libraries" = "yes" ; then
-		echo LD_LIBRARY_PATH=$libdir:\$LD_LIBRARY_PATH >> ENVIRONMENT
+		echo LD_LIBRARY_PATH=$libdir${PATHSEP}\$LD_LIBRARY_PATH >> ENVIRONMENT
 	fi
-	echo PATH=$bindir:\$PATH >> ENVIRONMENT
+	echo PATH=$bindir${PATHSEP}\$PATH >> ENVIRONMENT
 	echo export CLASSPATH KAFFEHOME LD_LIBRARY_PATH PATH >> ENVIRONMENT
 elif test "$SYSTEM" = "win32" ; then
 	echo @echo off > ENVIRONMENT.BAT
 	if test "$awt_toolkit" != "none" ; then
-		echo set CLASSPATH=.\;$datadir/kaffe/classes.zip\;$datadir/kaffe/$awt_toolkit >> ENVIRONMENT.BAT
+		echo set CLASSPATH=.${PATHSEP}$datadir/kaffe/classes.zip${PATHSEP}$datadir/kaffe/$awt_toolkit${GUARANA_CLASSPATH+${PATHSEP}$GUARANA_CLASSPATH} >> ENVIRONMENT.BAT
 	else
-		echo set CLASSPATH=.\;$datadir/kaffe/classes.zip >> ENVIRONMENT.BAT
+		echo set CLASSPATH=.${PATHSEP}$datadir/kaffe/classes.zip${GUARANA_CLASSPATH+${PATHSEP}$GUARANA_CLASSPATH} >> ENVIRONMENT.BAT
 	fi
 	echo set KAFFEHOME=$datadir/kaffe >> ENVIRONMENT.BAT
-	echo set PATH=%PATH%\;$bindir >> ENVIRONMENT.BAT
+	echo set PATH=%PATH%${PATHSEP}$bindir >> ENVIRONMENT.BAT
 fi
 
 dnl -------------------------------------------------------------------------
Index: kaffe/config/config.h.in
diff -u kaffe/config/config.h.in:1.1.1.4 kaffe/config/config.h.in:1.5
--- kaffe/config/config.h.in:1.1.1.4	Mon Jun 30 20:44:29 1997
+++ kaffe/config/config.h.in	Thu Aug  7 14:39:40 1997
@@ -316,6 +316,7 @@
 #undef	HAVE_PACKAGE_JAVASOFT_COM
 #undef	HAVE_PACKAGE_BISS_NET_COM
 #undef	HAVE_PACKAGE_EPFL_CH
+#undef  HAVE_PACKAGE_GUARANA_UNICAMP_BR
 
 /* Do we use native threads and locks */
 #undef	USE_NATIVE_THREADS
@@ -326,6 +327,9 @@
 
 /* Kaffe version number */
 #undef	KAFFEVERSION
+
+/* Enable Guarana reflexive kernel */
+#undef  GUARANA
 
 /* Provide default types which might be missing */
 #undef	size_t
Index: kaffe/config/sparc/sunos/md.h
diff -u kaffe/config/sparc/sunos/md.h:1.1.1.1 kaffe/config/sparc/sunos/md.h:1.3
--- kaffe/config/sparc/sunos/md.h:1.1.1.1	Mon May  5 21:20:51 1997
+++ kaffe/config/sparc/sunos/md.h	Wed Feb 25 08:24:49 1998
@@ -19,4 +19,9 @@
 #include "jit-md.h"
 #endif
 
+#ifdef GUARANA
+#define VA_LIST_T sunos_va_list_t
+typedef char *VA_LIST_T;
+#endif
+
 #endif
Index: kaffe/include/Makefile.in
diff -u kaffe/include/Makefile.in:1.1.1.3 kaffe/include/Makefile.in:1.4
--- kaffe/include/Makefile.in:1.1.1.3	Mon Oct  6 22:50:01 1997
+++ kaffe/include/Makefile.in	Thu Aug  7 04:09:56 1997
@@ -14,6 +14,12 @@
 INSTALL_DATA=	@INSTALL_DATA@
 MKDIR=		@MKDIR@
 
+SHELL=		/bin/sh
+
+BUILT_INCLUDEFILES= \
+		jtypes.h \
+		guarana.h
+
 INCLUDEFILES= \
 		native.h \
 		StubPreamble.h \
@@ -23,18 +29,20 @@
 		java_lang_Throwable.h \
 		java_lang_Thread.h \
 		java_lang_ThreadGroup.h
-
 
-all:
+all: $(BUILT_INCLUDEFILES)
 
 clean:
 
 distclean:
-		rm -f Makefile jtypes.h
+		rm -f Makefile $(BUILT_INCLUDEFILES)
 
 install:
 		test -d $(incdir) || $(MKDIR) $(incdir)
-		$(INSTALL_DATA) jtypes.h $(incdir)/jtypes.h
+		for i in $(BUILT_INCLUDEFILES) ;\
+		do \
+			$(INSTALL_DATA) $$i $(incdir)/$$i ;\
+		done
 		for i in $(INCLUDEFILES) ;\
 		do \
 			$(INSTALL_DATA) $(srcdir)/$$i $(incdir)/$$i ;\
Index: kaffe/include/guarana.h.in
diff -u /dev/null kaffe/include/guarana.h.in:1.1
--- /dev/null	Mon Apr 13 06:51:19 1998
+++ kaffe/include/guarana.h.in	Fri May 16 19:21:19 1997
@@ -0,0 +1,18 @@
+/* guarana.h
+ * Enable or disable Guarana's Reflective Kernel and MetaObject support
+ *
+ * Written by Alexandre Oliva <oliva@dcc.unicamp.br>
+ */
+
+#ifndef __guarana_h
+#define __guarana_h
+
+#ifndef GUARANA
+#undef GUARANA
+#endif
+
+#ifdef GUARANA
+struct HBR_unicamp_Guarana_MetaObject;
+#endif
+
+#endif
Index: kaffe/include/java_lang_Object.h
diff -u kaffe/include/java_lang_Object.h:1.1.1.1 kaffe/include/java_lang_Object.h:1.2
--- kaffe/include/java_lang_Object.h:1.1.1.1	Fri May 16 06:35:31 1997
+++ kaffe/include/java_lang_Object.h	Fri May 16 19:21:20 1997
@@ -12,10 +12,15 @@
 #ifndef __java_lang_object_h
 #define __java_lang_object_h
 
+#include <guarana.h>
+
 struct _dispatchTable;
 
 typedef struct Hjava_lang_Object {
 	struct _dispatchTable*  dtable;
+#ifdef GUARANA
+	struct HBR_unicamp_Guarana_MetaObject* meta_object;
+#endif
 	/* Data follows on immediately */
 } Hjava_lang_Object;
 
Index: kaffe/kaffe/kaffevm/Makefile.in
diff -u kaffe/kaffe/kaffevm/Makefile.in:1.1.1.5 kaffe/kaffe/kaffevm/Makefile.in:1.5
--- kaffe/kaffe/kaffevm/Makefile.in:1.1.1.5	Mon Oct  6 22:50:16 1997
+++ kaffe/kaffe/kaffevm/Makefile.in	Wed Feb 25 08:42:27 1998
@@ -84,6 +84,10 @@
 .c$(OBJEXT):
 		$(CC) $(ALL_CFLAGS) -c $(PIC) $<
 
+.SUFFIXES: .i
+.c.i:
+		$(CC) $(ALL_CFLAGS) -E $< -o $@
+
 gc.o:		gc.h gc.c gc-incremental.c gc-incremental.h
 
 clean:
@@ -101,5 +105,5 @@
 		$(LN) $(LIB) $(libdir)/$(LLIB)
 
 lib.exp:
-		$(DLLTOOL) --def $(srcdir)/$(LIBNAME).def --output-exp lib.exp --output-lib $(LIBNAME).a --dllname $(LLIB)
+		$(DLLTOOL) --def $(srcdir)/`echo $(LIBNAME) | sed 's/^libkaffe/libkaffe_/'`.def --output-exp lib.exp --output-lib $(LIBNAME).a --dllname $(LLIB)
 		touch lib.exp
Index: kaffe/kaffe/kaffevm/classMethod.c
diff -u kaffe/kaffe/kaffevm/classMethod.c:1.1.1.4 kaffe/kaffe/kaffevm/classMethod.c:1.7
--- kaffe/kaffe/kaffevm/classMethod.c:1.1.1.4	Mon Oct  6 22:50:20 1997
+++ kaffe/kaffe/kaffevm/classMethod.c	Wed Feb 25 07:32:28 1998
@@ -667,7 +667,11 @@
 buildDispatchTable(Hjava_lang_Class* class)
 {
 	Method* meth;
+#ifdef GUARANA
+	dispatchMethod* mtab;
+#else
 	void** mtab;
+#endif
 	int i;
 	int ntramps = 0;
 #if defined(TRANSLATOR) && defined(HAVE_TRAMPOLINE)
@@ -723,10 +727,10 @@
 	   one block of memory.  This is primarily done for GC reasons in
 	   that I didn't want to add another slot on class just for holding
 	   the trampolines, but it also works out for space reasons.  */
-	class->dtable = (dispatchTable*)gc_malloc(sizeof(dispatchTable) + class->msize * sizeof(void*) + ntramps * sizeof(methodTrampoline), &gcDispatchTable);
+	class->dtable = (dispatchTable*)gc_malloc(sizeof(dispatchTable) + class->msize * DTABLE_METHODSIZE + ntramps * sizeof(methodTrampoline), &gcDispatchTable);
 	tramp = (methodTrampoline*) &class->dtable->method[class->msize];
 #else
-	class->dtable = (dispatchTable*)gc_malloc(sizeof(dispatchTable) + (class->msize * sizeof(void*)), &gcDispatchTable);
+	class->dtable = (dispatchTable*)gc_malloc(sizeof(dispatchTable) + (class->msize * DTABLE_METHODSIZE), &gcDispatchTable);
 #endif
 
 	class->dtable->class = class;
@@ -734,9 +738,18 @@
 
 	/* Install inherited methods into dispatch table. */
 	if (class->superclass != NULL) {
+#ifdef GUARANA
+		dispatchMethod* super_mtab = class->superclass->dtable->method;
+#else
 		Method** super_mtab = (Method**)class->superclass->dtable->method;
+#endif
 		for (i = 0; i < class->superclass->msize; i++) {
+#ifdef GUARANA
+			DMETHOD_ADDR(mtab[i]) = DMETHOD_ADDR(super_mtab[i]);
+			DMETHOD_DESC(mtab[i]) = DMETHOD_DESC(super_mtab[i]);
+#else
 			mtab[i] = super_mtab[i];
+#endif
 		}
 	}
 
@@ -750,7 +763,12 @@
 			tramp++;
 		}
 		if (meth->idx >= 0) {
+#ifdef GUARANA
+		        DMETHOD_DESC(mtab[meth->idx]) = meth;
+		        DMETHOD_ADDR(mtab[meth->idx]) = METHOD_NATIVECODE(meth);
+#else
 			mtab[meth->idx] = METHOD_NATIVECODE(meth);
+#endif
 		}
 	}
 	FLUSH_DCACHE(class->dtable, tramp);
@@ -766,7 +784,11 @@
 	 * See "Java Language Specification" (1996) section 12.3.2. */
 	if ((class->accflags & ACC_ABSTRACT) == 0) {
 		for (i = class->msize - 1; i >= 0; i--) {
+#ifdef GUARANA
+			if (DMETHOD_ADDR(mtab[i]) == NULL) {
+#else
 			if (mtab[i] == NULL) {
+#endif
 				throwException(AbstractMethodError);
 			}
 		}
@@ -782,8 +804,13 @@
 void
 fixupDispatchTable(Hjava_lang_Class *c, nativecode *ocode, nativecode *ncode, int idx)
 {
+#ifdef GUARANA
+	if (DMETHOD_ADDR(c->dtable->method[idx]) == ocode) {
+	        DMETHOD_ADDR(c->dtable->method[idx]) = ncode;
+#else
 	if (c->dtable->method[idx] == ocode) {
 		c->dtable->method[idx] = ncode;
+#endif
 		for (c = c->subclass_head; c; c = c->subclass_next) {
 			fixupDispatchTable(c, ocode, ncode, idx);
 		}
@@ -1061,4 +1088,73 @@
 	}
 	return (NULL);
 }
+#endif
+
+#ifdef GUARANA
+#if defined(GENERIC_VA_LIST_TO_ARGLIST) || defined(GENERIC_ARGLIST_TO_VA_LIST)
+#include <stdarg.h>
+
+static int va_list_test_direction(int i, ...) {
+  va_list args;
+  int *j, *k;
+  va_start(args, i);
+  j = &va_arg(args, int);
+  k = &va_arg(args, int);
+  i = k - j;
+  va_end(args);
+  return -(i < 0);
+}
+
+/* determines, for two consecutive arguments in a va_list, whether the
+   second is stored in a lower memory address (-1) or the first is (0) */
+static int va_list_direction() {
+  static int direction = 1;
+  if (direction == 1) {
+    direction = va_list_test_direction(1, 2, 3);
+    if (direction != -1 && direction != 0)
+      unimp("generic argument list manipulation: not implemented");
+  }
+  return direction;
+}
+
+static int va_list_test_offset(int i, ...) {
+  va_list args;
+  va_start(args, i);
+  i = *(int *)args;
+  va_end(args);
+  return i;
+}
+
+/* checks whether any (word) offset is necessary to make a va_list
+   point to its first argument.  Return -1, 0 or 1 as follows:
+Word
+   0  list             Arg3     Arg3      Arg1
+   1  Arg1  list/Arg1  Arg2     Arg2   list/Arg2
+   2  Arg2    Arg2     Arg1  list/Arg1    Arg3
+   3  Arg3    Arg3     list
+Res:   +1       0        0       +1        -1
+*/
+static int va_list_offset() {
+  static int offset = -3;
+  if (offset == -3) {
+    int direction = va_list_direction();
+    offset = va_list_test_offset(2*direction-1, 0, 1-2*direction);
+    if (!(offset == -1 || offset == 0 || offset == 1))
+      unimp("generic argument list manipulation: not implemented");
+  }
+  return offset;
+}
+
+#ifdef GENERIC_VA_LIST_TO_ARGLIST
+ARGLIST_T generic_va_list_to_arglist(int wordcount, VA_LIST_T args) {
+  return &((int32*)args)[va_list_direction()*wordcount + va_list_offset()];
+}
+#endif
+
+#ifdef GENERIC_ARGLIST_TO_VA_LIST
+va_list generic_arglist_to_va_list(int wordcount, ARGLIST_T lst) {
+  return &((int *)lst)[-(va_list_direction()*wordcount + va_list_offset())];
+}
+#endif
+#endif
 #endif
Index: kaffe/kaffe/kaffevm/classMethod.h
diff -u kaffe/kaffe/kaffevm/classMethod.h:1.1.1.4 kaffe/kaffe/kaffevm/classMethod.h:1.10
--- kaffe/kaffe/kaffevm/classMethod.h:1.1.1.4	Mon Oct  6 22:50:21 1997
+++ kaffe/kaffe/kaffevm/classMethod.h	Wed Feb 25 07:55:09 1998
@@ -117,16 +117,49 @@
 	struct _jexception*	exception_table;
 } methods;
 
+#if defined(GUARANA)
+
+#if defined(TRANSLATOR)
+
+#define METHOD_NATIVEOFFSET	((int)&(((methods*)0)->ncode))
+
+typedef struct _dispatchMethod {
+	void *addr;
+	Method *desc;
+} dispatchMethod;
+
+#define DMETHOD_ADDR(dm)	(dm.addr)
+#define DMETHOD_DESC(dm)	(dm.desc)
+#define DMETHOD_DESCOFFSET	((int)&(((dispatchMethod*)0)->desc))
+
+#else
+typedef void *dispatchMethod;
+
+#define DMETHOD_ADDR(dm)	(dm)
+#define DMETHOD_DESC(dm)	(dm)
+#define DMETHOD_DESCOFFSET	0
+#endif
+#endif
+
 typedef struct _dispatchTable {
 	Hjava_lang_Class*	class;
-	void*			method[1];
+#ifdef GUARANA
+        dispatchMethod method[1];
+#else
+        void *method[1];
+#endif
 } dispatchTable;
 
 #define	CLASS_STATE		((int)&(((Hjava_lang_Class*)0)->state))
 
 #define	DTABLE_CLASS		0
+#ifdef GUARANA
+#define	DTABLE_METHODOFFSET	((int)&(((dispatchTable*)0)->method[0]))
+#define	DTABLE_METHODSIZE	(sizeof(((dispatchTable*)0)->method[0]))
+#else
 #define	DTABLE_METHODOFFSET	(sizeof(void*))
 #define	DTABLE_METHODSIZE	(sizeof(void*))
+#endif
 
 typedef struct _fields {
 	Utf8Const*		name;
@@ -252,4 +285,75 @@
 extern Utf8Const* LineNumberTable_name;	/* "LineNumberTable" */
 extern Utf8Const* ConstantValue_name;	/* "ConstantValue" */
 
+#ifdef GUARANA
+#include <stdarg.h>
+
+#ifndef WORDS_IN_SIGNATURE
+#define WORDS_IN_SIGNATURE(sig) ({ char *mysig = (sig); sizeofSig(&mysig, true); })
+#endif
+
+#ifndef METHOD_SIGNATURE
+#define METHOD_SIGNATURE(method) ((method)->signature->data)
+#endif
+
+/* Any of the definitions below may be overridden in a machine
+ * configuration file. */
+
+#ifndef ARGLIST_T
+#define ARGLIST_T generic_arglist_t
+
+typedef void *ARGLIST_T;
+#endif
+
+#ifndef VA_LIST_T
+#define VA_LIST_T generic_va_list_t
+
+typedef void *VA_LIST_T;
+#endif
+
+/* allocate a block of memory large enough to store a copy of the
+ * argument list of the given signature, and return a pointer to the
+ * beginning of the block, even if it is not a pointer to the first
+ * argument.  */
+#ifndef ALLOC_ARGLIST_FOR
+#define ALLOC_ARGLIST_FOR(sig) ((ARGLIST_T)gc_malloc(sizeof(int32)*WORDS_IN_SIGNATURE(sig), &gcNormal))
+#endif
+
+/* Copy the argument list stored in `from' to `to'.  Both should point
+ * to the beginning of the memory blocks that contain the argument
+ * lists, just as returned by ALLOC_ARGLIST_FOR */
+#ifndef COPY_ARGLIST_FROM_TO
+#define COPY_ARGLIST_FROM_TO(sig, from, to) memmove(to, from, WORDS_IN_SIGNATURE(sig)*sizeof(jword))
+#endif
+
+/* Append an argument to an argument list, and make it `refer' to the
+ * next argument.  This is *very* unportable.  You may have to do
+ * magic on certain platforms.  */
+#ifndef VA_ADD_ARG
+#define VA_ADD_ARG(args, type, nextarg) (va_arg(args, type) = nextarg)
+#endif
+
+/* Given a va_list just va_start()ed, returns a pointer to the
+ * beginning of the memory area that should be copied to preserve this
+ * argument list.  Additional memory may be allocated, as long as it
+ * is controlled by the garbage collector: gc_malloc(size,&gcNormal)
+ * */
+#ifndef VA_LIST_TO_ARGLIST
+#define GENERIC_VA_LIST_TO_ARGLIST 1
+extern ARGLIST_T generic_va_list_to_arglist(int words, va_list args);
+#define VA_LIST_TO_ARGLIST(sig,args) generic_va_list_to_arglist(WORDS_IN_SIGNATURE(sig),(args))
+#endif
+
+/* Given a pointer to a memory region that stores a copy of an
+ * argument list, returns a va_list just va_start()ed, so that the
+ * first use of va_arg() should refer to the first stored argument.
+ * Additional memory may be allocated, as long as it is controlled by
+ * the garbage collector: gc_malloc(size,&gcNormal) */
+#ifndef ARGLIST_TO_VA_LIST
+#define GENERIC_ARGLIST_TO_VA_LIST 1
+extern va_list generic_arglist_to_va_list(int words, ARGLIST_T list);
+#define ARGLIST_TO_VA_LIST(sig, list) generic_arglist_to_va_list(WORDS_IN_SIGNATURE(sig),(list))
+#endif
+
+#endif
 #endif
Index: kaffe/kaffe/kaffevm/kaffe.def
diff -u kaffe/kaffe/kaffevm/kaffe.def:1.1.1.4 kaffe/kaffe/kaffevm/kaffe.def:1.11
--- kaffe/kaffe/kaffevm/kaffe.def:1.1.1.4	Mon Oct  6 22:50:42 1997
+++ kaffe/kaffe/kaffevm/kaffe.def	Wed Feb 18 10:11:47 1998
@@ -580,6 +580,19 @@
 	check_stack_intarray(1);
 
 	CHECK_NULL (IALOAD, rstack(1), 34);
+
+#ifdef GUARANA
+	slot_alloctmp(tmp2);
+
+	load_offset_ref(tmp2, rstack(1), META_OBJECT_OFFSET);
+
+	end_basic_block();
+
+	cbranch_ref_const_ne(tmp2, 0, reference_label(IALOAD, 32));
+
+	start_basic_block();
+#endif
+
 	slot_alloctmp(tmp);
 
 	/* Check we are within the array bounds */
@@ -593,6 +606,21 @@
 	add_ref(rstack(0), rstack(1), rstack(0));
 	load_offset_int(wstack(1), rstack(0), object_array_offset);
 
+#ifdef GUARANA
+	end_basic_block();
+
+	branch_a(reference_label(IALOAD, 33));
+
+	set_label(IALOAD, 32);
+
+	start_basic_block();
+	softcall_reify_array_load(tmp2, rstack(1), rstack(0), int, wstack(1));
+	slot_nowriteback(tmp2);
+	end_basic_block();
+	set_label(IALOAD, 33);
+	start_basic_block();
+#endif
+
 	pop(1);
 }
 
@@ -605,6 +633,19 @@
 	check_stack_longarray(1);
 
 	CHECK_NULL (LALOAD, rstack(1), 34);
+
+#ifdef GUARANA
+	slot_alloctmp(tmp2);
+
+	load_offset_ref(tmp2, rstack(1), META_OBJECT_OFFSET);
+
+	end_basic_block();
+
+	cbranch_ref_const_ne(tmp2, 0, reference_label(LALOAD, 32));
+
+	start_basic_block();
+#endif
+
 	slot_alloctmp(tmp);
 
 	/* Check we are within the array bounds */
@@ -620,6 +661,21 @@
 	}
 	add_ref(tmp, rstack(1), tmp);
 	load_long(wstack(0), tmp);
+
+#ifdef GUARANA
+	end_basic_block();
+
+	branch_a(reference_label(LALOAD, 33));
+
+	set_label(LALOAD, 32);
+
+	start_basic_block();
+	softcall_reify_array_load(tmp2, rstack(1), rstack(0), long, wstack(0));
+	slot_nowriteback(tmp2);
+	end_basic_block();
+	set_label(LALOAD, 33);
+	start_basic_block();
+#endif
 }
 
 define_insn(FALOAD)
@@ -631,6 +687,19 @@
 	check_stack_floatarray(1);
 
 	CHECK_NULL (FALOAD, rstack(1), 34);
+
+#ifdef GUARANA
+	slot_alloctmp(tmp2);
+
+	load_offset_ref(tmp2, rstack(1), META_OBJECT_OFFSET);
+
+	end_basic_block();
+
+	cbranch_ref_const_ne(tmp2, 0, reference_label(FALOAD, 32));
+
+	start_basic_block();
+#endif
+
 	slot_alloctmp(tmp);
 
 	/* Check we are within the array bounds */
@@ -647,6 +716,21 @@
 	add_ref(tmp, rstack(1), tmp);
 	load_float(wstack(1), tmp);
 
+#ifdef GUARANA
+	end_basic_block();
+
+	branch_a(reference_label(FALOAD, 33));
+
+	set_label(FALOAD, 32);
+
+	start_basic_block();
+	softcall_reify_array_load(tmp2, rstack(1), rstack(0), float, wstack(1));
+	slot_nowriteback(tmp2);
+	end_basic_block();
+	set_label(FALOAD, 33);
+	start_basic_block();
+#endif
+
 	pop(1);
 }
 
@@ -659,6 +743,19 @@
 	check_stack_doublearray(1);
 
 	CHECK_NULL (DALOAD, rstack(1), 34);
+
+#ifdef GUARANA
+	slot_alloctmp(tmp2);
+
+	load_offset_ref(tmp2, rstack(0), META_OBJECT_OFFSET);
+
+	end_basic_block();
+
+	cbranch_ref_const_ne(tmp2, 0, reference_label(DALOAD, 32));
+
+	start_basic_block();
+#endif
+
 	slot_alloctmp(tmp);
 
 	/* Check we are within the array bounds */
@@ -674,6 +771,21 @@
 	}
 	add_ref(tmp, rstack(1), tmp);
 	load_double(wstack(0), tmp);
+
+#ifdef GUARANA
+	end_basic_block();
+
+	branch_a(reference_label(DALOAD, 33));
+
+	set_label(DALOAD, 32);
+
+	start_basic_block();
+	softcall_reify_array_load(tmp2, rstack(1), rstack(0), double, wstack(0));
+	slot_nowriteback(tmp2);
+	end_basic_block();
+	set_label(DALOAD, 33);
+	start_basic_block();
+#endif
 }
 
 define_insn(AALOAD)
@@ -685,6 +797,19 @@
 	check_stack_refarray(1);
 
 	CHECK_NULL(AALOAD, rstack(1), 34);
+
+#ifdef GUARANA
+	slot_alloctmp(tmp2);
+
+	load_offset_ref(tmp2, rstack(1), META_OBJECT_OFFSET);
+
+	end_basic_block();
+
+	cbranch_ref_const_ne(tmp2, 0, reference_label(AALOAD, 32));
+
+	start_basic_block();
+#endif
+
 	slot_alloctmp(tmp);
 
 	/* Check we are within the array bounds */
@@ -698,6 +823,21 @@
 	add_ref(rstack(0), rstack(1), rstack(0));
 	load_offset_ref(wstack(1), rstack(0), object_array_offset);
 
+#ifdef GUARANA
+	end_basic_block();
+
+	branch_a(reference_label(AALOAD, 33));
+
+	set_label(AALOAD, 32);
+
+	start_basic_block();
+	softcall_reify_array_load(tmp2, rstack(1), rstack(0), ref, wstack(1));
+	slot_nowriteback(tmp2);
+	end_basic_block();
+	set_label(AALOAD, 33);
+	start_basic_block();
+#endif
+
 	pop(1);
 }
 
@@ -710,6 +850,19 @@
 	check_stack_bytearray(1);
 
 	CHECK_NULL(BALOAD, rstack(1), 34);
+
+#ifdef GUARANA
+	slot_alloctmp(tmp2);
+
+	load_offset_ref(tmp2, rstack(1), META_OBJECT_OFFSET);
+
+	end_basic_block();
+
+	cbranch_ref_const_ne(tmp2, 0, reference_label(BALOAD, 32));
+
+	start_basic_block();
+#endif
+
 	slot_alloctmp(tmp);
 
 	/* Check we are within the array bounds */
@@ -731,6 +884,21 @@
 	add_ref(tmp, rstack(1), tmp);
 	load_byte(wstack(1), tmp);
 
+#ifdef GUARANA
+	end_basic_block();
+
+	branch_a(reference_label(BALOAD, 33));
+
+	set_label(BALOAD, 32);
+
+	start_basic_block();
+	softcall_reify_array_load(tmp2, rstack(1), rstack(0), byte, wstack(1));
+	slot_nowriteback(tmp2);
+	end_basic_block();
+	set_label(BALOAD, 33);
+	start_basic_block();
+#endif
+
 	pop(1);
 }
 
@@ -743,6 +911,19 @@
 	check_stack_chararray(1);
 
 	CHECK_NULL(CALOAD, rstack(1), 34);
+
+#ifdef GUARANA
+	slot_alloctmp(tmp2);
+
+	load_offset_ref(tmp2, rstack(1), META_OBJECT_OFFSET);
+
+	end_basic_block();
+
+	cbranch_ref_const_ne(tmp2, 0, reference_label(CALOAD, 32));
+
+	start_basic_block();
+#endif
+
 	slot_alloctmp(tmp);
 
 	/* Check we are within the array bounds */
@@ -759,6 +940,21 @@
 	add_ref(tmp, rstack(1), tmp);
 	load_char(wstack(1), tmp);
 
+#ifdef GUARANA
+	end_basic_block();
+
+	branch_a(reference_label(CALOAD, 33));
+
+	set_label(CALOAD, 32);
+
+	start_basic_block();
+	softcall_reify_array_load(tmp2, rstack(1), rstack(0), char, wstack(1));
+	slot_nowriteback(tmp2);
+	end_basic_block();
+	set_label(CALOAD, 33);
+	start_basic_block();
+#endif
+
 	pop(1);
 }
 
@@ -771,6 +967,19 @@
 	check_stack_shortarray(1);
 
 	CHECK_NULL(SALOAD, rstack(1), 34);
+
+#ifdef GUARANA
+	slot_alloctmp(tmp2);
+
+	load_offset_ref(tmp2, rstack(1), META_OBJECT_OFFSET);
+
+	end_basic_block();
+
+	cbranch_ref_const_ne(tmp2, 0, reference_label(SALOAD, 32));
+
+	start_basic_block();
+#endif
+
 	slot_alloctmp(tmp);
 
 	/* Check we are within the array bounds */
@@ -787,6 +996,21 @@
 	add_ref(tmp, rstack(1), tmp);
 	load_short(wstack(1), tmp);
 
+#ifdef GUARANA
+	end_basic_block();
+
+	branch_a(reference_label(SALOAD, 33));
+
+	set_label(SALOAD, 32);
+
+	start_basic_block();
+	softcall_reify_array_load(tmp2, rstack(1), rstack(0), short, wstack(1));
+	slot_nowriteback(tmp2);
+	end_basic_block();
+	set_label(SALOAD, 33);
+	start_basic_block();
+#endif
+
 	pop(1);
 }
 
@@ -1125,6 +1349,19 @@
 	check_stack_intarray(2);
 
 	CHECK_NULL(IASTORE, rstack(2), 34);
+
+#ifdef GUARANA
+	slot_alloctmp(tmp2);
+
+	load_offset_ref(tmp2, rstack(2), META_OBJECT_OFFSET);
+
+	end_basic_block();
+
+	cbranch_ref_const_ne(tmp2, 0, reference_label(IASTORE, 32));
+
+	start_basic_block();
+#endif
+
 	slot_alloctmp(tmp);
 
 	/* Check we are within the array bounds */
@@ -1138,6 +1375,21 @@
 	add_ref(rstack(1), rstack(2), rstack(1));
 	store_offset_int(rstack(1), object_array_offset, rstack(0));
 
+#ifdef GUARANA
+	end_basic_block();
+
+	branch_a(reference_label(IASTORE, 33));
+
+	set_label(IASTORE, 32);
+
+	start_basic_block();
+	softcall_reify_array_store(tmp2, rstack(2), rstack(1), int, rstack(0));
+	slot_nowriteback(tmp2);
+	end_basic_block();
+	set_label(IASTORE, 33);
+	start_basic_block();
+#endif
+
 	pop(3);
 }
 
@@ -1151,6 +1403,19 @@
 	check_stack_longarray(2);
 
 	CHECK_NULL(LASTORE, rstack(3), 34);
+
+#ifdef GUARANA
+	slot_alloctmp(tmp2);
+
+	load_offset_ref(tmp2, rstack(3), META_OBJECT_OFFSET);
+
+	end_basic_block();
+
+	cbranch_ref_const_ne(tmp2, 0, reference_label(LASTORE, 32));
+
+	start_basic_block();
+#endif
+
 	slot_alloctmp(tmp);
 
 	/* Check we are within the array bounds */
@@ -1167,6 +1432,21 @@
 	add_ref(tmp, rstack(3), tmp);
 	store_long(tmp, rstack(0));
 
+#ifdef GUARANA
+	end_basic_block();
+
+	branch_a(reference_label(LASTORE, 33));
+
+	set_label(LASTORE, 32);
+
+	start_basic_block();
+	softcall_reify_array_store(tmp2, rstack(3), rstack(2), long, rstack(0));
+	slot_nowriteback(tmp2);
+	end_basic_block();
+	set_label(LASTORE, 33);
+	start_basic_block();
+#endif
+
 	pop(4);
 }
 
@@ -1180,6 +1460,19 @@
 	check_stack_floatarray(2);
 
 	CHECK_NULL(FASTORE, rstack(2), 34);
+
+#ifdef GUARANA
+	slot_alloctmp(tmp2);
+
+	load_offset_ref(tmp2, rstack(2), META_OBJECT_OFFSET);
+
+	end_basic_block();
+
+	cbranch_ref_const_ne(tmp2, 0, reference_label(FASTORE, 32));
+
+	start_basic_block();
+#endif
+
 	slot_alloctmp(tmp);
 
 	/* Check we are within the array bounds */
@@ -1196,6 +1489,21 @@
 	add_ref(tmp, rstack(2), tmp);
 	store_float(tmp, rstack(0));
 
+#ifdef GUARANA
+	end_basic_block();
+
+	branch_a(reference_label(FASTORE, 33));
+
+	set_label(FASTORE, 32);
+
+	start_basic_block();
+	softcall_reify_array_store(tmp2, rstack(2), rstack(1), float, rstack(0));
+	slot_nowriteback(tmp2);
+	end_basic_block();
+	set_label(FASTORE, 33);
+	start_basic_block();
+#endif
+
 	pop(3);
 }
 
@@ -1209,6 +1517,19 @@
 	check_stack_doublearray(2);
 
 	CHECK_NULL(DASTORE, rstack(3), 34);
+
+#ifdef GUARANA
+	slot_alloctmp(tmp2);
+
+	load_offset_ref(tmp2, rstack(3), META_OBJECT_OFFSET);
+
+	end_basic_block();
+
+	cbranch_ref_const_ne(tmp2, 0, reference_label(DASTORE, 32));
+
+	start_basic_block();
+#endif
+
 	slot_alloctmp(tmp);
 
 	/* Check we are within the array bounds */
@@ -1225,6 +1546,21 @@
 	add_ref(tmp, rstack(3), tmp);
 	store_double(tmp, rstack(0));
 
+#ifdef GUARANA
+	end_basic_block();
+
+	branch_a(reference_label(DASTORE, 33));
+
+	set_label(DASTORE, 32);
+
+	start_basic_block();
+	softcall_reify_array_store(tmp2, rstack(3), rstack(2), double, rstack(0));
+	slot_nowriteback(tmp2);
+	end_basic_block();
+	set_label(DASTORE, 33);
+	start_basic_block();
+#endif
+
 	pop(4);
 }
 
@@ -1238,6 +1574,19 @@
 	check_stack_refarray(2);
 
 	CHECK_NULL(AASTORE, rstack(2), 34);
+
+#ifdef GUARANA
+	slot_alloctmp(tmp2);
+
+	load_offset_ref(tmp2, rstack(2), META_OBJECT_OFFSET);
+
+	end_basic_block();
+
+	cbranch_ref_const_ne(tmp2, 0, reference_label(AASTORE, 32));
+
+	start_basic_block();
+#endif
+
 	slot_alloctmp(tmp);
 
 	/* Check we are within the array bounds */
@@ -1255,6 +1604,21 @@
 	add_ref(rstack(1), rstack(2), rstack(1));
 	store_offset_ref(rstack(1), object_array_offset, rstack(0));
 
+#ifdef GUARANA
+	end_basic_block();
+
+	branch_a(reference_label(AASTORE, 33));
+
+	set_label(AASTORE, 32);
+
+	start_basic_block();
+	softcall_reify_array_store(tmp2, rstack(2), rstack(1), ref, rstack(0));
+	slot_nowriteback(tmp2);
+	end_basic_block();
+	set_label(AASTORE, 33);
+	start_basic_block();
+#endif
+
 	pop(3);
 }
 
@@ -1268,17 +1632,30 @@
 	check_stack_bytearray(2);
 
 	CHECK_NULL(BASTORE, rstack(2), 34);
-	slot_alloctmp(tmp);
 
-	/* Check we are within the array bounds */
-	load_offset_int(tmp, rstack(2), object_array_length);
+#ifdef GUARANA
+	slot_alloctmp(tmp2);
 
-	cbranch_int_ult(rstack(1), tmp, reference_label(BASTORE, 23));
-	softcall_badarrayindex();
-	set_label(BASTORE, 23);
+	load_offset_ref(tmp2, rstack(2), META_OBJECT_OFFSET);
 
-	if (SHIFT_jbyte > 0) {
-		lshl_int_const(tmp, rstack(1), SHIFT_jbyte);
+	end_basic_block();
+
+	cbranch_ref_const_ne(tmp2, 0, reference_label(BASTORE, 32));
+
+	start_basic_block();
+#endif
+
+	slot_alloctmp(tmp);
+
+	/* Check we are within the array bounds */
+	load_offset_int(tmp, rstack(2), object_array_length);
+
+	cbranch_int_ult(rstack(1), tmp, reference_label(BASTORE, 23));
+	softcall_badarrayindex();
+	set_label(BASTORE, 23);
+
+	if (SHIFT_jbyte > 0) {
+		lshl_int_const(tmp, rstack(1), SHIFT_jbyte);
 	}
 	else {
 		move_int(tmp, rstack(1));
@@ -1289,6 +1666,21 @@
 	add_ref(tmp, rstack(2), tmp);
 	store_byte(tmp, rstack(0));
 
+#ifdef GUARANA
+	end_basic_block();
+
+	branch_a(reference_label(BASTORE, 33));
+
+	set_label(BASTORE, 32);
+
+	start_basic_block();
+	softcall_reify_array_store(tmp2, rstack(2), rstack(1), byte, rstack(0));
+	slot_nowriteback(tmp2);
+	end_basic_block();
+	set_label(BASTORE, 33);
+	start_basic_block();
+#endif
+
 	pop(3);
 }
 
@@ -1302,6 +1694,19 @@
 	check_stack_chararray(2);
 
 	CHECK_NULL(CASTORE, rstack(2), 34);
+
+#ifdef GUARANA
+	slot_alloctmp(tmp2);
+
+	load_offset_ref(tmp2, rstack(2), META_OBJECT_OFFSET);
+
+	end_basic_block();
+
+	cbranch_ref_const_ne(tmp2, 0, reference_label(CASTORE, 32));
+
+	start_basic_block();
+#endif
+
 	slot_alloctmp(tmp);
 
 	/* Check we are within the array bounds */
@@ -1318,6 +1723,21 @@
 	add_ref(tmp, rstack(2), tmp);
 	store_char(tmp, rstack(0));
 
+#ifdef GUARANA
+	end_basic_block();
+
+	branch_a(reference_label(CASTORE, 33));
+
+	set_label(CASTORE, 32);
+
+	start_basic_block();
+	softcall_reify_array_store(tmp2, rstack(2), rstack(1), char, rstack(0));
+	slot_nowriteback(tmp2);
+	end_basic_block();
+	set_label(CASTORE, 33);
+	start_basic_block();
+#endif
+
 	pop(3);
 }
 
@@ -1331,6 +1751,19 @@
 	check_stack_shortarray(2);
 
 	CHECK_NULL(SASTORE, rstack(2), 34);
+
+#ifdef GUARANA
+	slot_alloctmp(tmp2);
+
+	load_offset_ref(tmp2, rstack(2), META_OBJECT_OFFSET);
+
+	end_basic_block();
+
+	cbranch_ref_const_ne(tmp2, 0, reference_label(SASTORE, 32));
+
+	start_basic_block();
+#endif
+
 	slot_alloctmp(tmp);
 
 	/* Check we are within the array bounds */
@@ -1347,6 +1780,21 @@
 	add_ref(tmp, rstack(2), tmp);
 	store_short(tmp, rstack(0));
 
+#ifdef GUARANA
+	end_basic_block();
+
+	branch_a(reference_label(SASTORE, 33));
+
+	set_label(SASTORE, 32);
+
+	start_basic_block();
+	softcall_reify_array_store(tmp2, rstack(2), rstack(1), short, rstack(0));
+	slot_nowriteback(tmp2);
+	end_basic_block();
+	set_label(SASTORE, 33);
+	start_basic_block();
+#endif
+
 	pop(3);
 }
 
@@ -2476,6 +2924,50 @@
 
 	get_static_field_info(idx);
 	INIT_STATIC_CLASS(field_class());
+
+#ifdef GUARANA
+	slot_alloctmp(tmp2);
+
+	move_ref_const(tmp2, field_class ());
+	load_offset_ref(tmp2, tmp2, META_OBJECT_OFFSET);
+
+	end_basic_block();
+
+	if (FIELD_ISREF(field)) {
+		push(1);
+	}
+	else switch (CLASS_PRIM_SIG(FIELD_TYPE(field))) {
+	case 'I':
+		push(1);
+		break;
+	case 'S':
+		push(1);
+		break;
+	case 'B':
+	case 'Z':
+		push(1);
+		break;
+	case 'C':
+		push(1);
+		break;
+	case 'F':
+		push(1);
+		break;
+	case 'J':
+		push(2);
+		break;
+	case 'D':
+		push(2);
+		break;
+	default:
+		ABORT();
+	}
+
+	cbranch_ref_const_ne(tmp2, 0, reference_label(GETSTATIC, 32));
+
+	start_basic_block();
+#endif
+
 	slot_alloctmp(tmp);
 	move_ref_const(tmp, FIELD_ADDRESS(field));
 
@@ -2483,42 +2975,76 @@
 	   getting data in the right type of register.  */
 
 	if (FIELD_ISREF(field)) {
+#ifndef GUARANA
 		push(1);
+#endif
 		load_ref(wstack(0), tmp);
 	}
 	else switch (CLASS_PRIM_SIG(FIELD_TYPE(field))) {
 	case 'I':
+#ifndef GUARANA
 		push(1);
+#endif
 		load_int(wstack(0), tmp);
 		break;
 	case 'S':
+#ifndef GUARANA
 		push(1);
+#endif
 		load_short(wstack(0), tmp);
 		break;
 	case 'B':
 	case 'Z':
+#ifndef GUARANA
 		push(1);
+#endif
 		load_byte(wstack(0), tmp);
 		break;
 	case 'C':
+#ifndef GUARANA
 		push(1);
+#endif
 		load_char(wstack(0), tmp);
 		break;
 	case 'F':
+#ifndef GUARANA
 		push(1);
+#endif
 		load_float(wstack(0), tmp);
 		break;
 	case 'J':
+#ifndef GUARANA
 		push(2);
+#endif
 		load_long(wstack(0), tmp);
 		break;
 	case 'D':
+#ifndef GUARANA
 		push(2);
+#endif
 		load_double(wstack(0), tmp);
 		break;
 	default:
 		ABORT();
 	}
+
+#ifdef GUARANA
+	end_basic_block();
+
+	branch_a(reference_label(GETSTATIC, 33));
+
+	set_label(GETSTATIC, 32);
+
+	start_basic_block();
+	slot_alloctmp(tmp);
+	move_ref_const(tmp, field_class ());
+	slot_nowriteback(tmp);
+	softcall_reify_field_load(tmp2, tmp);
+	slot_nowriteback(tmp2);
+	end_basic_block();
+	set_label(GETSTATIC, 33);
+	start_basic_block();
+#endif
 }
 
 define_insn(PUTSTATIC)
@@ -2533,46 +3059,110 @@
 
 	get_static_field_info(idx);
 	INIT_STATIC_CLASS(field_class());
+
+#ifdef GUARANA
+	slot_alloctmp(tmp2);
+
+	move_ref_const(tmp2, field_class ());
+	load_offset_ref(tmp2, tmp2, META_OBJECT_OFFSET);
+
+	end_basic_block();
+
+	cbranch_ref_const_ne(tmp2, 0, reference_label(PUTSTATIC, 32));
+
+	start_basic_block();
+#endif
+
 	move_ref_const(tmp, FIELD_ADDRESS(field));
 
 	if (FIELD_ISREF(field)) {
 		SOFT_ADDREFERENCE_STATIC(field_statics(), rstack(0));
 		store_ref(tmp, rstack(0));
+#ifndef GUARANA
 		pop(1);
+#endif
 	}
 	else switch (CLASS_PRIM_SIG(FIELD_TYPE(field))) {
 	case 'I':
 		store_int(tmp, rstack(0));
+#ifndef GUARANA
 		pop(1);
+#endif
 		break;
 	case 'S':
 		store_short(tmp, rstack(0));
+#ifndef GUARANA
 		pop(1);
+#endif
 		break;
 	case 'B':
 	case 'Z':
 		store_byte(tmp, rstack(0));
+#ifndef GUARANA
 		pop(1);
+#endif
 		break;
 	case 'C':
 		store_char(tmp, rstack(0));
+#ifndef GUARANA
 		pop(1);
+#endif
 		break;
 	case 'F':
 		store_float(tmp, rstack(0));
+#ifndef GUARANA
 		pop(1);
+#endif
 		break;
 	case 'J':
 		store_long(tmp, rstack(0));
+#ifndef GUARANA
 		pop(2);
+#endif
 		break;
 	case 'D':
 		store_double(tmp, rstack(0));
+#ifndef GUARANA
 		pop(2);
+#endif
 		break;
 	default:
 		ABORT();
 	}
+#ifdef GUARANA
+	end_basic_block();
+
+	branch_a(reference_label(PUTSTATIC, 33));
+
+	set_label(PUTSTATIC, 32);
+	
+	start_basic_block();
+	slot_alloctmp(tmp);
+	move_ref_const(tmp, field_class());
+	slot_nowriteback(tmp);
+	softcall_reify_field_store(tmp2, tmp);
+	slot_nowriteback(tmp2);
+	end_basic_block();
+	set_label(PUTSTATIC, 33);
+	start_basic_block();
+
+	if (FIELD_ISREF(field)) {
+	  pop(1);
+	} else switch (CLASS_PRIM_SIG(FIELD_TYPE(field))) {
+	case 'Z':
+	case 'C':
+	case 'B':
+	case 'S':
+	case 'I':
+	case 'F':
+	  pop(1);
+	  break;
+	case 'J':
+	case 'D':
+	  pop(2);
+	  break;
+	}
+#endif
 }
 
 define_insn(GETFIELD)
@@ -2592,6 +3182,35 @@
 	/* Use the proper load to increase the chances of the translator
 	   getting data in the right type of register.  */
 
+#ifdef GUARANA
+	slot_alloctmp(tmp2);
+
+	load_offset_ref(tmp2, rstack(0), META_OBJECT_OFFSET);
+
+	end_basic_block();
+
+	if (!FIELD_ISREF(field))
+	  switch (CLASS_PRIM_SIG(FIELD_TYPE(field))) {
+	  case 'Z':
+	  case 'C':
+	  case 'B':
+	  case 'S':
+	  case 'I':
+	  case 'F':
+	    break;
+	  case 'J':
+	  case 'D':
+	    push(1);
+	    break;
+	  default:
+	    ABORT();
+	}
+
+	cbranch_ref_const_ne(tmp2, 0, reference_label(GETFIELD, 32));
+
+	start_basic_block();
+#endif
+
 	if (FIELD_ISREF(field)) {
 		load_offset_ref(wstack(0), rstack(0), FIELD_OFFSET(field));
 	}
@@ -2617,12 +3236,16 @@
 		load_float(stack(0), stack(0));
 		break;
 	case 'J':
+#ifndef GUARANA
 		push(1);
+#endif
 		add_ref_const(stack(0), stack(1), FIELD_OFFSET(field));
 		load_long(stack(0), stack(0));
 		break;
 	case 'D':
+#ifndef GUARANA
 		push(1);
+#endif
 		add_ref_const(stack(0), stack(1), FIELD_OFFSET(field));
 		load_double(stack(0), stack(0));
 		break;
@@ -2630,6 +3253,24 @@
 	default:
 		ABORT();
 	}
+
+#ifdef GUARANA
+	end_basic_block();
+
+	branch_a(reference_label(GETFIELD, 33));
+
+	set_label(GETFIELD, 32);
+	
+	start_basic_block();
+	slot_alloctmp(tmp);
+	move_ref(tmp, rstack(0));	
+	slot_nowriteback(tmp);
+	softcall_reify_field_load(tmp2, tmp);
+	slot_nowriteback(tmp2);
+	end_basic_block();
+	set_label(GETFIELD, 33);
+	start_basic_block();
+#endif
 }
 
 define_insn(PUTFIELD)
@@ -2643,69 +3284,169 @@
 
 	get_field_info(idx);
 
+#ifdef GUARANA
+	slot_alloctmp(tmp);
+	slot_alloctmp(tmp2);
+
+	if (FIELD_ISREF(field)) {
+	  check_stack_ref(1);
+	  CHECK_NULL(PUTFIELD, rstack(1), 42);
+	  move_ref(tmp, rstack(1));
+	} else switch (CLASS_PRIM_SIG(FIELD_TYPE(field))) {
+	case 'Z':
+	case 'C':
+	case 'B':
+	case 'S':
+	case 'I':
+	case 'F':
+	  check_stack_ref(1);
+	  CHECK_NULL(PUTFIELD, rstack(1), 43);
+	  move_ref(tmp, rstack(1));
+	  break;
+	case 'J':
+	case 'D':
+	  check_stack_ref(2);
+	  CHECK_NULL(PUTFIELD, rstack(2), 44);
+	  move_ref(tmp, rstack(2));
+	  break;
+	}
+	load_offset_ref(tmp2, tmp, META_OBJECT_OFFSET);
+
+	end_basic_block();
+
+	cbranch_ref_const_ne(tmp2, 0, reference_label(PUTFIELD, 32));
+
+	start_basic_block();
+#endif
+
 	/* Use the proper store to increase the chances of the translator
 	   having the data in the right type of register already.  */
 
 	if (FIELD_ISREF(field)) {
+#ifndef GUARANA
 		check_stack_ref(1);
 		CHECK_NULL(PUTFIELD, rstack(1), 35);
+#endif
 		SOFT_ADDREFERENCE(rstack(1), rstack(0));
 		store_offset_ref(wstack(1), FIELD_OFFSET(field), rstack(0));
+#ifndef GUARANA
 		pop(2);
+#endif
 	}
 	else switch (CLASS_PRIM_SIG(FIELD_TYPE(field))) {
 	case 'I':
+#ifndef GUARANA
 		check_stack_ref(1);
 		CHECK_NULL(PUTFIELD, rstack(1), 36);
+#endif
 		store_offset_int(wstack(1), FIELD_OFFSET(field), rstack(0));
+#ifndef GUARANA
 		pop(2);
+#endif
 		break;
 	case 'S':
+#ifndef GUARANA
 		check_stack_ref(1);
 		CHECK_NULL(PUTFIELD, stack(1), 37);
+#endif
 		add_ref_const(stack(1), stack(1), FIELD_OFFSET(field));
 		store_short(stack(1), stack(0));
+#ifndef GUARANA
 		pop(2);
+#endif
 		break;
 	case 'B':
 	case 'Z':
+#ifndef GUARANA
 		check_stack_ref(1);
 		CHECK_NULL(PUTFIELD, stack(1), 37);
+#endif
 		add_ref_const(stack(1), stack(1), FIELD_OFFSET(field));
 		store_byte(stack(1), stack(0));
+#ifndef GUARANA
 		pop(2);
+#endif
 		break;
 	case 'C':
+#ifndef GUARANA
 		check_stack_ref(1);
 		CHECK_NULL(PUTFIELD, stack(1), 37);
+#endif
 		add_ref_const(stack(1), stack(1), FIELD_OFFSET(field));
 		store_char(stack(1), stack(0));
+#ifndef GUARANA
 		pop(2);
+#endif
 		break;
 	case 'F':
+#ifndef GUARANA
 		check_stack_ref(1);
 		CHECK_NULL(PUTFIELD, stack(1), 37);
+#endif
 		add_ref_const(stack(1), stack(1), FIELD_OFFSET(field));
 		store_float(stack(1), stack(0));
+#ifndef GUARANA
 		pop(2);
+#endif
 		break;
 	case 'J':
+#ifndef GUARANA
 		check_stack_ref(2);
 		CHECK_NULL(PUTFIELD, stack(2), 38);
+#endif
 		add_ref_const(stack(2), stack(2), FIELD_OFFSET(field));
 		store_long(stack(2), stack(0));
+#ifndef GUARANA
 		pop(3);
+#endif
 		break;
 	case 'D':
+#ifndef GUARANA
 		check_stack_ref(2);
 		CHECK_NULL(PUTFIELD, stack(2), 39);
+#endif
 		add_ref_const(stack(2), stack(2), FIELD_OFFSET(field));
 		store_double(stack(2), stack(0));
+#ifndef GUARANA
 		pop(3);
+#endif
 		break;
 	default:
 		ABORT();
 	}
+#ifdef GUARANA
+	end_basic_block();
+
+	branch_a(reference_label(PUTFIELD, 33));
+
+	set_label(PUTFIELD, 32);
+	
+	start_basic_block();
+	softcall_reify_field_store(tmp2, tmp);
+	slot_nowriteback(tmp2);
+	slot_nowriteback(tmp);
+	end_basic_block();
+
+	set_label(PUTFIELD, 33);
+	start_basic_block();
+
+	if (FIELD_ISREF(field)) {
+	  pop(2);
+	} else switch (CLASS_PRIM_SIG(FIELD_TYPE(field))) {
+	case 'Z':
+	case 'C':
+	case 'B':
+	case 'S':
+	case 'I':
+	case 'F':
+	  pop(2);
+	  break;
+	case 'J':
+	case 'D':
+	  pop(3);
+	  break;
+	}
+#endif
 }
 
 #if defined(INTERPRETER)
@@ -2860,6 +3601,19 @@
 	/* Check method table for cached entry */
 	load_offset_ref(tmp, mtable,
 			DTABLE_METHODOFFSET + method_idx() * DTABLE_METHODSIZE);
+#ifdef GUARANA
+	slot_alloctmp(tmp2);
+	  
+	load_offset_ref(tmp2, rstack(idx), META_OBJECT_OFFSET);
+
+	slot_nowriteback(tmp2);
+	end_basic_block();
+
+	cbranch_ref_const_ne(tmp2, 0, reference_label(INVOKEVIRTUAL, 26));
+
+	start_basic_block();
+#endif
+
 #if !(defined(TRANSLATOR) && defined(HAVE_TRAMPOLINE))
 	softcall_get_method_code (tmp, tmp);
 #endif
@@ -2880,6 +3634,34 @@
 	idx++;
 	popargs();
 
+#ifdef GUARANA
+	end_basic_block();
+
+	branch_a(reference_label(INVOKEVIRTUAL, 27));
+
+	idx--;
+
+	set_label(INVOKEVIRTUAL, 26);
+	/* Otherwise call through MetaObject */
+	
+	start_basic_block();
+
+	load_offset_ref(tmp, mtable,
+			DTABLE_METHODOFFSET + DMETHOD_DESCOFFSET +
+			method_idx() * DTABLE_METHODSIZE);
+			
+	/* Call it */
+	low = method_returntype();
+	softcall_reify_method_invocation(rstack(idx), tmp, 0);
+
+	slot_nowriteback(tmp);
+	end_basic_block();
+
+	idx++;
+
+	set_label(INVOKEVIRTUAL, 27);
+#endif
+
 	start_basic_block();
 	METHOD_RETURN_VALUE();
 }
@@ -2902,6 +3684,19 @@
 
 	check_stack_ref(idx);
 
+#ifdef GUARANA
+	slot_alloctmp(tmp2);
+
+	load_offset_ref(tmp2, rstack(idx), META_OBJECT_OFFSET);
+
+	slot_nowriteback(tmp2);
+	end_basic_block();
+
+	cbranch_ref_const_ne(tmp2, 0, reference_label(INVOKESPECIAL, 28));
+
+	start_basic_block();
+#endif
+
 #if !(defined(TRANSLATOR) && defined(HAVE_TRAMPOLINE))
 	slot_alloctmp(tmp);
 	softcall_get_method_code_const (tmp, method_method ());
@@ -2930,6 +3725,33 @@
 	idx++;
 	popargs();
 
+#ifdef GUARANA
+	end_basic_block();
+
+	branch_a(reference_label(INVOKESPECIAL, 29));
+
+	idx--;
+
+	set_label(INVOKESPECIAL, 28);
+	/* Otherwise call through MetaObject */
+
+	start_basic_block();
+
+	slot_alloctmp(tmp);
+	move_ref_const(tmp, method_method());
+
+	/* Call it */
+	low = method_returntype();
+	softcall_reify_method_invocation(rstack(idx), tmp, 0);
+
+	slot_nowriteback(tmp);
+	end_basic_block();
+
+	idx++;
+
+	set_label(INVOKESPECIAL, 29);
+#endif
+
 	start_basic_block();
 	METHOD_RETURN_VALUE();
 }
@@ -2948,6 +3770,20 @@
 	get_method_info(idx);
 	idx = method_nargs();
 
+#ifdef GUARANA
+	slot_alloctmp(tmp2);
+
+	move_ref_const(tmp2, method_class ());
+	load_offset_ref(tmp2, tmp2, META_OBJECT_OFFSET);
+
+	slot_nowriteback(tmp2);
+	end_basic_block();
+
+	cbranch_ref_const_ne(tmp2, 0, reference_label(INVOKESTATIC, 30));
+
+	start_basic_block();
+#endif
+
 #if !(defined(TRANSLATOR) && defined(HAVE_TRAMPOLINE))
 	slot_alloctmp(tmp);
 	softcall_get_method_code_const (tmp, method_method ());
@@ -2973,6 +3809,29 @@
 	/* Pop args */
 	popargs();
 
+#ifdef GUARANA
+	end_basic_block();
+
+	branch_a(reference_label(INVOKESTATIC, 31));
+
+	set_label(INVOKESTATIC, 30);
+	/* Otherwise call through MetaObject */
+
+	start_basic_block();
+
+	slot_alloctmp(tmp);
+	move_ref_const(tmp, method_method());
+
+	/* Call it */
+	low = method_returntype();
+	softcall_reify_method_invocation(rstack(idx), tmp, 1);
+
+	slot_nowriteback(tmp);
+	end_basic_block();
+
+	set_label(INVOKESTATIC, 31);
+#endif
+
 	start_basic_block();
 	METHOD_RETURN_VALUE();
 }
@@ -2997,6 +3856,24 @@
 	check_stack_ref(idx);
 
 	softcall_lookupmethod(tmp, method_method(), rstack(idx));
+
+#ifdef GUARANA
+	slot_alloctmp(tmp2);
+
+	load_offset_ref(tmp2, rstack(idx), META_OBJECT_OFFSET);
+
+	slot_nowriteback(tmp2);
+	end_basic_block();
+
+	cbranch_ref_const_ne(tmp2, 0, reference_label(INVOKEINTERFACE, 32));
+
+	start_basic_block();
+
+#if defined(TRANSLATOR) && defined(HAVE_TRAMPOLINE)
+	load_offset_ref(tmp, tmp, METHOD_NATIVEOFFSET);
+#endif
+#endif
+
 #if !(defined(TRANSLATOR) && defined(HAVE_TRAMPOLINE))
 	softcall_get_method_code (tmp, tmp);
 #endif
@@ -3017,7 +3894,30 @@
 	idx++;
 	popargs();
 
+#ifdef GUARANA
+	end_basic_block();
+
+	branch_a(reference_label(INVOKEINTERFACE, 33));
+
+	idx--;
+
+	set_label(INVOKEINTERFACE, 32);
+	/* Otherwise call through MetaObject */
+
 	start_basic_block();
+
+	/* Call it */
+	softcall_reify_method_invocation(rstack(idx), tmp, 0);
+
+	slot_nowriteback(tmp);
+	end_basic_block();
+
+	idx++;
+
+	set_label(INVOKEINTERFACE, 33);
+#endif
+
+	start_basic_block();
 	METHOD_RETURN_VALUE();
 }
 
@@ -3070,7 +3970,28 @@
 
 	check_stack_array(0);
 
+#ifdef GUARANA
+	slot_alloctmp(tmp);
+	load_offset_ref(tmp, rstack(0), META_OBJECT_OFFSET);
+	slot_nowriteback(tmp);
+	end_basic_block();
+	cbranch_ref_const_ne(tmp, 0, reference_label(ARRAYLENGTH, 35));
+
+	start_basic_block();
+	softcall_reify_arraylength(wstack(0), rstack(0));
+	end_basic_block();
+	branch_a(reference_label(ARRAYLENGTH, 36));
+
+	set_label(ARRAYLENGTH, 35);
+	start_basic_block();
+#endif
 	load_offset_int(wstack(0), rstack(0), object_array_length);
+#ifdef GUARANA
+	end_basic_block();
+
+	set_label(ARRAYLENGTH, 36);
+	start_basic_block();
+#endif
 }
 
 define_insn(ATHROW)
Index: kaffe/kaffe/kaffevm/lookup.c
diff -u kaffe/kaffe/kaffevm/lookup.c:1.1.1.4 kaffe/kaffe/kaffevm/lookup.c:1.4
--- kaffe/kaffe/kaffevm/lookup.c:1.1.1.4	Mon Oct  6 22:50:47 1997
+++ kaffe/kaffe/kaffevm/lookup.c	Wed Jan 21 03:44:16 1998
@@ -117,7 +117,12 @@
 	GC_WRITE(class, dtable);
 
 	mptr = gc_malloc(sizeof(Method), &gcMethod);
+#ifdef GUARANA
+	DMETHOD_ADDR(dtable->method[nmethods]) = (void*)throwNoSuchMethodError;
+	DMETHOD_DESC(dtable->method[nmethods]) = mptr;
+#else
 	dtable->method[nmethods] = mptr;
+#endif
 	mptr->accflags = ACC_NATIVE;
 	mptr->name = name;
 	mptr->signature = sig;
Index: kaffe/kaffe/kaffevm/object.c
diff -u kaffe/kaffe/kaffevm/object.c:1.1.1.4 kaffe/kaffe/kaffevm/object.c:1.5
--- kaffe/kaffe/kaffevm/object.c:1.1.1.4	Mon Oct  6 22:50:49 1997
+++ kaffe/kaffe/kaffevm/object.c	Wed Jan 21 03:44:19 1998
@@ -31,6 +31,10 @@
 #include "external.h"
 #include "gc.h"
 
+#ifdef GUARANA
+#include "../../packages/guarana.unicamp.br/APIguarana/lib/GuaraNative.h"
+#endif
+
 extern Hjava_lang_Class* ThreadClass;
 
 extern gcFuncs gcFinalizeObject;
@@ -45,7 +49,11 @@
  * it with the object for it's later use.  Otherwise the object is normal.
  */
 Hjava_lang_Object*
+#ifdef GUARANA
+newObjectNoMessage(Hjava_lang_Class* class)
+#else
 newObject(Hjava_lang_Class* class)
+#endif
 {
 	Hjava_lang_Object* obj;
 	gcFuncs* type;
@@ -70,6 +78,10 @@
         /* Fill in object information */
         obj->dtable = class->dtable;
 
+#ifdef GUARANA
+	obj->meta_object = 0;
+#endif
+
 ADBG(	printf("newObject %x class %s\n", obj,
 		(class ? class->name->data : "<none>"));
 		fflush(stdout);						)
@@ -80,7 +92,11 @@
 /* Allocate a new array whose elements are ELCLASS (a primitive type),
    and that has COUNT elements. */
 Hjava_lang_Object*
+#ifdef GUARANA
+newPrimArrayNoMessage(Hjava_lang_Class* elclass, int count)
+#else
 newPrimArray(Hjava_lang_Class* elclass, int count)
+#endif
 {
 	int size;
 	Hjava_lang_Class* class;
@@ -92,6 +108,9 @@
 
 	obj = gc_malloc(size, &gcPrimArray);
 	obj->dtable = class->dtable;
+#ifdef GUARANA
+	obj->meta_object = 0;
+#endif
 	ARRAY_SIZE(obj) = count;
 
 	return (obj);
@@ -100,7 +119,11 @@
 /* Allocate a new array whose elements are ELCLASS (an Object type),
    and that has COUNT elements. */
 Hjava_lang_Object*
+#ifdef GUARANA
+newRefArrayNoMessage(Hjava_lang_Class* elclass, int count)
+#else
 newRefArray(Hjava_lang_Class* elclass, int count)
+#endif
 {
 	int size;
 	Hjava_lang_Class* class;
@@ -111,23 +134,39 @@
 
 	obj = gc_malloc(size, &gcRefArray);
 	obj->dtable = class->dtable;
+#ifdef GUARANA
+	obj->meta_object = 0;
+#endif
 	ARRAY_SIZE(obj) = count;
 
 	return (obj);
 }
 
 Hjava_lang_Object*
+#ifdef GUARANA
+guarana_newMultiArray(Hjava_lang_Class *clazz, Hjava_lang_Object *creator, int *dims)
+#else
 newMultiArray(Hjava_lang_Class* clazz, int* dims)
+#endif
 {
 	Hjava_lang_Object* obj;
 	Hjava_lang_Object** array;
 	int i;
 	
+#ifdef GUARANA
+	obj = guarana_newArray(CLASS_ELEMENT_TYPE(clazz), creator, dims[0]);
+#else
 	obj = newArray(CLASS_ELEMENT_TYPE(clazz), dims[0]);
+#endif
 	if (dims[1] > 0) {
 		array = OBJARRAY_DATA(obj);
 		for (i = 0; i < dims[0]; i++) {
+#ifdef GUARANA
+		        /* FIXME: reify assignment? */
+			array[i] = guarana_newMultiArray(CLASS_ELEMENT_TYPE(clazz), obj, &dims[1]);
+#else
 			array[i] = newMultiArray(CLASS_ELEMENT_TYPE(clazz), &dims[1]);
+#endif
 		}
 	}
 
@@ -138,13 +177,25 @@
  * Allocate a new array, of whatever types.
  */
 Hjava_lang_Object*
+#ifdef GUARANA
+guarana_newArray(Hjava_lang_Class *eltype, Hjava_lang_Object *creator, int count)
+#else
 newArray(Hjava_lang_Class* eltype, int count)
+#endif
 {
 	if (CLASS_IS_PRIMITIVE(eltype)) {
+#ifdef GUARANA
+		return (guarana_newPrimArray(eltype, count, creator));
+#else
 		return (newPrimArray(eltype, count));
+#endif
 	}
 	else {
+#ifdef GUARANA
+		return (guarana_newRefArray(eltype, count, creator));
+#else
 		return (newRefArray(eltype, count));
+#endif
 	}
 }
 
@@ -162,6 +213,13 @@
 #endif
 	gcStats.markedmem += size;
 	arr = (Hjava_lang_Object*)base;
+#ifdef GUARANA
+	{
+	  struct HBR_unicamp_Guarana_MetaObject *mo = arr->meta_object;
+	  if (mo != NULL)
+	    markObject(mo);
+	}
+#endif
 	ptr = OBJARRAY_DATA(arr);
 	for (i = ARRAY_SIZE(arr); --i>= 0; ) {
 		Hjava_lang_Object* el = *ptr++;
@@ -180,7 +238,11 @@
 	Method* final;
 
 	final = findMethod(OBJECT_CLASS((Hjava_lang_Object*)ob), final_name, void_signature);
+#ifdef GUARANA
+        do_execute_java_method(0, (Hjava_lang_Object*)ob, 0, 0, final, 0);
+#else
 	CALL_KAFFE_METHOD(final, (Hjava_lang_Object*)ob);
+#endif
 }
 
 /*
@@ -196,6 +258,13 @@
 	gcStats.markedmem += size;
 	class = (Hjava_lang_Class*)base;
 
+#ifdef GUARANA
+	{
+	  struct HBR_unicamp_Guarana_MetaObject *mo = class->head.meta_object;
+	  if (mo != NULL)
+	    markObject(mo);
+	}
+#endif
 	markObject(class->name);
 	if (class->state == CSTATE_PREPARED) {
 		markObject(class->superclass);
Index: kaffe/kaffe/kaffevm/object.h
diff -u kaffe/kaffe/kaffevm/object.h:1.1.1.3 kaffe/kaffe/kaffevm/object.h:1.3
--- kaffe/kaffe/kaffevm/object.h:1.1.1.3	Wed Jun 25 17:34:46 1997
+++ kaffe/kaffe/kaffevm/object.h	Wed Jun 25 19:17:40 1997
@@ -34,6 +34,10 @@
 #define	ARRAY_SIZE_OFFSET	((int)&ARRAY_SIZE(0))
 #define	ARRAY_DATA_OFFSET	((int)(((Array*)0)+1))
 
+#ifdef GUARANA
+#define META_OBJECT_OFFSET      ((int)&(*(Hjava_lang_Object*)0).meta_object)
+#endif
+
 struct Hjava_lang_Class;
 
 Hjava_lang_Object*	newObject(struct Hjava_lang_Class*);
Index: kaffe/kaffe/kaffevm/soft.c
diff -u kaffe/kaffe/kaffevm/soft.c:1.1.1.4 kaffe/kaffe/kaffevm/soft.c:1.8
--- kaffe/kaffe/kaffevm/soft.c:1.1.1.4	Mon Oct  6 22:50:54 1997
+++ kaffe/kaffe/kaffevm/soft.c	Wed Jan 21 03:44:21 1998
@@ -44,16 +44,28 @@
 #include "flags.h"
 #include "itypes.h"
 
+#ifdef GUARANA
+#include "../../packages/guarana.unicamp.br/APIguarana/lib/GuaraNative.h"
+#endif
+
 /*
  * soft_new
  */
 void*
+#ifdef GUARANA
+soft_new(Hjava_lang_Class* c, Hjava_lang_Object *creator)
+#else
 soft_new(Hjava_lang_Class* c)
+#endif
 {
 	Hjava_lang_Object* obj;
 
 	processClass(c, CSTATE_OK);
+#ifdef GUARANA
+	obj = guarana_newObject(c, creator);
+#else
 	obj = newObject(c);
+#endif
 
 ADBG(	printf("New object of type %s (%d,%x)\n", c->name->data, c->fsize, obj);
 		fflush(stdout);						)
@@ -65,7 +77,11 @@
  * soft_newarray
  */
 void*
+#ifdef GUARANA
+soft_newarray(jint type, jint size, struct Hjava_lang_Object *creator)
+#else
 soft_newarray(jint type, jint size)
+#endif
 {
 	Hjava_lang_Object* obj;
 
@@ -73,7 +89,12 @@
 		throwException(NegativeArraySizeException);
 	}
 
+
+#ifdef GUARANA
+	obj = guarana_newPrimArray(TYPE_CLASS(type), size, creator);
+#else
 	obj = newPrimArray(TYPE_CLASS(type), size);
+#endif
 
 ADBG(	printf("New object of %d type (%d,%x)\n", type, size, obj);
 	fflush(stdout);							)
@@ -85,7 +106,11 @@
  * soft_anewarray
  */
 void*
+#ifdef GUARANA
+soft_anewarray(Hjava_lang_Class* elclass, jint size, struct Hjava_lang_Object *creator)
+#else
 soft_anewarray(Hjava_lang_Class* elclass, jint size)
+#endif
 {
 	Hjava_lang_Object* obj;
 
@@ -93,7 +118,11 @@
 		throwException(NegativeArraySizeException);
 	}
 
+#ifdef GUARANA
+	obj = guarana_newRefArray(elclass, size, creator);
+#else
 	obj = newRefArray(elclass, size);
+#endif
 
 ADBG(	printf("New array object of %s type (%d,%x)\n", elclass->name->data, size, obj); fflush(stdout);							)
 
@@ -107,7 +136,11 @@
 
 #if defined(INTERPRETER)
 void*
+#ifdef GUARANA
+soft_multianewarray(Hjava_lang_Class* class, struct Hjava_lang_Object *creator, jint dims, slots* args)
+#else
 soft_multianewarray(Hjava_lang_Class* class, jint dims, slots* args)
+#endif
 {
         int array[MAXDIMS];
         Hjava_lang_Object* obj;
@@ -133,8 +166,12 @@
         arraydims[i] = 0;
 
         /* Mmm, okay now build the array using the wonders of recursion */
+#ifdef GUARANA
+	obj = guarana_newMultiArray(class, creator, arraydims);
+#else
         obj = newMultiArray(class, arraydims);
-
+#endif
+	
 
 	if (arraydims != array) {
 		gc_free_fixed(arraydims);
@@ -147,7 +184,11 @@
 
 #if defined(TRANSLATOR)
 void*
+#ifdef GUARANA
+soft_multianewarray(Hjava_lang_Class* class, struct Hjava_lang_Object *creator, jint dims, ...)
+#else
 soft_multianewarray(Hjava_lang_Class* class, jint dims, ...)
+#endif
 {
 	va_list ap;
 	int array[MAXDIMS];
@@ -176,7 +217,11 @@
 	va_end(ap);
 
 	/* Mmm, okay now build the array using the wonders of recursion */
+#ifdef GUARANA
+	obj = guarana_newMultiArray(class, creator, arraydims);
+#else
         obj = newMultiArray(class, arraydims);
+#endif
 
 	if (arraydims != array) {
 		gc_free_fixed(arraydims);
@@ -193,6 +238,12 @@
 void
 soft_monitorenter(Hjava_lang_Object* o)
 {
+#ifdef GUARANA
+	struct HBR_unicamp_Guarana_MetaObject *mo = o->meta_object;
+	if (mo)
+	  guarana_reify_monitorEnter(mo, o);
+	else
+#endif
 	lockMutex(o);
 }
 
@@ -202,6 +253,12 @@
 void
 soft_monitorexit(Hjava_lang_Object* o)
 {
+#ifdef GUARANA
+	struct HBR_unicamp_Guarana_MetaObject *mo = o->meta_object;
+	if (mo)
+	  guarana_reify_monitorExit(mo, o);
+	else
+#endif
 	unlockMutex(o);
 }
 
@@ -218,7 +275,7 @@
 		throwException(NoSuchMethodError);
 	}
 
-#if defined(TRANSLATOR) && defined(HAVE_TRAMPOLINE)
+#if defined(TRANSLATOR) && defined(HAVE_TRAMPOLINE) && !defined(GUARANA)
 	return (METHOD_NATIVECODE(meth));
 #else
 	return (meth);
Index: kaffe/kaffe/kaffevm/soft.h
diff -u kaffe/kaffe/kaffevm/soft.h:1.1.1.4 kaffe/kaffe/kaffevm/soft.h:1.7
--- kaffe/kaffe/kaffevm/soft.h:1.1.1.4	Mon Oct  6 22:50:55 1997
+++ kaffe/kaffe/kaffevm/soft.h	Wed Jan 21 03:44:23 1998
@@ -17,9 +17,15 @@
 struct Hjava_lang_Class;
 struct Hjava_lang_Object;
 
+#ifdef GUARANA
+void*	soft_new(struct Hjava_lang_Class*, struct Hjava_lang_Object* creator);
+void*	soft_newarray(jint, jint, struct Hjava_lang_Object* creator);
+void*	soft_anewarray(struct Hjava_lang_Class*, jint, struct Hjava_lang_Object* creator);
+#else
 void*	soft_new(struct Hjava_lang_Class*);
 void*	soft_newarray(jint, jint);
 void*	soft_anewarray(struct Hjava_lang_Class*, jint);
+#endif
 void	soft_initialise_class(struct Hjava_lang_Class*);
 nativecode* soft_get_method_code (Method*);
 
@@ -46,8 +52,12 @@
 jint	soft_rem(jint, jint);
 
 #if defined(INTERPRETER)
+#ifdef GUARANA
+void*	soft_multianewarray(struct Hjava_lang_Class*, struct Hjava_lang_Object *creator, jint, slots*);
+#else
 void*	soft_multianewarray(struct Hjava_lang_Class*, jint, slots*);
 #endif
+#endif
 
 #if defined(TRANSLATOR)
 jlong	soft_lmul(jlong, jlong);
@@ -61,7 +71,11 @@
 jlong	soft_ashrl(jlong, jint);
 jlong	soft_lshrl(jlong, jint);
 jint	soft_lcmp(jlong, jlong);
+#ifdef GUARANA
+void*	soft_multianewarray(struct Hjava_lang_Class*, struct Hjava_lang_Object *creator, jint, ...);
+#else
 void*	soft_multianewarray(struct Hjava_lang_Class*, jint, ...);
+#endif
 #endif
 
 jlong	soft_cvtil(jint);
Index: kaffe/kaffe/kaffevm/support.c
diff -u kaffe/kaffe/kaffevm/support.c:1.1.1.5 kaffe/kaffe/kaffevm/support.c:1.8
--- kaffe/kaffe/kaffevm/support.c:1.1.1.5	Mon Oct  6 22:50:58 1997
+++ kaffe/kaffe/kaffevm/support.c	Wed Feb 18 10:04:09 1998
@@ -30,6 +30,10 @@
 #include "itypes.h"
 #include "external.h"
 
+#ifdef GUARANA
+#include "../../packages/guarana.unicamp.br/APIguarana/lib/GuaraNative.h"
+#endif
+
 #if !defined(HAVE_GETTIMEOFDAY)
 #include <sys/timeb.h>
 #endif
@@ -56,24 +60,52 @@
 	int args;
 	va_list argptr;
 	jword retval;
+#ifdef GUARANA
+	struct HBR_unicamp_Guarana_MetaObject *mo;
+#endif
 
-	if (mb == 0 || !METHOD_TRANSLATED(mb)) {
+	if (mb == 0) {
 		mb = findMethod(OBJECT_CLASS(obj),
 				makeUtf8Const (method_name, -1),
 				makeUtf8Const (signature, -1));
-		/* No method or static - throw exception */
-		if (mb == 0 || (mb->accflags & ACC_STATIC) != 0) {
+		/* No method - throw exception */
+		if (mb == 0) {
 			throwException(NoSuchMethodError);
 		}
 	}
+	
+	if (((mb->accflags & ACC_STATIC) != 0 && !isStaticCall) ||
+	    ((mb->accflags & ACC_STATIC) == 0 && isStaticCall)) {
+		throwException(NoSuchMethodError);
+	}
+
+#ifdef TRANSLATOR
+	if (!METHOD_TRANSLATED(mb))
+	  translate(mb);
+#endif
 
 	/* Calculate number of arguments */
-	sig = signature;
+	sig = signature ? signature : mb->signature->data;
 	args = sizeofSig(&sig, false);
 
 	/* Make the call */
 	va_start(argptr, isStaticCall);
- 	CALL_KAFFE_METHOD_VARARGS(mb, obj, args, argptr, retval);
+
+#ifdef GUARANA
+	if (isStaticCall) {
+	  mo = mb->class->head.meta_object;
+	} else {
+	  mo = obj->meta_object;
+	}
+	if (mo) {
+	  guarana_reify_method_invocation(mo, obj, mb, argptr, (slots*)&retval);
+	} else {
+#endif
+	CALL_KAFFE_METHOD_VARARGS(mb, obj, args, argptr, retval);
+#ifdef GUARANA
+	}
+#endif
+
 	va_end(argptr);
 
 	return (retval);
@@ -86,24 +118,52 @@
 	int args;
 	va_list argptr;
 	jlong retval;
+#ifdef GUARANA
+	struct HBR_unicamp_Guarana_MetaObject *mo;
+#endif
 
-	if (mb == 0 || !METHOD_TRANSLATED(mb)) {
+	if (mb == 0) {
 		mb = findMethod(OBJECT_CLASS(obj),
 				makeUtf8Const (method_name, -1),
 				makeUtf8Const (signature, -1));
-		/* No method or static - throw exception */
-		if (mb == 0 || (mb->accflags & ACC_STATIC) != 0) {
+		/* No method - throw exception */
+		if (mb == 0) {
 			throwException(NoSuchMethodError);
 		}
 	}
 
+	if (((mb->accflags & ACC_STATIC) != 0 && !isStaticCall) ||
+	    ((mb->accflags & ACC_STATIC) == 0 && isStaticCall)) {
+		throwException(NoSuchMethodError);
+	}
+
+#ifdef TRANSLATOR
+	if (!METHOD_TRANSLATED(mb))
+	  translate(mb);
+#endif
+
 	/* Calculate number of arguments */
-	sig = signature;
+	sig = signature ? signature : mb->signature->data;
 	args = sizeofSig(&sig, false);
 
 	/* Make the call */
 	va_start(argptr, isStaticCall);
- 	CALL_KAFFE_LMETHOD_VARARGS(mb, obj, args, argptr, retval);
+
+#ifdef GUARANA
+	if (isStaticCall) {
+	  mo = mb->class->head.meta_object;
+	} else {
+	  mo = obj->meta_object;
+	}
+	if (mo) {
+	  guarana_reify_method_invocation(mo, obj, mb, argptr, (slots*)&retval);
+	} else {
+#endif
+	CALL_KAFFE_LMETHOD_VARARGS(mb, obj, args, argptr, retval);
+#ifdef GUARANA
+	}
+#endif
+
 	va_end(argptr);
 
 	return (retval);
@@ -116,24 +176,52 @@
 	int args;
 	va_list argptr;
 	jfloat retval;
+#ifdef GUARANA
+	struct HBR_unicamp_Guarana_MetaObject *mo;
+#endif
 
-	if (mb == 0 || !METHOD_TRANSLATED(mb)) {
+	if (mb == 0) {
 		mb = findMethod(OBJECT_CLASS(obj),
 				makeUtf8Const (method_name, -1),
 				makeUtf8Const (signature, -1));
-		/* No method or static - throw exception */
-		if (mb == 0 || (mb->accflags & ACC_STATIC) != 0) {
+		/* No method - throw exception */
+		if (mb == 0) {
 			throwException(NoSuchMethodError);
 		}
 	}
 
+	if (((mb->accflags & ACC_STATIC) != 0 && !isStaticCall) ||
+	    ((mb->accflags & ACC_STATIC) == 0 && isStaticCall)) {
+		throwException(NoSuchMethodError);
+	}
+
+#ifdef TRANSLATOR
+	if (!METHOD_TRANSLATED(mb))
+	  translate(mb);
+#endif
+
 	/* Calculate number of arguments */
-	sig = signature;
+	sig = signature ? signature : mb->signature->data;
 	args = sizeofSig(&sig, false);
 
 	/* Make the call */
 	va_start(argptr, isStaticCall);
+
+#ifdef GUARANA
+	if (isStaticCall) {
+	  mo = mb->class->head.meta_object;
+	} else {
+	  mo = obj->meta_object;
+	}
+	if (mo) {
+	  guarana_reify_method_invocation(mo, obj, mb, argptr, (slots*)&retval);
+	} else {
+#endif
  	CALL_KAFFE_FMETHOD_VARARGS(mb, obj, args, argptr, retval);
+#ifdef GUARANA
+	}
+#endif
+
 	va_end(argptr);
 
 	return (retval);
@@ -146,24 +234,52 @@
 	int args;
 	va_list argptr;
 	jdouble retval;
+#ifdef GUARANA
+	struct HBR_unicamp_Guarana_MetaObject *mo;
+#endif
 
-	if (mb == 0 || !METHOD_TRANSLATED(mb)) {
+	if (mb == 0) {
 		mb = findMethod(OBJECT_CLASS(obj),
 				makeUtf8Const (method_name, -1),
 				makeUtf8Const (signature, -1));
-		/* No method or static - throw exception */
-		if (mb == 0 || (mb->accflags & ACC_STATIC) != 0) {
+		/* No method - throw exception */
+		if (mb == 0) {
 			throwException(NoSuchMethodError);
 		}
 	}
 
+	if (((mb->accflags & ACC_STATIC) != 0 && !isStaticCall) ||
+	    ((mb->accflags & ACC_STATIC) == 0 && isStaticCall)) {
+		throwException(NoSuchMethodError);
+	}
+
+#ifdef TRANSLATOR
+	if (!METHOD_TRANSLATED(mb))
+	  translate(mb);
+#endif
+
 	/* Calculate number of arguments */
-	sig = signature;
+	sig = signature ? signature : mb->signature->data;
 	args = sizeofSig(&sig, false);
 
 	/* Make the call */
 	va_start(argptr, isStaticCall);
+
+#ifdef GUARANA
+	if (isStaticCall) {
+	  mo = mb->class->head.meta_object;
+	} else {
+	  mo = obj->meta_object;
+	}
+	if (mo) {
+	  guarana_reify_method_invocation(mo, obj, mb, argptr, (slots*)&retval);
+	} else {
+#endif
  	CALL_KAFFE_DMETHOD_VARARGS(mb, obj, args, argptr, retval);
+#ifdef GUARANA
+	}
+#endif
+
 	va_end(argptr);
 
 	return (retval);
@@ -182,6 +298,9 @@
 	Method* mb;
 	jword retval;
 	char cnname[CLASSMAXSIG];	/* Unchecked buffer - FIXME! */
+#ifdef GUARANA
+	struct HBR_unicamp_Guarana_MetaObject *mo;
+#endif
 
 	/* Convert "." to "/" */
 	classname2pathname(cname, cnname);
@@ -200,12 +319,24 @@
 	}
 
 	/* Calculate number of arguments */
-	sig = signature;
+	sig = signature ? signature : mb->signature->data;
 	args = sizeofSig(&sig, false);
 
 	/* Make the call */
 	va_start(argptr, signature);
+
+#ifdef GUARANA
+	mo = mb->class->head.meta_object;
+
+	if (mo) {
+	  guarana_reify_method_invocation(mo, 0, mb, argptr, (slots*)&retval);
+	} else {
+#endif
  	CALL_KAFFE_STATIC_VARARGS(mb, args, argptr, retval);
+#ifdef GUARANA
+	}
+#endif
+
 	va_end(argptr);
 
 	return (retval);
@@ -251,7 +382,7 @@
 	assert(obj != 0);
 
 	/* Calculate number of arguments */
-	sig = signature;
+	sig = signature ? signature : mb->signature->data;
 	args = sizeofSig(&sig, false);
 
 	/* Make the call */
Index: kaffe/kaffe/kaffevm/intrp/Makefile.frag
diff -u kaffe/kaffe/kaffevm/intrp/Makefile.frag:1.1.1.1 kaffe/kaffe/kaffevm/intrp/Makefile.frag:1.2
--- kaffe/kaffe/kaffevm/intrp/Makefile.frag:1.1.1.1	Mon May  5 21:21:06 1997
+++ kaffe/kaffe/kaffevm/intrp/Makefile.frag	Wed Jan 21 03:44:29 1998
@@ -10,3 +10,5 @@
 ENGINE_CFLAGS=	-DINTERPRETER -I$(srcdir)/intrp  
 
 ENGINE_OBJECTS= machine$(OBJEXT)
+
+machine.o:	machine.c kaffe.def
Index: kaffe/kaffe/kaffevm/intrp/icode.h
diff -u kaffe/kaffe/kaffevm/intrp/icode.h:1.1.1.2 kaffe/kaffe/kaffevm/intrp/icode.h:1.6
--- kaffe/kaffe/kaffevm/intrp/icode.h:1.1.1.2	Mon Oct  6 22:51:07 1997
+++ kaffe/kaffe/kaffevm/intrp/icode.h	Wed Jan 21 03:44:31 1998
@@ -142,6 +142,10 @@
 #define	return_float(s)				(s)[0].v.tfloat = retval[0].v.tfloat
 #define	return_double(s)			(s)[0].v.tdouble = retval[0].v.tdouble
 #define	return_ref(s)				(s)[0].v.taddr = retval[0].v.taddr
+#define return_boolean return_int
+#define return_byte return_int
+#define return_short return_int
+#define return_char return_int
 
 #define	monitor_enter()				/* Not needed for interpreter */
 #define	monitor_exit()				/* Not needed for interpreter */
@@ -212,9 +216,16 @@
 #define	cvt_double_float(t, f)			(t)[0].v.tfloat = (f)[0].v.tdouble
 
 #define	softcall_lookupmethod(r, n, t)		(r)[0].v.taddr = soft_lookupmethod((t)[0].v.taddr, (n))
+#ifdef GUARANA
+#define CREATOR ((methaccflags & ACC_STATIC) ? &meth->class->head : (Hjava_lang_Object*)local(0)->v.taddr)
+#define	softcall_new(r, t)			(r)->v.taddr = soft_new(t, CREATOR)
+#define	softcall_newarray(r, s, t)		(r)->v.taddr = soft_newarray(t, (s)->v.tint, CREATOR)
+#define	softcall_anewarray(r, s, t)		(r)->v.taddr = soft_anewarray(t, (s)->v.tint, CREATOR)
+#else
 #define	softcall_new(r, t)			(r)->v.taddr = soft_new(t)
 #define	softcall_newarray(r, s, t)		(r)->v.taddr = soft_newarray(t, (s)->v.tint)
 #define	softcall_anewarray(r, s, t)		(r)->v.taddr = soft_anewarray(t, (s)->v.tint)
+#endif
 #define	softcall_athrow(s)			soft_athrow((s)[0].v.taddr)
 #define	softcall_checkcast(o, t)		soft_checkcast(t, (o)->v.taddr)
 #define softcall_get_method_code(r, m)		softcall_initialise_class (method_class ()); \
@@ -225,7 +236,11 @@
 #define	softcall_instanceof(r, o, t)		(r)->v.tint = soft_instanceof(t, (o)->v.taddr)
 #define	softcall_monitorenter(o)		soft_monitorenter((o)[0].v.taddr)
 #define	softcall_monitorexit(o)			soft_monitorexit((o)[0].v.taddr)
+#ifdef GUARANA
+#define	softcall_multianewarray(r, z, s, t)	(r)->v.taddr = soft_multianewarray(t, CREATOR, z, s)
+#else
 #define	softcall_multianewarray(r, z, s, t)	(r)->v.taddr = soft_multianewarray(t, z, s)
+#endif
 
 #define	softcall_badarrayindex()		soft_badarrayindex()
 #define	softcall_nullpointer()			soft_nullpointer()
@@ -233,6 +248,30 @@
 #define	softcall_checkarraystore(a, o)		soft_checkarraystore((a)[0].v.taddr, (o)[0].v.taddr)
 #define	softcall_addreference(f, t)		soft_addreference((f)[0].v.taddr, (t)[0].v.taddr)
 #define	softcall_addreference_static(f, t)	soft_addreference((f), (t)[0].v.taddr)
+
+#ifdef GUARANA
+#define softcall_reify_method_invocation(obj, method, isStatic) \
+  guarana_intrp_reify_method_invocation((obj)->v.taddr, \
+					(method)->v.taddr, \
+					sp, retval)
+
+
+#define softcall_reify_field_load(mo, obj) \
+  guarana_reify_field_load((mo)->v.taddr, (obj)->v.taddr, field_class(), field, (union wrapValue*)wstack(0))
+
+#define softcall_reify_field_store(mo, obj) \
+  guarana_reify_field_store((mo)->v.taddr, (obj)->v.taddr, field_class(), field, (union wrapValue*)rstack(0))
+
+#define softcall_reify_array_load(mo, obj, index, type, retto) \
+  guarana_reify_array_load((mo)->v.taddr, (obj)->v.taddr, (index)->v.tint, (union wrapValue*)&(retto)->v)
+
+#define softcall_reify_array_store(mo, obj, index, type, value) \
+  guarana_reify_array_store((mo)->v.taddr, (obj)->v.taddr, (index)->v.tint, (union wrapValue*)&(value)->v)
+
+#define softcall_reify_arraylength(to, from) \
+  (to)->v.tint = guarana_reify_arraylength((from)->v.taddr)
+
+#endif
 
 #define	adjustpc(a)				/* Not needed for interpreter */
 
Index: kaffe/kaffe/kaffevm/intrp/machine.c
diff -u kaffe/kaffe/kaffevm/intrp/machine.c:1.1.1.4 kaffe/kaffe/kaffevm/intrp/machine.c:1.2
--- kaffe/kaffe/kaffevm/intrp/machine.c:1.1.1.4	Mon Jun 30 20:46:47 1997
+++ kaffe/kaffe/kaffevm/intrp/machine.c	Wed Jan 21 03:44:34 1998
@@ -40,6 +40,9 @@
 #include "checks.h"
 #include "errors.h"
 #include "md.h"
+#ifdef GUARANA
+#include "../../packages/guarana.unicamp.br/APIguarana/lib/GuaraNative.h"
+#endif
 
 /*
  * Define information about this engine.
Index: kaffe/kaffe/kaffevm/jit/codeproto.h
diff -u kaffe/kaffe/kaffevm/jit/codeproto.h:1.1.1.4 kaffe/kaffe/kaffevm/jit/codeproto.h:1.2
--- kaffe/kaffe/kaffevm/jit/codeproto.h:1.1.1.4	Mon Oct  6 22:51:12 1997
+++ kaffe/kaffe/kaffevm/jit/codeproto.h	Wed Jan 21 03:44:36 1998
@@ -105,6 +105,10 @@
 void return_long(SlotInfo*);
 void return_float(SlotInfo*);
 void return_double(SlotInfo*);
+#define return_boolean return_int
+#define return_byte return_int
+#define return_short return_int
+#define return_char return_int
 
 void returnarg_int(SlotInfo*);
 void returnarg_ref(SlotInfo*);
@@ -126,15 +130,25 @@
 void softcall_get_method_code(SlotInfo*, SlotInfo*);
 void softcall_get_method_code_const(SlotInfo*, Method*);
 void softcall_lookupmethod(SlotInfo*, Method*, SlotInfo*);
+#ifdef GUARANA
+void softcall_new_(SlotInfo*, struct Hjava_lang_Class*, Method *);
+void softcall_newarray_(SlotInfo*, SlotInfo*, int, Method *);
+void softcall_anewarray_(SlotInfo*, SlotInfo*, struct Hjava_lang_Class*, Method *);
+#else
 void softcall_new(SlotInfo*, struct Hjava_lang_Class*);
 void softcall_newarray(SlotInfo*, SlotInfo*, int);
 void softcall_anewarray(SlotInfo*, SlotInfo*, struct Hjava_lang_Class*);
+#endif
 void softcall_athrow(SlotInfo*);
 void softcall_checkcast(SlotInfo*, struct Hjava_lang_Class*);
 void softcall_instanceof(SlotInfo*, SlotInfo*, struct Hjava_lang_Class*);
 void softcall_monitorenter(SlotInfo*);
 void softcall_monitorexit(SlotInfo*);
+#ifdef GUARANA
+void softcall_multianewarray_(SlotInfo*, int, SlotInfo*, struct Hjava_lang_Class*, Method *meth);
+#else
 void softcall_multianewarray(SlotInfo*, int, SlotInfo*, struct Hjava_lang_Class*);
+#endif
 
 label* build_code_ref(uint8*, uintp);
 label* reference_code_label(uintp);
@@ -220,11 +234,19 @@
 void softcall_lookupmethod(SlotInfo*, Method*, SlotInfo*);
 void softcall_badarrayindex(void);
 void softcall_nullpointer(void);
+#ifdef GUARANA
+void softcall_new_(SlotInfo*, struct Hjava_lang_Class*, Method *);
+void softcall_newarray_(SlotInfo*, SlotInfo*, int, Method *);
+void softcall_anewarray_(SlotInfo*, SlotInfo*, struct Hjava_lang_Class*, Method *);
+void softcall_multianewarray_(SlotInfo*, int, SlotInfo*,
+			      struct Hjava_lang_Class*, Method *);
+#else
 void softcall_new(SlotInfo*, struct Hjava_lang_Class*);
 void softcall_newarray(SlotInfo*, SlotInfo*, int);
 void softcall_anewarray(SlotInfo*, SlotInfo*, struct Hjava_lang_Class*);
 void softcall_multianewarray(SlotInfo*, int, SlotInfo*,
 			     struct Hjava_lang_Class*);
+#endif
 void softcall_athrow(SlotInfo*);
 void softcall_checkcast(SlotInfo*, struct Hjava_lang_Class*);
 void softcall_get_method_code(SlotInfo*, SlotInfo*);
Index: kaffe/kaffe/kaffevm/jit/icode.c
diff -u kaffe/kaffe/kaffevm/jit/icode.c:1.1.1.4 kaffe/kaffe/kaffevm/jit/icode.c:1.5
--- kaffe/kaffe/kaffevm/jit/icode.c:1.1.1.4	Mon Oct  6 22:51:14 1997
+++ kaffe/kaffe/kaffevm/jit/icode.c	Wed Jan 21 03:44:40 1998
@@ -2451,10 +2451,25 @@
 	call_soft(soft_nullpointer);
 }
 
-void
+void 
+#ifdef GUARANA
+softcall_new_(SlotInfo* dst, Hjava_lang_Class* classobj, Method *meth)
+#else
 softcall_new(SlotInfo* dst, Hjava_lang_Class* classobj)
+#endif
 {
 	prepare_function_call();
+#ifdef GUARANA
+	if (meth->accflags & ACC_STATIC) {
+		SlotInfo* tmp;
+		slot_alloctmp(tmp);
+		move_ref_const(tmp, meth->class);
+		pusharg_ref(tmp, 1);
+		slot_nowriteback(tmp);
+	} else {
+		pusharg_ref(local(0), 1);
+	}
+#endif
 	pusharg_ref_const(classobj, 0);
 	call_soft(soft_new);
 	popargs();
@@ -2463,10 +2478,25 @@
 }
 
 void
+#ifdef GUARANA
+softcall_newarray_(SlotInfo* dst, SlotInfo* size, int type, Method *meth)
+#else
 softcall_newarray(SlotInfo* dst, SlotInfo* size, int type)
+#endif
 {
 	slot_nowriteback(size);
 	prepare_function_call();
+#ifdef GUARANA
+	if (meth->accflags & ACC_STATIC) {
+		SlotInfo* tmp;
+		slot_alloctmp(tmp);
+		move_ref_const(tmp, meth->class);
+		pusharg_ref(tmp, 2);
+		slot_nowriteback(tmp);
+	} else {
+		pusharg_ref(local(0), 2);
+	}
+#endif
 	pusharg_int(size, 1);
 	pusharg_int_const(type, 0);
 	call_soft(soft_newarray);
@@ -2476,10 +2506,25 @@
 }
 
 void
+#ifdef GUARANA
+softcall_anewarray_(SlotInfo* dst, SlotInfo* size, Hjava_lang_Class* type, Method *meth)
+#else
 softcall_anewarray(SlotInfo* dst, SlotInfo* size, Hjava_lang_Class* type)
+#endif
 {
 	slot_nowriteback(size);
 	prepare_function_call();
+#ifdef GUARANA
+	if (meth->accflags & ACC_STATIC) {
+		SlotInfo* tmp;
+		slot_alloctmp(tmp);
+		move_ref_const(tmp, meth->class);
+		pusharg_ref(tmp, 2);
+		slot_nowriteback(tmp);
+	} else {
+		pusharg_ref(local(0), 2);
+	}
+#endif
 	pusharg_int(size, 1);
 	pusharg_ref_const(type, 0);
 	call_soft(soft_anewarray);
@@ -2489,15 +2534,35 @@
 }
 
 void
+#ifdef GUARANA
+softcall_multianewarray_(SlotInfo* dst, int size, SlotInfo* stktop, Hjava_lang_Class* classobj, Method *meth)
+#else
 softcall_multianewarray(SlotInfo* dst, int size, SlotInfo* stktop, Hjava_lang_Class* classobj)
+#endif
 {
 	int i;
 
 	prepare_function_call();
+#ifdef GUARANA
+	for (i = 0; i < size; i++) {
+		pusharg_int(&stktop[i], 2+size-i);
+	}
+	pusharg_int_const(size, 2);
+	if (meth->accflags & ACC_STATIC) {
+		SlotInfo* tmp;
+		slot_alloctmp(tmp);
+		move_ref_const(tmp, meth->class);
+		pusharg_ref(tmp, 1);
+		slot_nowriteback(tmp);
+	} else {
+		pusharg_ref(local(0), 1);
+	}
+#else
 	for (i = 0; i < size; i++) {
 		pusharg_int(&stktop[i], 1+size-i);
 	}
 	pusharg_int_const(size, 1);
+#endif
 	pusharg_ref_const(classobj, 0);
 	call_soft(soft_multianewarray);
 	popargs();
@@ -2636,4 +2701,5 @@
 	popargs();
 	fixup_function_call();
 }
+
 #endif
Index: kaffe/kaffe/kaffevm/jit/machine.c
diff -u kaffe/kaffe/kaffevm/jit/machine.c:1.1.1.4 kaffe/kaffe/kaffevm/jit/machine.c:1.2
--- kaffe/kaffe/kaffevm/jit/machine.c:1.1.1.4	Mon Oct  6 22:51:17 1997
+++ kaffe/kaffe/kaffevm/jit/machine.c	Wed Jan 21 03:44:43 1998
@@ -45,6 +45,9 @@
 #include "code-analyse.h"
 #include "external.h"
 #include "soft.h"
+#ifdef GUARANA
+#include "../../packages/guarana.unicamp.br/APIguarana/lib/GuaraNative.h"
+#endif
 
 /*
  * Define information about this engine.
Index: kaffe/kaffe/kaffevm/jit/machine.h
diff -u kaffe/kaffe/kaffevm/jit/machine.h:1.1.1.4 kaffe/kaffe/kaffevm/jit/machine.h:1.10
--- kaffe/kaffe/kaffevm/jit/machine.h:1.1.1.4	Mon Oct  6 22:51:19 1997
+++ kaffe/kaffe/kaffevm/jit/machine.h	Wed Feb 18 10:10:53 1998
@@ -88,6 +88,240 @@
 struct _methods;
 void translate(struct _methods*);
 
+#ifdef GUARANA
+#define	softcall_new(r, t)			softcall_new_((r), (t), meth)
+#define	softcall_newarray(r, s, t)		softcall_newarray_((r), (s), (t), meth)
+#define	softcall_anewarray(r, s, t)		softcall_anewarray_((r), (s), (t), meth)
+#define	softcall_multianewarray(r, z, s, t)	softcall_multianewarray_((r), (z), (s), (t), meth)
+
+#define softcall_reify_method_invocation(object, method, isStatic) do { \
+  SlotInfo *null_tmp; \
+  slot_alloctmp(null_tmp); \
+  move_ref_const(null_tmp, 0); \
+  slot_nowriteback(null_tmp); \
+  METHOD_PUSHARGS(6); \
+  pusharg_int_const((isStatic), 5); \
+  pusharg_ref((method), 4); \
+  pusharg_ref(null_tmp, 3); \
+  pusharg_ref(null_tmp, 2); \
+  pusharg_ref((object), 1); \
+  pusharg_ref(null_tmp, 0); \
+  switch(method_returntype()) { \
+  case 'Z': \
+    call_soft(jboolean_do_execute_java_method); \
+    break; \
+  case 'C': \
+    call_soft(jchar_do_execute_java_method); \
+    break; \
+  case 'B': \
+    call_soft(jbyte_do_execute_java_method); \
+    break; \
+  case 'S': \
+    call_soft(jshort_do_execute_java_method); \
+    break; \
+  case 'I': \
+    call_soft(jint_do_execute_java_method); \
+    break; \
+  case 'J': \
+    call_soft(jlong_do_execute_java_method); \
+    break; \
+  case 'F': \
+    call_soft(jfloat_do_execute_java_method); \
+    break; \
+  case 'D': \
+    call_soft(jdouble_do_execute_java_method); \
+    break; \
+  case 'L': \
+  case '[': \
+    call_soft(jref_do_execute_java_method); \
+    break; \
+  case 'V': \
+    call_soft(do_execute_java_method); \
+    break; \
+  default: \
+    ABORT(); \
+  } \
+  popargs(); \
+} while (0)
+
+#define softcall_reify_field_load(mo, obj) do { \
+  prepare_function_call(); \
+  pusharg_ref_const(field, 3); \
+  pusharg_ref_const(field_class(), 2); \
+  pusharg_ref((obj), 1); \
+  pusharg_ref((mo), 0); \
+  if (FIELD_ISREF(field)) { \
+    call_soft(jref_reify_field_load); \
+  } else switch (CLASS_PRIM_SIG(FIELD_TYPE(field))) { \
+  case 'Z': \
+    call_soft(jboolean_reify_field_load); \
+    break; \
+  case 'C': \
+    call_soft(jchar_reify_field_load); \
+    break; \
+  case 'B': \
+    call_soft(jbyte_reify_field_load); \
+    break; \
+  case 'S': \
+    call_soft(jshort_reify_field_load); \
+    break; \
+  case 'I': \
+    call_soft(jint_reify_field_load); \
+    break; \
+  case 'J': \
+    call_soft(jlong_reify_field_load); \
+    break; \
+  case 'F': \
+    call_soft(jfloat_reify_field_load); \
+    break; \
+  case 'D': \
+    call_soft(jdouble_reify_field_load); \
+    break; \
+  default: \
+    ABORT(); \
+  } \
+  popargs(); \
+  fixup_function_call(); \
+  if (FIELD_ISREF(field)) { \
+    return_ref(wstack(0)); \
+  } else switch (CLASS_PRIM_SIG(FIELD_TYPE(field))) { \
+  case 'Z': \
+  case 'C': \
+  case 'B': \
+  case 'S': \
+  case 'I': \
+    return_int(wstack(0)); \
+    break; \
+  case 'J': \
+    return_long(wstack(0)); \
+    break; \
+  case 'F': \
+    return_float(wstack(0)); \
+    break; \
+  case 'D': \
+    return_double(wstack(0)); \
+    break; \
+  default: \
+    ABORT(); \
+  } \
+} while (0)
+
+#ifndef pusharg_char
+#define pusharg_char pusharg_int
+#endif
+#ifndef pusharg_bool
+#define pusharg_bool pusharg_int
+#endif
+#ifndef pusharg_byte
+#define pusharg_byte pusharg_int
+#endif
+#ifndef pusharg_short
+#define pusharg_short pusharg_int
+#endif
+
+#define softcall_reify_field_store(mo, obj) do { \
+  prepare_function_call(); \
+  if (FIELD_ISREF(field)) { \
+    pusharg_ref(rstack(0), 4); \
+  } else switch (CLASS_PRIM_SIG(FIELD_TYPE(field))) { \
+  case 'Z': \
+    pusharg_bool(rstack(0), 4); \
+    break; \
+  case 'C': \
+    pusharg_char(rstack(0), 4); \
+    break; \
+  case 'B': \
+    pusharg_byte(rstack(0), 4); \
+    break; \
+  case 'S': \
+    pusharg_short(rstack(0), 4); \
+    break; \
+  case 'I': \
+    pusharg_int(rstack(0), 4); \
+    break; \
+  case 'J': \
+    pusharg_long(rstack(0), 4); \
+    break; \
+  case 'F': \
+    pusharg_float(rstack(0), 4); \
+    break; \
+  case 'D': \
+    pusharg_double(rstack(0), 4); \
+    break; \
+  default: \
+    ABORT(); \
+  } \
+  pusharg_ref_const(field, 3); \
+  pusharg_ref_const(field_class(), 2); \
+  pusharg_ref((obj), 1); \
+  pusharg_ref((mo), 0); \
+  if (FIELD_ISREF(field)) { \
+    call_soft(jref_reify_field_store); \
+  } else switch (CLASS_PRIM_SIG(FIELD_TYPE(field))) { \
+  case 'Z': \
+    call_soft(jboolean_reify_field_store); \
+    break; \
+  case 'C': \
+    call_soft(jchar_reify_field_store); \
+    break; \
+  case 'B': \
+    call_soft(jbyte_reify_field_store); \
+    break; \
+  case 'S': \
+    call_soft(jshort_reify_field_store); \
+    break; \
+  case 'I': \
+    call_soft(jint_reify_field_store); \
+    break; \
+  case 'J': \
+    call_soft(jlong_reify_field_store); \
+    break; \
+  case 'F': \
+    call_soft(jfloat_reify_field_store); \
+    break; \
+  case 'D': \
+    call_soft(jdouble_reify_field_store); \
+    break; \
+  default: \
+    ABORT(); \
+  } \
+  popargs(); \
+  fixup_function_call(); \
+} while (0)
+
+#define softcall_reify_array_load(mo, obj, index, type, retto) do { \
+  prepare_function_call(); \
+  pusharg_int((index), 2); \
+  pusharg_ref((obj), 1); \
+  pusharg_ref((mo), 0); \
+  call_soft(j##type##_reify_array_load); \
+  popargs(); \
+  fixup_function_call(); \
+  return_##type(retto); \
+} while (0)
+
+#define softcall_reify_array_store(mo, obj, index, type, value) do { \
+  prepare_function_call(); \
+  pusharg_##type((value), 3); \
+  pusharg_int((index), 2); \
+  pusharg_ref((obj), 1); \
+  pusharg_ref((mo), 0); \
+  call_soft(j##type##_reify_array_store); \
+  popargs(); \
+  fixup_function_call(); \
+} while(0)
+
+#define softcall_reify_arraylength(to, from) do { \
+  prepare_function_call(); \
+  pusharg_ref((from), 0); \
+  call_soft(guarana_reify_arraylength); \
+  popargs(); \
+  fixup_function_call(); \
+  return_int((to)); \
+} while (0)
+
+#endif /* GUARANA */
+
 typedef struct _nativeCodeInfo {
 	void*	mem;
 	int	memlen;
Index: kaffe/packages/external_native.h
diff -u kaffe/packages/external_native.h:1.1.1.1 kaffe/packages/external_native.h:1.2
--- kaffe/packages/external_native.h:1.1.1.1	Mon May  5 21:20:11 1997
+++ kaffe/packages/external_native.h	Thu Aug  7 14:39:51 1997
@@ -38,6 +38,9 @@
 #if defined(HAVE_PACKAGE_EPFL_CH)
 #include "epfl.ch/external_wrappers.h"
 #endif
+#if defined(HAVE_PACKAGE_GUARANA_UNICAMP_BR)
+#include "guarana.unicamp.br/external_wrappers.h"
+#endif
 
 #undef	KAFFE_NATIVE
 #define	KAFFE_NATIVE(_f)	KAFFE_NATIVE_METHOD(_f)
@@ -55,6 +58,9 @@
 #endif
 #if defined(HAVE_PACKAGE_EPFL_CH)
 #include "epfl.ch/external_wrappers.h"
+#endif
+#if defined(HAVE_PACKAGE_GUARANA_UNICAMP_BR)
+#include "guarana.unicamp.br/external_wrappers.h"
 #endif
 
 	{ 0, 0 }
Index: kaffe/packages/tjwassoc.co.uk/APIagent/lib/Makefile.in
diff -u kaffe/packages/tjwassoc.co.uk/APIagent/lib/Makefile.in:1.1.1.3 kaffe/packages/tjwassoc.co.uk/APIagent/lib/Makefile.in:1.3
--- kaffe/packages/tjwassoc.co.uk/APIagent/lib/Makefile.in:1.1.1.3	Mon Oct  6 22:46:59 1997
+++ kaffe/packages/tjwassoc.co.uk/APIagent/lib/Makefile.in	Mon Feb 16 18:13:49 1998
@@ -65,7 +65,7 @@
 		$(LN) $(LIB) $(libdir)/$(LLIB)
 
 lib.exp:
-		$(DLLTOOL) --def $(srcdir)/$(LIBNAME).def --output-exp lib.exp --output-lib $(LIBNAME).a --dllname $(LLIB)
+		$(DLLTOOL) --def $(srcdir)/`echo $(LIBNAME) | sed 's/^lib/libkaffe_/'`.def --output-exp lib.exp --output-lib $(LIBNAME).a --dllname $(LLIB)
 		touch lib.exp
 
 # -------------------------------------------------------------------------
Index: kaffe/packages/tjwassoc.co.uk/APIcore/lib/Makefile.in
diff -u kaffe/packages/tjwassoc.co.uk/APIcore/lib/Makefile.in:1.1.1.4 kaffe/packages/tjwassoc.co.uk/APIcore/lib/Makefile.in:1.3
--- kaffe/packages/tjwassoc.co.uk/APIcore/lib/Makefile.in:1.1.1.4	Mon Oct  6 22:47:04 1997
+++ kaffe/packages/tjwassoc.co.uk/APIcore/lib/Makefile.in	Mon Feb 16 18:13:50 1998
@@ -126,7 +126,7 @@
 		$(LN) $(LIB) $(libdir)/$(LLIB)
 
 lib.exp:
-		$(DLLTOOL) --def $(srcdir)/$(LIBNAME).def --output-exp lib.exp --output-lib $(LIBNAME).a --dllname $(LLIB)
+		$(DLLTOOL) --def $(srcdir)/`echo $(LIBNAME) | sed 's/^lib/libkaffe_/'`.def --output-exp lib.exp --output-lib $(LIBNAME).a --dllname $(LLIB)
 		touch lib.exp
 
 # --------------------------------------------------------------------------
Index: kaffe/packages/tjwassoc.co.uk/APIcore/lib/java.lang/Class.c
diff -u kaffe/packages/tjwassoc.co.uk/APIcore/lib/java.lang/Class.c:1.1.1.4 kaffe/packages/tjwassoc.co.uk/APIcore/lib/java.lang/Class.c:1.3
--- kaffe/packages/tjwassoc.co.uk/APIcore/lib/java.lang/Class.c:1.1.1.4	Mon Oct  6 22:47:32 1997
+++ kaffe/packages/tjwassoc.co.uk/APIcore/lib/java.lang/Class.c	Wed Jan 21 03:45:25 1998
@@ -24,6 +24,8 @@
 #include "java.io.stubs/PrintStream.h"
 #include "java.lang.stubs/System.h"
 #include "java.lang.reflect.stubs/Field.h"
+#include "java.lang.reflect.stubs/Method.h"
+#include "java.lang.reflect.stubs/Constructor.h"
 #include <native.h>
 #include "defs.h"
 
@@ -223,31 +225,412 @@
 	unimp("java.lang.Class:setSigners unimplemented");
 }
 
-jint
-java_lang_Class_getMethods0()
+
+int
+arrayEquals( HArrayOfObject * first, HArrayOfObject * second )
 {
-	unimp("java.lang.Class:getMethods0 unimplemented");
+	int i;
+	if ( ARRAY_SIZE(first) != ARRAY_SIZE(second) )
+		return 0;
+	for ( i = ARRAY_SIZE(first) -1; i >= 0; i-- )
+	{
+		if ( OBJARRAY_DATA(first)[i] != OBJARRAY_DATA(second)[i] )
+			return 0;
+	}
+	return 1;
 }
 
-jint
-java_lang_Class_getConstructors0()
+HArrayOfObject*
+parseSignature2Classes( char * signature, struct Hjava_lang_Class** returnType_holder )
 {
-	unimp("java.lang.Class:getConstructors0 unimplemented");
+	HArrayOfObject * array;
+	Hjava_lang_Class ** adata;
+	Hjava_lang_Class * tclass;
+	const char * ptr;
+	char buf[CLASSMAXSIG];	/* FIXME - size of buffer? */
+	char * bufptr;
+	int ins =0;
+	int i = 0;
+	int arraynest =0;
+
+
+	ptr = signature;
+	while(1)
+	{
+		switch( *ptr )
+		{
+			case '(':
+				ptr++;
+				break;
+		    case ')':
+				goto knowlength;
+			case 'L':
+				ins++;
+				while( *ptr != ';' )
+					ptr++;
+				ptr++;
+				break;
+			case '[':
+				ptr++;
+				break;
+			default:
+				ins++;
+				ptr++;
+				break;
+		}
+	}
+
+knowlength:
+
+	array = (HArrayOfObject*)AllocObjectArray(ins, "Ljava/lang/Class;");
+	ptr = signature;
+	adata = (Hjava_lang_Class** ) ARRAY_DATA(array);
+
+	while(1)
+	{
+		switch( *ptr )
+		{
+			case '(':
+				ptr++;
+				continue;
+			case ')':
+				ptr++;
+				goto checkreturn;
+			case 'I':
+				tclass = &intClass;
+				ptr++;
+				break;
+			case 'Z':
+				tclass = &booleanClass;
+				ptr++;
+				break;
+			case 'S':
+				tclass = &shortClass;
+				ptr++;
+				break;
+			case 'B':
+				tclass = &byteClass;
+				ptr++;
+				break;
+			case 'C':
+				tclass = &charClass;
+				ptr++;
+				break;
+			case 'F':
+				tclass = &floatClass;
+				ptr++;
+				break;
+			case 'D':
+				tclass = &doubleClass;
+				ptr++;
+				break;
+			case 'J':
+				tclass = &longClass;
+				ptr++;
+				break;
+			case '[':
+				while ( *ptr == '[' )
+				{
+					ptr++;
+					arraynest++;
+				}
+				continue;
+			case 'L':
+				ptr++;
+				bufptr = buf;
+				while ( *ptr != ';' )
+					*bufptr++ = *ptr++;
+				*bufptr = '\0';
+				tclass = lookupClass( buf );
+				ptr++;
+				break;
+			default:
+				abort();
+		
+		}
+
+		while ( arraynest )
+		{
+			tclass = lookupArray(tclass);
+			arraynest--;
+		}
+		*(adata +i) = tclass;
+		i++;
+	}
+
+checkreturn:
+
+	assert(arraynest == 0);
+	if (returnType_holder)
+	{
+
+arrayback:
+		switch( *ptr )
+		{
+			case 'I':
+				*returnType_holder = &intClass;
+				break;
+			case 'Z':
+				*returnType_holder = &booleanClass;
+				break;
+			case 'S':
+				*returnType_holder = &shortClass;
+				break;
+			case 'B':
+				*returnType_holder= &byteClass;
+				break;
+			case 'C':
+				*returnType_holder = &charClass;
+				break;
+			case 'F':
+				*returnType_holder = &floatClass;
+				break;
+			case 'D':
+				*returnType_holder = &doubleClass;
+				break;
+			case 'J':
+				*returnType_holder = &longClass;
+				break;
+			case 'V':
+				*returnType_holder = &voidClass;
+				break;
+			case '[':
+				while ( *ptr == '[' )
+				{
+					arraynest++;
+					ptr++;
+				}
+				goto arrayback;
+			case 'L':
+				ptr++;
+				bufptr = buf;
+				while ( *ptr != ';' )
+					*bufptr++ = *ptr++;
+				*bufptr = '\0';
+				*returnType_holder = lookupClass( buf );
+				break;
+			default:
+				abort();
+		}
+
+		while ( arraynest )
+		{
+			*returnType_holder = lookupArray(*returnType_holder);
+			arraynest--;
+		}
+	}
+	return array;
 }
 
-jint
-java_lang_Class_getMethod0()
+
+struct Hjava_lang_reflect_Method*
+makeMethod(struct Hjava_lang_Class* clazz, int slot, HArrayOfObject* parameters,
+	struct Hjava_lang_Class * returnType )
 {
-	unimp("java.lang.Class:getMethod0 unimplemented");
+	Hjava_lang_reflect_Method* method;
+	Method* met;
+
+	met = CLASS_METHODS((Hjava_lang_Class*)clazz) + slot;
+	method = (Hjava_lang_reflect_Method*)AllocObject("java/lang/reflect/Method");
+	unhand(method)->clazz = (struct Hjava_lang_Class*) clazz;
+	unhand(method)->slot = slot;
+	unhand(method)->name = Utf8Const2JavaString(met->name);
+	unhand(method)->returnType = returnType;
+	unhand(method)->parameterTypes = parameters;
+	unhand(method)->exceptionTypes = (HArrayOfObject*) AllocObjectArray(0,"Ljava/lang/Class");
+	/* FIXME - check real exceptions for method - need to change main kaffe */
+	return (method);
 }
 
-jint
-java_lang_Class_getConstructor0()
+#define IS_CONSTRUCTOR( met )	equalUtf8Consts(met->name, constructor_name)
+
+HArrayOfObject*
+java_lang_Class_getMethods0(struct Hjava_lang_Class* this , jint declared)
+{
+	int count =0;
+	Hjava_lang_Class* clas;
+	Hjava_lang_Class* returnType;
+	Method* met;
+	Hjava_lang_reflect_Method** ptr;
+	HArrayOfObject* array;
+	HArrayOfObject* params;
+	int i,nsize;
+
+	if (declared) {
+		i = CLASS_NMETHODS((Hjava_lang_Class*)this);
+		met = CLASS_METHODS(clas);
+		for ( ; --i >= 0;  ++met) {
+			if (!IS_CONSTRUCTOR(met)) 
+				count++;
+		}
+	}
+	else {
+		clas = (Hjava_lang_Class*) this;
+		for (; clas != NULL; clas = clas->superclass) {
+			met = CLASS_METHODS(clas);
+			i = CLASS_NMETHODS(clas);
+			for ( ; --i >= 0;  ++met) {
+				if ( (met->accflags & ACC_PUBLIC) && 
+				( !IS_CONSTRUCTOR(met) ) )
+				{
+					count++;
+				}
+			}
+		}
+	}
+	
+	array = (HArrayOfObject*)AllocObjectArray(count, "Ljava/lang/reflect/Method;");
+	ptr = (Hjava_lang_reflect_Method**) ARRAY_DATA(array) + count;
+	clas = (Hjava_lang_Class*) this;
+	do {
+		met = CLASS_METHODS(clas);
+		nsize = CLASS_NMETHODS(clas);
+		for ( i=0; i < nsize;  met++,i++) {
+			if (! (met->accflags & ACC_PUBLIC) && ! declared) {
+				continue;
+			}
+			if ( IS_CONSTRUCTOR(met) )
+				continue;
+			params = parseSignature2Classes(met->signature->data, &returnType);
+			*--ptr = makeMethod(clas, i,params,returnType);
+		}
+		clas = clas->superclass;
+	} while (!declared && clas != NULL);
+
+	return (array);
+}
+
+
+struct Hjava_lang_reflect_Method*
+java_lang_Class_getMethod0(struct Hjava_lang_Class* this, struct Hjava_lang_String* name, HArrayOfObject* parameters, jint declared)
 {
-	unimp("java.lang.Class:getConstructor0 unimplemented");
+	Hjava_lang_Class* clas;
+	HArrayOfObject* mparams;
+	Hjava_lang_Class* returnType;
+
+	clas = (Hjava_lang_Class*) this;
+	if ( !equalUtf8JavaStrings( constructor_name, name )	 )
+	{
+		do {
+			Method* met = CLASS_METHODS(clas);
+			int n = CLASS_NMETHODS(clas);
+			int i;
+			for (i = 0;  i < n;  ++met, ++i) {
+				if (((met->accflags & ACC_PUBLIC) || declared)
+					&& equalUtf8JavaStrings (met->name, name)) {
+						mparams = parseSignature2Classes(met->signature->data,
+							&returnType);
+						if ( arrayEquals( parameters, mparams ) )
+							return makeMethod(clas, i,mparams,returnType);
+				
+				}
+			}
+			clas = clas->superclass;
+		} while (!declared && clas != NULL);
+	}
+	SignalError(0, "java.lang.NoSuchMethodException", ""); /* FIXME */
 }
+
+
+struct Hjava_lang_reflect_Constructor*
+makeConstructor(struct Hjava_lang_Class* clazz, int slot, HArrayOfObject* parameters )
+{
+	Hjava_lang_reflect_Constructor* constructor;
+	Method* met;
 
-static
+	met = CLASS_METHODS((Hjava_lang_Class*)clazz) + slot;
+	constructor = (Hjava_lang_reflect_Constructor*)AllocObject("java/lang/reflect/Constructor");
+	unhand(constructor)->clazz = (struct Hjava_lang_Class*) clazz;
+	unhand(constructor)->slot = slot;
+	unhand(constructor)->parameterTypes = parameters;
+	unhand(constructor)->exceptionTypes = (HArrayOfObject*) AllocObjectArray(0,"Ljava/lang/Class");
+	/* FIXME - check real exceptions for method - need to change main kaffe */
+	return (constructor);
+}
+
+
+HArrayOfObject*
+java_lang_Class_getConstructors0(struct Hjava_lang_Class* this , jint declared)
+{
+	int count =0;
+	Hjava_lang_Class* clas;
+	Hjava_lang_Class* returnType;
+	Method* met;
+	Hjava_lang_reflect_Constructor** ptr;
+	HArrayOfObject* array;
+	HArrayOfObject* params;
+	int i,nsize;
+
+	if (declared) {
+		i = CLASS_NMETHODS((Hjava_lang_Class*)this);
+		met = CLASS_METHODS(clas);
+		for ( ; --i >= 0;  ++met) {
+			if (IS_CONSTRUCTOR(met)) 
+				count++;
+		}
+	}
+	else {
+		clas = (Hjava_lang_Class*) this;
+		for (; clas != NULL; clas = clas->superclass) {
+			met = CLASS_METHODS(clas);
+			i = CLASS_NMETHODS(clas);
+			for ( ; --i >= 0;  ++met) {
+				if ( (met->accflags & ACC_PUBLIC) && 
+				( IS_CONSTRUCTOR(met)) )
+				{
+					count++;
+				}
+			}
+		}
+	}
+	
+	array = (HArrayOfObject*)AllocObjectArray(count, "Ljava/lang/reflect/Constructor;");
+	ptr = (Hjava_lang_reflect_Constructor**) ARRAY_DATA(array) + count;
+	clas = (Hjava_lang_Class*) this;
+	do {
+		met = CLASS_METHODS(clas);
+		nsize = CLASS_NMETHODS(clas);
+		for ( i=0; i < nsize;  met++,i++) {
+			if (! (met->accflags & ACC_PUBLIC) && ! declared) {
+				continue;
+			}
+			if ( !IS_CONSTRUCTOR(met) )
+				continue;
+			params = parseSignature2Classes(met->signature->data, &returnType);
+			*--ptr = makeConstructor(clas, i,params);
+		}
+		clas = clas->superclass;
+	} while (!declared && clas != NULL);
+
+	return (array);
+}
+
+struct Hjava_lang_reflect_Constructor*
+java_lang_Class_getConstructor0(struct Hjava_lang_Class* this, HArrayOfObject* parameters, jint declared)
+{
+	Hjava_lang_Class* clas;
+	HArrayOfObject* mparams;
+	Hjava_lang_Class* returnType;
+
+	clas = (Hjava_lang_Class*) this;
+	do {
+		Method* met = CLASS_METHODS(clas);
+		int n = CLASS_NMETHODS(clas);
+		int i;
+		for (i = 0;  i < n;  ++met, ++i) {
+			if (((met->accflags & ACC_PUBLIC) || declared)
+				&& IS_CONSTRUCTOR(met)) {
+					mparams = parseSignature2Classes(met->signature->data,
+						&returnType);
+					if ( arrayEquals( parameters, mparams ) )
+						return makeConstructor(clas, i,mparams);
+			}
+		}
+		clas = clas->superclass;
+	} while (!declared && clas != NULL);
+	SignalError(0, "java.lang.NoSuchMethodException", ""); /* FIXME */
+}
+
 Hjava_lang_reflect_Field*
 makeField(struct Hjava_lang_Class* clazz, int slot)
 {
@@ -271,7 +654,7 @@
 	Field* fld;
 	Hjava_lang_reflect_Field** ptr;
 	HArrayOfObject* array;
-	int i;
+	int i,nsize;
 
 	if (declared) {
 		count = CLASS_NFIELDS((Hjava_lang_Class*)clazz);
@@ -294,8 +677,8 @@
 	clas = (Hjava_lang_Class*) clazz;
 	do {
 		fld = CLASS_FIELDS(clas);
-		i = CLASS_NFIELDS(clas);
-		for ( ; --i >= 0;  ++fld) {
+		nsize = CLASS_NFIELDS(clas);
+		for ( i=0; i < nsize;  fld++,i++) {
 			if (! (fld->accflags & ACC_PUBLIC) && ! declared) {
 				continue;
 			}
Index: kaffe/packages/tjwassoc.co.uk/APInet/lib/Makefile.in
diff -u kaffe/packages/tjwassoc.co.uk/APInet/lib/Makefile.in:1.1.1.4 kaffe/packages/tjwassoc.co.uk/APInet/lib/Makefile.in:1.3
--- kaffe/packages/tjwassoc.co.uk/APInet/lib/Makefile.in:1.1.1.4	Mon Oct  6 22:48:15 1997
+++ kaffe/packages/tjwassoc.co.uk/APInet/lib/Makefile.in	Mon Feb 16 18:13:52 1998
@@ -75,7 +75,7 @@
 		$(LN) $(LIB) $(libdir)/$(LLIB)
 
 lib.exp:
-		$(DLLTOOL) --def $(srcdir)/$(LIBNAME).def --output-exp lib.exp --output-lib $(LIBNAME).a --dllname $(LLIB)
+		$(DLLTOOL) --def $(srcdir)/`echo $(LIBNAME) | sed 's/^lib/libkaffe_/'`.def --output-exp lib.exp --output-lib $(LIBNAME).a --dllname $(LLIB)
 		touch lib.exp
 
 # -----------------------------------------------------------------------
Index: kaffe/packages/tjwassoc.co.uk/APIzip/lib/Makefile.in
diff -u kaffe/packages/tjwassoc.co.uk/APIzip/lib/Makefile.in:1.1.1.2 kaffe/packages/tjwassoc.co.uk/APIzip/lib/Makefile.in:1.3
--- kaffe/packages/tjwassoc.co.uk/APIzip/lib/Makefile.in:1.1.1.2	Mon Oct  6 22:48:28 1997
+++ kaffe/packages/tjwassoc.co.uk/APIzip/lib/Makefile.in	Mon Feb 16 18:13:54 1998
@@ -69,7 +69,7 @@
 		$(LN) $(LIB) $(libdir)/$(LLIB)
 
 lib.exp:
-		$(DLLTOOL) --def $(srcdir)/$(LIBNAME).def --output-exp lib.exp --output-lib $(LIBNAME).a --dllname $(LLIB)
+		$(DLLTOOL) --def $(srcdir)/`echo $(LIBNAME) | sed 's/^lib/libkaffe_/'`.def --output-exp lib.exp --output-lib $(LIBNAME).a --dllname $(LLIB)
 		touch lib.exp
 
 # --------------------------------------------------------------------------
