Index: acinclude.m4
===================================================================
RCS file: /cvsroot/classpath/classpath/acinclude.m4,v
retrieving revision 1.19
diff -u -r1.19 acinclude.m4
--- acinclude.m4	2000/12/15 04:58:55	1.19
+++ acinclude.m4	2001/10/26 13:42:53
@@ -1,11 +1,11 @@
 dnl
 dnl Added macros
 dnl JAPHAR_GREP_CFLAGS
-dnl CLASSPATH_CHECK_JAPHAR
-dnl CLASSPATH_CHECK_KAFFE
-dnl CLASSPATH_CHECK_THREADS
-dnl CLASSPATH_CHECK_GLIB
-dnl CLASSPATH_CHECK_GTK
+dnl CLASSPATH_WITH_JAPHAR
+dnl CLASSPATH_WITH_KAFFE
+dnl CLASSPATH_WITH_THREADS
+dnl CLASSPATH_WITH_GLIB
+dnl CLASSPATH_WITH_GTK
 dnl
 
 dnl JAPHAR_GREP_CFLAGS(flag, cmd_if_missing, cmd_if_present)
@@ -20,8 +20,8 @@
 esac
 ])
 
-dnl CLASSPATH_INTERNAL_CHECK_JAPHAR
-AC_DEFUN(CLASSPATH_INTERNAL_CHECK_JAPHAR,
+dnl CLASSPATH_CHECK_JAPHAR
+AC_DEFUN(CLASSPATH_CHECK_JAPHAR,
 [
   if test "$1" = ""; then
     AC_PATH_PROG(JAPHAR_CONFIG, japhar-config, "", $PATH:/usr/local/japhar/bin:/usr/japhar/bin)
@@ -77,8 +77,8 @@
   AC_SUBST(JAPHAR_CLASSLIB)
 ])
 
-dnl CLASSPATH_INTERNAL_CHECK_KAFFE
-AC_DEFUN(CLASSPATH_INTERNAL_CHECK_KAFFE,
+dnl CLASSPATH_CHECK_KAFFE
+AC_DEFUN(CLASSPATH_CHECK_KAFFE,
 [
   AC_PATH_PROG(KAFFE_CONFIG, kaffe-config, "", $PATH:/usr/local/kaffe/bin:/usr/kaffe/bin)
   if test "$KAFFE_CONFIG" = ""; then
@@ -161,16 +161,16 @@
   AC_SUBST(KAFFE_CLASSLIB)
 ])
 
-dnl CLASSPATH_CHECK_JAPHAR - checks for japhar
-AC_DEFUN(CLASSPATH_CHECK_JAPHAR,
+dnl CLASSPATH_WITH_JAPHAR - checks for japhar
+AC_DEFUN(CLASSPATH_WITH_JAPHAR,
 [
   AC_ARG_WITH(japhar, 
   [  --with-japhar		  configure GNU Classpath for Japhar [default=yes]],
   [
     if test ${withval} = "yes" || test ${withval} = ""; then
-      CLASSPATH_INTERNAL_CHECK_JAPHAR
+      CLASSPATH_CHECK_JAPHAR
     elif test ${withval} != "no" || test ${withval} != "false"; then
-      CLASSPATH_INTERNAL_CHECK_JAPHAR(${withval})
+      CLASSPATH_CHECK_JAPHAR(${withval})
     fi
   ],
   [ 
@@ -180,14 +180,14 @@
   ])
 ])
 
-dnl CLASSPATH_CHECK_KAFFE - checks for which java virtual machine to use
-AC_DEFUN(CLASSPATH_CHECK_KAFFE,
+dnl CLASSPATH_WITH_KAFFE - checks for which java virtual machine to use
+AC_DEFUN(CLASSPATH_WITH_KAFFE,
 [
   AC_ARG_WITH(kaffe, 
   [  --with-kaffe		  configure GNU Classpath for Kaffe [default=no]],
   [   
     if test ${withval} = "yes" || test ${withval} = ""; then
-      CLASSPATH_INTERNAL_CHECK_KAFFE
+      CLASSPATH_CHECK_KAFFE
     fi
   ],
   [ conditional_with_kaffe=false
@@ -253,59 +253,276 @@
     fi
   fi
 ])
+
 
-dnl CLASSPATH_INTERNAL_CHECK_JIKES
-AC_DEFUN(CLASSPATH_INTERNAL_CHECK_JIKES,
+AC_DEFUN(CLASSPATH_FIND_JAVAC,
 [
-  AC_PATH_PROG(JIKES, jikes, "", $PATH:/usr/local/bin)
-  if test "$JIKES" = ""; then
-    echo "configure: cannot find jikes: is jikes in your path?" 1>&2
-    exit 1
+  user_specified_javac=
+
+  CLASSPATH_WITH_GCJ
+  CLASSPATH_WITH_JIKES
+  CLASSPATH_WITH_KJC
+
+  case "$user_specified_javac" in
+    gcj) AM_CONDITIONAL(FOUND_GCJ, test x = x) ;;
+    jikes) AM_CONDITIONAL(FOUND_JIKES, test x = x) ;;
+    kjc) AM_CONDITIONAL(FOUND_KJC, test x = x) ;;
+  esac
+
+  if test "$user_specified_javac" = ""; then
+    AM_CONDITIONAL(FOUND_GCJ, test "$GCJ" != "")
+    AM_CONDITIONAL(FOUND_JIKES, test "$JIKES" != "")
+  fi
+
+  if test "$GCJ" = "" && test "$JIKES" = "" && test "$user_specified_javac" != "kjc"; then
+      echo "configure: cannot find javac, try --with-gcj, --with-jikes, or --with-kjc" 1>&2
+      exit 1    
   fi
 ])
 
 
-dnl CLASSPATH_CHECK_JIKES - checks for jikes
-AC_DEFUN(CLASSPATH_CHECK_JIKES,
+AC_DEFUN(CLASSPATH_WITH_GCJ,
 [
-  AC_ARG_WITH(jikes, 
-  [  --with-jikes		  compile classes with jikes [default=no]],
+  AC_ARG_WITH(gcj,
+  [  --with-gcj              bytecode compilation with gcj ],
   [
-    if test ${withval} != "no"; then
-      if test ${withval} = "" || test ${withval} = "yes"; then
-        CLASSPATH_INTERNAL_CHECK_JIKES
-      else 
-        JIKES=${withval}
-	AC_SUBST(JIKES)
+    if test ${withval} != "" && test ${withval} != "yes" && test ${withval} != "no"; then
+      CLASSPATH_CHECK_GCJ(${withval})
+    else
+      if test ${withval} != "no"; then
+        CLASSPATH_CHECK_GCJ
+      fi
+    fi
+    user_specified_javac=gcj
+    AM_CONDITIONAL(USER_SPECIFIED_GCJ, test "$GCJ" != "")
+  ],
+  [
+    CLASSPATH_CHECK_GCJ
+  ])
+  AC_SUBST(GCJ)
+])
+
+
+AC_DEFUN(CLASSPATH_CHECK_GCJ,
+[
+  if test "$1" != ""; then
+    if test -f "$1"; then
+      GCJ="$1"
+    else
+      AC_PATH_PROG(GCJ, "$1")
+    fi
+  else
+    AC_PATH_PROG(GCJ, "gcj")
+  fi  
+])
+
+
+AC_DEFUN(CLASSPATH_WITH_JIKES,
+[
+  AC_ARG_WITH(jikes,
+  [  --with-jikes		  bytecode compilation with jikes ],
+  [
+    if test ${withval} != "" && test ${withval} != "yes" && test ${withval} != "no"; then
+      CLASSPATH_CHECK_JIKES(${withval})
+    else
+      if test ${withval} != "no"; then
+        CLASSPATH_CHECK_JIKES
       fi
-      conditional_with_jikes=true
     fi
+    user_specified_javac=jikes
+    AM_CONDITIONAL(USER_SPECIFIED_JIKES, test "$JIKES" != "")
   ],
   [ 
-    conditional_with_jikes=false
+    CLASSPATH_CHECK_JIKES
   ])
+  AC_SUBST(JIKES)
+])
+
+
+AC_DEFUN(CLASSPATH_CHECK_JIKES,
+[
+  if test "$1" != ""; then
+    if test -f "$1"; then
+      JIKES="$1"
+    else
+      AC_PATH_PROG(JIKES, "$1")
+    fi
+  else
+    AC_PATH_PROG(JIKES, "jikes")
+  fi
 ])
 
 
-dnl CLASSPATH_CHECK_KJC - checks for kjc
-AC_DEFUN(CLASSPATH_CHECK_KJC,
+AC_DEFUN(CLASSPATH_WITH_KJC,
 [
   AC_ARG_WITH(kjc, 
-  [  --with-kjc=DIR	  compile classes with kjc [default=no]],
+  [  --with-kjc=<ksusu.jar>  bytecode compilation with kjc [default=no]],
   [
     if test ${withval} != "no"; then
       AC_MSG_CHECKING(for kjc)
       if test ${withval} = "" || test ${withval} = "yes"; then
-        AC_MSG_ERROR(specify a classpath to kjc)
+        AC_MSG_ERROR(specify the location of ksusu.jar or kjc CLASSPATH)
       fi
       KJC_CLASSPATH=${withval}
       AC_SUBST(KJC_CLASSPATH)
       conditional_with_kjc=true
       AC_MSG_RESULT(${withval})
     fi
+    user_specified_javac=kjc
+    AM_CONDITIONAL(USER_SPECIFIED_KJC, test x$conditional_with_kjc = xtrue)
   ],
   [ 
     conditional_with_kjc=false
   ])
+
+
+  if test x$conditional_with_kjc = xtrue && test "$USER_JABBA" = ""; then
+    CLASSPATH_FIND_JAVA
+    if test "$USER_JABBA" = ""; then
+      echo "configure: cannot find java, try --with-java" 1>&2
+      exit 1
+    fi
+  fi
+])
+
+
+AC_DEFUN(CLASSPATH_WITH_JAVA,
+[
+  AC_ARG_WITH(java,
+  [  --with-java		  specify path or name of a java-like program ],
+  [
+    if test ${withval} != "" && test ${withval} != "yes" && test ${withval} != "no"; then
+      CLASSPATH_CHECK_JAVA(${withval})
+    else
+      if test ${withval} != "no"; then
+        CLASSPATH_CHECK_JAVA
+      fi
+    fi
+    AM_CONDITIONAL(USER_SPECIFIED_JABBA, test "$USER_JABBA" != "")
+  ],
+  [ 
+    CLASSPATH_CHECK_JAVA
+  ])
+  AC_SUBST(USER_JABBA)
+])
+
+
+AC_DEFUN(CLASSPATH_CHECK_JAVA,
+[
+  if test "$1" != ""; then
+    if test -f "$1"; then
+      USER_JABBA="$1"
+    else
+      AC_PATH_PROG(USER_JABBA, "$1")
+    fi
+  else
+    AC_PATH_PROG(USER_JABBA, "java")
+  fi
+])
+
+
+AC_DEFUN(CLASSPATH_FIND_JAVA,
+[
+  dnl Place additional bytecode interpreter checks here
+
+  CLASSPATH_WITH_JAVA
+])
+
+
+AC_DEFUN(CLASSPATH_WITH_JAVAH,
+[
+  AC_ARG_WITH(javah,
+  [  --with-javah		  specify path or name of a javah-like program ],
+  [
+    if test ${withval} != "" && test ${withval} != "yes" && test ${withval} != "no"; then
+      CLASSPATH_CHECK_JAVAH(${withval})
+    else
+      CLASSPATH_CHECK_JAVAH
+    fi
+    AM_CONDITIONAL(USER_SPECIFIED_JAVAH, test "$USER_JAVAH" != "")
+  ],
+  [ 
+    CLASSPATH_CHECK_JAVAH
+  ])
+  AC_SUBST(USER_JAVAH)
+])
+
+dnl Checking for a javah like program 
+AC_DEFUN(CLASSPATH_CHECK_JAVAH,
+[
+  if test "$1" != ""; then
+    if test -f "$1"; then
+      USER_JAVAH="$1"
+    else
+      AC_PATH_PROG(USER_JAVAH, "$1")
+    fi
+  else
+    for javah_name in gcjh javah; do
+      AC_PATH_PROG(USER_JAVAH, "$javah_name")
+      if test "$USER_JAVAH" != ""; then
+        break
+      fi
+    done
+  fi
+  
+  if test "$USER_JAVAH" = ""; then
+    echo "configure: cannot find javah" 1>&2
+    exit 1
+  fi
 ])
 
+dnl CLASSPATH_WITH_CLASSLIB - checks for user specified classpath additions
+AC_DEFUN(CLASSPATH_WITH_CLASSLIB,
+[
+  AC_ARG_WITH(classpath,
+  [  --with-classpath        specify path to a classes.zip like file ],
+  [
+    if test ${withval} = "yes"; then
+      # set user classpath to CLASSPATH from env
+      AC_MSG_CHECKING(for classlib)
+      USER_CLASSLIB=${CLASSPATH}
+      AC_SUBST(USER_CLASSLIB)
+      AC_MSG_RESULT(${USER_CLASSLIB})
+      conditional_with_classlib=true      
+    elif test ${withval} != "" && test ${withval} != "no"; then
+      # set user classpath to specified value
+      AC_MSG_CHECKING(for classlib)
+      USER_CLASSLIB=${withval}
+      AC_SUBST(USER_CLASSLIB)
+      AC_MSG_RESULT(${withval})
+      conditional_with_classlib=true
+    fi
+  ],
+  [ conditional_with_classlib=false ])
+  AM_CONDITIONAL(USER_SPECIFIED_CLASSLIB, test x$conditional_with_classlib = xtrue)
+])
+
+
+dnl CLASSPATH_WITH_INCLUDEDIR - checks for user specified extra include directories
+AC_DEFUN(CLASSPATH_WITH_INCLUDEDIR,
+[
+  AC_ARG_WITH(includedir,
+  [  --with-includedir=DIR   specify path to an extra include dir ],
+  [
+    AC_MSG_CHECKING(for includedir)
+    if test ${withval} != "" && test ${withval} != "yes" && test ${withval} != "no"; then
+      if test -r ${withval}; then
+        if test "$EXTRA_INCLUDES" = ""; then
+          EXTRA_INCLUDES="-I${withval}"
+        else
+          EXTRA_INCLUDES="${EXTRA_INCLUDES} -I${withval}"
+        fi
+        AC_SUBST(EXTRA_INCLUDES)
+        AC_MSG_RESULT("added ${withval}")
+      else
+        AC_MSG_RESULT("${withval} does not exist")
+      fi
+    fi
+  ],
+  [
+    if test -z "$EXTRA_INCLUDES"; then
+      EXTRA_INCLUDES=""
+      AC_SUBST(EXTRA_INCLUDES)
+    fi
+  ])
+])
Index: configure.in
===================================================================
RCS file: /cvsroot/classpath/classpath/configure.in,v
retrieving revision 1.75
diff -u -r1.75 configure.in
--- configure.in	2001/10/19 17:49:52	1.75
+++ configure.in	2001/10/26 13:42:53
@@ -1,11 +1,14 @@
 dnl Process this file with autoconf to produce a configure script.
 
+dnl Turning off cache for debug reasons
+define([AC_CACHE_LOAD], )dnl
+define([AC_CACHE_SAVE], )dnl
 AC_INIT(java/lang/System.java)
 
 AC_CANONICAL_HOST
 
 PACKAGE="classpath"
-VERSION="0.02"
+VERSION="0.03"
 LIBVERSION="0:0:0"
 AC_SUBST(PACKAGE)
 AC_SUBST(VERSION)
@@ -16,198 +19,111 @@
 
 AC_PREFIX_DEFAULT(/usr/local/classpath)
 
-dnl Initialize libtool
-AM_DISABLE_STATIC
-AM_PROG_LIBTOOL
-
 dnl required if SUBDIRS is used
 AC_PROG_MAKE_SET
 
-dnl Checks for programs.
-dnl AC_PROG_CXX
-AC_PROG_AWK
-AC_PROG_CC
-AC_PROG_CPP
-AC_PROG_INSTALL
+AC_ARG_ENABLE(java,
+[  --enable-java           compile Java source [default=yes]],
+[case "${enableval}" in 
+  yes) COMPILE_JAVA=yes ;;
+  no) COMPILE_JAVA=no ;;
+  *) COMPILE_JAVA=yes ;;
+esac],
+[COMPILE_JAVA=yes])
+
+AC_ARG_ENABLE(jni,
+[  --enable-jni            compile JNI source [default=no]],
+[case "${enableval}" in 
+  yes) 
+    COMPILE_JNI=yes
+    COMPILE_JAVA=yes
+
+    ;;
+  no) COMPILE_JNI=no ;;
+  *) COMPILE_JNI=yes; COMPILE_JAVA=yes ;;
+esac],
+[COMPILE_JNI=no])
+
+AC_ARG_ENABLE(cni,
+[  --enable-cni            compile CNI source [default=no]],
+[case "${enableval}" in 
+  yes) COMPILE_CNI=yes; COMPILE_JAVA=yes ;;
+  no) COMPILE_CNI=no ;;
+  *) COMPILE_CNI=yes; COMPILE_JAVA=yes ;;
+esac],
+[COMPILE_CNI=no])
+
+AM_CONDITIONAL(CREATE_JNI_HEADERS, test x$COMPILE_JNI = xyes) 
+AM_CONDITIONAL(CREATE_JNI_LIBRARIES, test x$COMPILE_JNI = xyes)
+AM_CONDITIONAL(CREATE_CNI_LIBRARIES, test x$COMPILE_CNI = xyes)
+
 AC_PROG_LN_S
-AC_HEADER_STDC
-AC_CHECK_HEADERS(unistd.h sys/types.h sys/config.h inttypes.h stdint.h)
-AC_EGREP_HEADER(uint32_t, stdint.h, AC_DEFINE(HAVE_INT32_DEFINED))
-AC_EGREP_HEADER(uint32_t, inttypes.h, AC_DEFINE(HAVE_INT32_DEFINED))
-AC_EGREP_HEADER(u_int32_t, sys/types.h, AC_DEFINE(HAVE_BSD_INT32_DEFINED))
-AC_EGREP_HEADER(u_int32_t, sys/config.h, AC_DEFINE(HAVE_BSD_INT32_DEFINED))
-AC_C_CONST
-AC_CHECK_FUNCS(gethostname socket strerror fork pipe execve strtod atof)
-AC_HEADER_TIME
-AC_STRUCT_TM
-AC_STRUCT_TIMEZONE
-
-AC_C_BIGENDIAN
-
-dnl guile checks - shouldn't need now that mauve exists
-dnl GUILE_FLAGS
-
-dnl We want to avoid -O2 at the moment, gcc 2.96 from Red Hat 7
-dnl cannot compile some native functions (gcc errors) with this
-dnl flag.
-CFLAGS="-g"
-
-dnl We want warnings, lots of warnings :-)
-if eval "test x$GCC = xyes"; then
-  JAPHAR_GREP_CFLAGS(-Wall, [
-    CFLAGS="$CFLAGS -Wall"
-  ])
-fi
+AC_PROG_INSTALL
 
-dnl Check for cthreads, w32 threads, pthreads
-dnl CLASSPATH_CHECK_THREADS
+dnl Checks for programs.
+if test "${COMPILE_JNI}" = "yes"; then
+  dnl AC_PROG_CXX
+  dnl Initialize libtool
+  AM_DISABLE_STATIC
+  AM_PROG_LIBTOOL
+  dnl AC_PROG_AWK
+  AC_PROG_CC
+  AC_PROG_CPP
+  AC_HEADER_STDC
+  AC_CHECK_HEADERS(unistd.h sys/types.h sys/config.h inttypes.h stdint.h)
+  AC_EGREP_HEADER(uint32_t, stdint.h, AC_DEFINE(HAVE_INT32_DEFINED))
+  AC_EGREP_HEADER(uint32_t, inttypes.h, AC_DEFINE(HAVE_INT32_DEFINED))
+  AC_EGREP_HEADER(u_int32_t, sys/types.h, AC_DEFINE(HAVE_BSD_INT32_DEFINED))
+  AC_EGREP_HEADER(u_int32_t, sys/config.h, AC_DEFINE(HAVE_BSD_INT32_DEFINED))
+  AC_C_CONST
+  AC_CHECK_FUNCS(gethostname socket strerror fork pipe execve strtod atof)
+  AC_HEADER_TIME
+  AC_STRUCT_TM
+  AC_STRUCT_TIMEZONE
+  AC_C_BIGENDIAN
+
+  dnl We want to avoid -O2 at the moment, gcc 2.96 from Red Hat 7
+  dnl cannot compile some native functions (gcc errors) with this
+  dnl flag.
+  CFLAGS="-g" 
+
+  dnl We want warnings, lots of warnings :-)
+  if eval "test x$GCC = xyes"; then
+    JAPHAR_GREP_CFLAGS(-Wall, [ CFLAGS="$CFLAGS -Wall" ])
+  fi
 
-dnl Check for AWT related glib/gtk/libart_lgpl
-AM_PATH_GTK(1.2.4,,exit 1)
-AM_PATH_GLIB(1.2.4,,exit 1,gthread)
-dnl XXX Fix me when libart.m4 has the compile test fixed!
-enable_libarttest=no
-AM_PATH_LIBART(2.1.0,,exit 1)
-
-dnl -----------------------------------------------------------
-dnl Must do automatic checks before specific --with-* overrides
-dnl for vm programs, includes, libraries
-dnl -----------------------------------------------------------
-
-dnl --with-japhar
-CLASSPATH_CHECK_JAPHAR
-
-dnl --with-kaffe
-CLASSPATH_CHECK_KAFFE
+  dnl Check for AWT related glib/gtk/libart_lgpl
+  AM_PATH_GTK(1.2.4,,exit 1)
+  AM_PATH_GLIB(1.2.4,,exit 1,gthread)
 
-dnl -----------------------------------------------------------
+  dnl XXX Fix me when libart.m4 has the compile test fixed!
+  enable_libarttest=no
+  AM_PATH_LIBART(2.1.0,,exit 1)
 
+  CLASSPATH_WITH_JAVAH
 
-dnl -----------------------------------------------------------
-dnl Various overrides are allowed here to contradict defaults 
-dnl from automatic VM checks.
-dnl -----------------------------------------------------------
-
-AC_ARG_WITH(java,
-  [  --with-java		  specify path to a java-like program ],
-  [
-    if test ${withval} != "" || test ${withval} != "yes" || test ${withval} != "no"; then
-      # set javac to user input value
-      AC_MSG_CHECKING(for java)
-      USER_JABBA=${withval}
-      AC_SUBST(USER_JABBA)
-      AC_MSG_RESULT(${withval})
-      conditional_with_java=true
-    fi
-  ],
-  [ conditional_with_java=false])
-
-AM_CONDITIONAL(USER_SPECIFIED_JABBA, test x$conditional_with_java = xtrue)
-
-AC_ARG_WITH(javah,
-  [  --with-javah		  specify path to a javah-like program ],
-  [
-    if test ${withval} != "" || test ${withval} != "yes" || test ${withval} != "no"; then
-      # set javah to user input value
-      AC_MSG_CHECKING(for javah)
-      USER_JAVAH=${withval}
-      AC_SUBST(USER_JAVAH)
-      AC_MSG_RESULT(${withval})
-      conditional_with_javah=true
-    fi
-  ],
-  [ conditional_with_javah=false ])
-AM_CONDITIONAL(USER_SPECIFIED_JAVAH, test x$conditional_with_javah = xtrue)
-
-dnl define JIKES for Makefile.am if --with-jikes specified to configure
-CLASSPATH_CHECK_JIKES
-AM_CONDITIONAL(USER_SPECIFIED_JIKES, test x$conditional_with_jikes = xtrue)
-
-dnl define KJC_CLASSPATH for Makefile.am if --with-kjc specified to configure
-CLASSPATH_CHECK_KJC
-
-AC_ARG_WITH(classlib,
-  [  --with-classlib	  specify path to a classes.zip like file ],
-  [
-    if test ${withval} != "" || test ${withval} != "yes" || test ${withval} != "no"; then
-      # set class library to user input value
-      AM_CONDITIONAL(USER_SPECIFIED_CLASSLIB, test x = y)
-      AC_MSG_CHECKING(for classlib)
-      USER_CLASSLIB=${withval}
-      AC_SUBST(USER_CLASSLIB)
-      AC_MSG_RESULT(${withval})
-      conditional_with_classlib=true
-    fi
-  ],
-  [ conditional_with_classlib=false ])
-AM_CONDITIONAL(USER_SPECIFIED_CLASSLIB, test x$conditional_with_classlib = xtrue)
-
-AC_ARG_WITH(includedir,
-  [  --with-includedir=DIR   specify path to an extra include dir ],
-  [
-    AC_MSG_CHECKING(for includedir)
-    if test ${withval} != "" || test ${withval} != "yes" || test ${withval} != "no"; then
-      if test -r ${withval}; then
-        if test "$EXTRA_INCLUDES" = ""; then
-          EXTRA_INCLUDES="-I${withval}"
-        else
-          EXTRA_INCLUDES="${EXTRA_INCLUDES} -I${withval}"
-        fi
-        AC_SUBST(EXTRA_INCLUDES)
-        AC_MSG_RESULT("added ${withval}")
-      else
-        AC_MSG_RESULT("${withval} does not exist")
-      fi
-    fi
-  ],
-  [
-    if test -z "$EXTRA_INCLUDES"; then
-      EXTRA_INCLUDES=""
-      AC_SUBST(EXTRA_INCLUDES)
-    fi
-  ])
-
-dnl -----------------------------------------------------------
-
-dnl -----------------------------------------------------------
-dnl Initialize maintainer mode, not clear to me yet whether 
-dnl developer-mode is still needed but maintainer-mode definitely 
-dnl is.
-dnl -----------------------------------------------------------
-AM_MAINTAINER_MODE
+  CLASSPATH_WITH_INCLUDEDIR
 
-dnl This build mode indicates to configure it should compile java classes
-dnl but not rebuild the dependency files for doing so.  The default then is to
-dnl not build any Java classes (glibj.zip is distributed in the build using
-dnl the maintainer-mode)
-AC_ARG_ENABLE(developer-mode,
-[  --enable-developer-mode enable some of the rules in maintainer-mode
-                          (compilation of Java classes) [default=no]],
-[case "${enableval}" in 
-  yes) USE_DEVELOPER_MODE=yes ;;
-  no) USE_DEVELOPER_MODE=no ;;
-  *) AC_MSG_ERROR(bad value ${enableval} for --enable-developer-mode) ;;
-esac],
-[USE_DEVELOPER_MODE=no])
-if test x${USE_MAINTAINER_MODE} = "xyes"; then
-  USE_DEVELOPER_MODE=no
 fi
-AM_CONDITIONAL(DEVELOPER_MODE, test x$USE_DEVELOPER_MODE = xyes)
-dnl to mimic MAINT from AM_MAINTAINER_MODE
-DEVEL=$DEVELOPER_MODE_TRUE
-AC_SUBST(DEVEL)
 
-dnl -----------------------------------------------------------
+CLASSPATH_FIND_JAVAC
+
+CLASSPATH_WITH_CLASSLIB
 
 
 dnl -----------------------------------------------------------
+dnl Initialize maintainer mode
+dnl -----------------------------------------------------------
+AM_MAINTAINER_MODE
+
+dnl -----------------------------------------------------------
 dnl Enable debugging statements at compile time.  By default
 dnl these statements should be optimized out of the bytecode
 dnl produced by an optimizing Java compiler and not hinder 
-dnl performance.
+dnl performance because debugging is turns off by default.
 dnl -----------------------------------------------------------
 AC_ARG_ENABLE(debug,
-[  --enable-debug   enable runtime debugging code],
+[  --enable-debug          enable runtime debugging code],
 [case "${enableval}" in 
   yes) 
 	LIBDEBUG="true"
@@ -218,7 +134,6 @@
 esac],
 [LIBDEBUG="false"])
 AC_SUBST(LIBDEBUG)
-
 dnl -----------------------------------------------------------
 
 
@@ -229,64 +144,40 @@
 dnl them.
 dnl -----------------------------------------------------------
 AC_ARG_ENABLE(load-library,
-[  --enable-load-library   [default=yes]],
+[  --enable-load-library   enable to use JNI native methods [default=yes]
+                          (disabled automatically using --enable-cni)],
 [case "${enableval}" in 
   yes) INIT_LOAD_LIBRARY="true" ;;
   no) INIT_LOAD_LIBRARY="false" ;;
   *) AC_MSG_ERROR(bad value ${enableval} for --enable-load-library) ;;
 esac],
-[INIT_LOAD_LIBRARY="true"])
+[
+  if test "$COMPILE_CNI" = "yes"; then
+    INIT_LOAD_LIBRARY="false"
+  else
+    INIT_LOAD_LIBRARY="true"
+  fi
+])
 AC_SUBST(INIT_LOAD_LIBRARY)
-
 dnl -----------------------------------------------------------
 
 
 dnl -----------------------------------------------------------
-dnl This takes care of autodetecting our preferred VM when one 
-dnl isn't specified explicitly.
+dnl Small loop to add other things to EXTRA_INCLUDES from a VM
 dnl -----------------------------------------------------------
-dnl if no jvm yet defined, check for japhar
-dnl if test -z "$JVM" || test "$JVM" = "no"; then
-dnl     # need to have these defined if no vm selected, default to japhar
-dnl     if test -z "$JVM_REFERENCE"; then
-dnl X dnl conditional_with_classlib != xtrue || test x$conditional_with_javah !=  xtrue; then
-dnl X dnl      echo classlib $conditional_with_classlib
-dnl X dnl      echo javah $conditional_with_javah
-dnl       CLASSPATH_INTERNAL_CHECK_JAPHAR
-dnl       AC_MSG_CHECKING(for defined vm)
-dnl       if test -z "$JVM" || test "$JVM" = "no"; then
-dnl         AC_MSG_ERROR(no: try --with-japhar or --with-kaffe)
-dnl       else
-dnl         AC_MSG_RESULT(yes)
-dnl       fi
+dnl for i in $JAPHAR_CFLAGS $KAFFE_CFLAGS ; do
+dnl   add_to_extra_includes=1
+dnl   for j in $EXTRA_INCLUDES ; do
+dnl     if test $i = $j ; then
+dnl       add_to_extra_includes=0
 dnl     fi
-dnl fi
-
-dnl must check our conditionals from vm checks
-AM_CONDITIONAL(JAPHAR, test x$conditional_with_japhar = xtrue)
-AM_CONDITIONAL(KAFFE, test x$conditional_with_kaffe = xtrue)
-dnl can be defined by kaffe check, should be here should we autodetect
-dnl kaffe in the future
-AM_CONDITIONAL(USER_SPECIFIED_KJC, test x$conditional_with_kjc = xtrue)
-
-dnl -----------------------------------------------------------
-
-dnl -----------------------------------------------------------
-dnl Small loop to add other things to EXTRA_INCLUDES from a VM
+dnl   done
+dnl   if test $add_to_extra_includes -eq 1; then
+dnl     EXTRA_INCLUDES="$EXTRA_INCLUDES $i"
+dnl   fi
+dnl done
 dnl -----------------------------------------------------------
-for i in $JAPHAR_CFLAGS $KAFFE_CFLAGS ; do
-  add_to_extra_includes=1
-  for j in $EXTRA_INCLUDES ; do
-    if test $i = $j ; then
-      add_to_extra_includes=0
-    fi
-  done
-  if test $add_to_extra_includes -eq 1; then
-    EXTRA_INCLUDES="$EXTRA_INCLUDES $i"
-  fi
-done
 
-dnl -----------------------------------------------------------
 
 dnl Create a link to the VM specific files we're compiling with
 if test x"$JVM_REFERENCE" = x; then
Index: lib/Makefile.am
===================================================================
RCS file: /cvsroot/classpath/classpath/lib/Makefile.am,v
retrieving revision 1.36
diff -u -r1.36 Makefile.am
--- lib/Makefile.am	2001/06/25 04:43:56	1.36
+++ lib/Makefile.am	2001/10/26 13:42:55
@@ -15,18 +15,19 @@
 sinclude $(JAVA_DEPEND)
 sinclude $(HEADERS_DEPEND)
 
+KJC_CLASSPATH=@KJC_CLASSPATH@
 
+USER_CLASSLIB = @USER_CLASSLIB@
+
+GCJ = @GCJ@
+JIKES = @JIKES@
+USER_JABBA = @USER_JABBA@
+USER_JAVAH = @USER_JAVAH@
+
 #-----------------------------------------------------------------
 # defining a javac program written in java
 #-----------------------------------------------------------------
 KJC_MAIN = at.dms.kjc.Main
-SUN_JAVAC_MAIN = sun.tools.javac.Main
-
-if USER_SPECIFIED_KJC
-JAVAC_MAIN = $(KJC_MAIN)
-else
-JAVAC_MAIN = $(SUN_JAVAC_MAIN)
-endif
 #-----------------------------------------------------------------
 
 
@@ -34,15 +35,7 @@
 # defining how to designate classpath for a vm and a javac type 
 # program
 #-----------------------------------------------------------------
-if JAPHAR
-if USER_SPECIFIED_JABBA
-ARG_CLASSPATH_VM = -classpath
-else
-ARG_CLASSPATH_VM = --classpath
-endif
-else
 ARG_CLASSPATH_VM = -classpath
-endif
 
 if USER_SPECIFIED_KJC
 ARG_CLASSPATH_JAVAC = --classpath
@@ -53,73 +46,20 @@
 
 
 #-----------------------------------------------------------------
-# defining a java-like program
-#-----------------------------------------------------------------
-if USER_SPECIFIED_JABBA
-USER_JABBA = @USER_JABBA@
-else
-
-if JAPHAR
-USER_JABBA = @JAPHAR_JABBA@
-else
-
-if KAFFE
-USER_JABBA = @KAFFE_JABBA@
-else
-USER_JABBA = java
-endif
-
-endif
-
-endif
-#-----------------------------------------------------------------
-
-
-#-----------------------------------------------------------------
-# defining the classpath for the java-like program, and 
-# the javac-like program
-#-----------------------------------------------------------------
-if USER_SPECIFIED_CLASSLIB
-USER_CLASSLIB = @USER_CLASSLIB@
-else
-
-if JAPHAR
-USER_CLASSLIB = @JAPHAR_CLASSLIB@
-else
-
-if KAFFE
-USER_CLASSLIB = @KAFFE_CLASSLIB@
-else
-USER_CLASSLIB = /usr/local/java/lib/classes.zip
-endif
-
-endif
-
-endif
-
-#-----------------------------------------------------------------
-
-
-#-----------------------------------------------------------------
 # handling javac definition including programs like jikes here
 #-----------------------------------------------------------------
-if USER_SPECIFIED_KJC
-JAVAC = $(USER_JABBA) $(ARG_CLASSPATH_VM) @KJC_CLASSPATH@:$(USER_CLASSLIB) $(JAVAC_MAIN) $(ARG_CLASSPATH_JAVAC) .:$(USER_CLASSLIB) -d . @classes
+if FOUND_JIKES
+JAVAC = $(JIKES) -nowarn +F $(ARG_CLASSPATH_JAVAC) $(top_srcdir):$(top_builddir)/vm/current:.:$(USER_CLASSLIB) -d . @classes
 else
-
-if USER_SPECIFIED_JIKES
-
-if USER_SPECIFIED_CLASSLIB
-JAVAC = @JIKES@ -nowarn +F $(ARG_CLASSPATH_JAVAC) $(top_srcdir):$(top_builddir)/vm/current:.:@USER_CLASSLIB@ -d . @classes
+if FOUND_GCJ
+JAVAC = $(GCJ) -C $(ARG_CLASSPATH_JAVAC) $(top_srcdir):$(top_builddir)/vm/current:.:$(USER_CLASSLIB) -d . $(JAVA_SRCS)
 else
-JAVAC = @JIKES@ -nowarn +F $(ARG_CLASSPATH_JAVAC) $(top_srcdir):$(top_builddir)/vm/current:. -d . @classes
+if FOUND_KJC
+JAVAC = $(USER_JABBA) $(ARG_CLASSPATH_VM) $(KJC_CLASSPATH):$(USER_CLASSLIB) $(KJC_MAIN) $(ARG_CLASSPATH_JAVAC) .:$(USER_CLASSLIB) -d . @classes
+endif 
 endif
-
-else
-JAVAC = $(USER_JABBA) $(ARG_CLASSPATH_VM) $(USER_CLASSLIB) $(JAVAC_MAIN) $(ARG_CLASSPATH_JAVAC) .:$(USER_CLASSLIB) -d . $(JAVA_SRCS)
 endif
 
-endif
 #-----------------------------------------------------------------
 
 
@@ -127,57 +67,14 @@
 # defining how to designate classpath for a vm and a javac type 
 # program
 #-----------------------------------------------------------------
-if JAPHAR
-
-if USER_SPECIFIED_JAVAH
 ARG_JNI_JAVAH = -jni
-else
-ARG_JNI_JAVAH = --jni
-endif
-
-else
-ARG_JNI_JAVAH = -jni
-endif
 #-----------------------------------------------------------------
 
 
 #-----------------------------------------------------------------
-# defining a javah-like program
-#-----------------------------------------------------------------
-if USER_SPECIFIED_JAVAH
-USER_JAVAH = @USER_JAVAH@
-else
-
-if JAPHAR
-USER_JAVAH = @JAPHAR_JAVAH@
-else
-
-if KAFFE
-USER_JAVAH = @KAFFE_JAVAH@
-else
-USER_JAVAH = javah
-endif
-
-endif
-
-endif
-#-----------------------------------------------------------------
-
-
-#-----------------------------------------------------------------
 # defining classpath arg for javah-like program
 #-----------------------------------------------------------------
-if JAPHAR
-
-if USER_SPECIFIED_JAVAH
-ARG_CLASSPATH_JAVAH = -classpath
-else
-ARG_CLASSPATH_JAVAH = --classpath
-endif
-
-else
 ARG_CLASSPATH_JAVAH = -classpath
-endif
 #-----------------------------------------------------------------
 
 JAVAH = $(USER_JAVAH) $(ARG_JNI_JAVAH) $(ARG_CLASSPATH_JAVAH) .:$(USER_CLASSLIB)
@@ -188,7 +85,12 @@
 	if ! [ -e $(pkgdatadir) ]; then mkdir -p $(pkgdatadir); fi
 	unzip -d $(pkgdatadir) glibj.zip
 
+if CREATE_JNI_HEADERS
 all: $(HEADERS_DEPEND) glibj.zip $(CP_HEADERS)
+else
+all: glibj.zip
+endif
+
 #jar-classes
 
 # this makes headers always generate after making glibj.zip
@@ -201,10 +103,9 @@
 	if ! [ -e gnu/java/locale ]; then mkdir gnu/java/locale; fi
 	cp $(top_srcdir)/gnu/java/locale/*.properties gnu/java/locale/
 	cp $(top_srcdir)/gnu/java/locale/*.uni gnu/java/locale/
-	# do something with all the .u files from jikes
 	$(ZIP) -r -D glibj.zip gnu java javax > /dev/null
 
-classes: gen-classlist.sh standard.omit $(top_srcdir)/java $(top_srcdir)/javax $(top_srcdir)/gnu
+classes: gen-classlist.sh standard.omit
 	top_builddir=$(top_builddir) $(SHELL) ./gen-classlist.sh standard
 
 .PHONY: dep
@@ -218,7 +119,7 @@
 
 $(MAKEFILE_DEPEND): compile-classes
 	top_srcdir=@top_srcdir@ $(PERL) ./mkdep.pl -d
-	$(SHELL) -c find -regex ".*\.u$$" -exec rm \{\} \; > /dev/null
+#	$(SHELL) -c find -regex ".*\.u$$" -exec rm \{\} \; > /dev/null
 
 $(HEADERS_DEPEND): classes
 	if ! [ -e $(top_builddir)/include ]; then -mkdir $(top_builddir)/include; fi	
@@ -267,6 +168,7 @@
 MAINTAINERCLEANFILES = makefile.dep $(JAVA_DEPEND) $(HEADERS_DEPEND)
 
 maintainer-clean-local:
+	-rm -rf com
 	-rm -rf gnu
 	-rm -rf java
 	-rm -rf javax
Index: lib/gen-classlist.sh.in
===================================================================
RCS file: /cvsroot/classpath/classpath/lib/gen-classlist.sh.in,v
retrieving revision 1.7
diff -u -r1.7 gen-classlist.sh.in
--- lib/gen-classlist.sh.in	2001/10/19 17:49:52	1.7
+++ lib/gen-classlist.sh.in	2001/10/26 13:42:55
@@ -1,4 +1,4 @@
 #! @SH@
 # @configure_input@
-@FIND@ @top_srcdir@/java @top_srcdir@/javax @top_srcdir@/gnu ${top_builddir}/java ${top_builddir}/javax ${top_builddir}/gnu ${top_builddir}/vm/current -follow -type f -print | grep '\.java$' > ${top_builddir}/lib/classes
+@FIND@ @top_srcdir@/com @top_srcdir@/java @top_srcdir@/javax @top_srcdir@/gnu ${top_builddir}/java ${top_builddir}/javax ${top_builddir}/gnu ${top_builddir}/vm/current -follow -type f -print | grep '\.java$' > ${top_builddir}/lib/classes
 for filexp in `cat @top_srcdir@/lib/$1.omit` ; do { grep -v ${filexp} < ${top_builddir}/lib/classes > ${top_builddir}/lib/classes.new ; mv ${top_builddir}/lib/classes.new ${top_builddir}/lib/classes ; } ; done
Index: native/Makefile.am
===================================================================
RCS file: /cvsroot/classpath/classpath/native/Makefile.am,v
retrieving revision 1.17
diff -u -r1.17 Makefile.am
--- native/Makefile.am	2001/01/23 23:57:45	1.17
+++ native/Makefile.am	2001/10/26 13:42:55
@@ -1,5 +1,13 @@
 ## Input file for automake to generate the Makefile.in used by configure
 
+if CREATE_JNI_LIBRARIES
 SUBDIRS = jni lib vmi
-##java.lang java.net java.io java.lang.reflect java.util lib vmi gnu.java.awt.peer.gtk
+else
+if CREATE_CNI_LIBRARIES
+SUBDIRS = cni
+else
+SUBDIRS =
+endif
+endif
+
 
Index: native/jni/Makefile.am
===================================================================
RCS file: /cvsroot/classpath/classpath/native/jni/Makefile.am,v
retrieving revision 1.2
diff -u -r1.2 Makefile.am
--- native/jni/Makefile.am	2001/06/25 04:43:56	1.2
+++ native/jni/Makefile.am	2001/10/26 13:42:55
@@ -61,15 +61,5 @@
              -I$(top_srcdir)/native/lib/ \
 	     -I$(top_builddir)/include 
 
-if JAPHAR
-install-data-local : 
-	-cd $(pkglibdir) && ln -s libjavaio.so libjaphar_javaio.so
-	-cd $(pkglibdir) && ln -s libjavalang.so libjaphar_javalang.so
-	-cd $(pkglibdir) && ln -s libjavalangmath.so libjaphar_javalangmath.so
-	-cd $(pkglibdir) && ln -s libjavalangreflect.so libjaphar_javalangreflect.so
-	-cd $(pkglibdir) && ln -s libjavanet.so libjaphar_javanet.so
-	-cd $(pkglibdir) && ln -s libjavautil.so libjaphar_javautil.so
-endif
-
 clean-local:
 	-rm -rf .deps
Index: native/jni/awt/Makefile.am
===================================================================
RCS file: /cvsroot/classpath/classpath/native/jni/awt/Makefile.am,v
retrieving revision 1.2
diff -u -r1.2 Makefile.am
--- native/jni/awt/Makefile.am	2001/06/25 04:43:56	1.2
+++ native/jni/awt/Makefile.am	2001/10/26 13:42:55
@@ -41,11 +41,6 @@
 	    @LIBART_CFLAGS@ \
 	    -I$(top_builddir)/include
 
-if JAPHAR
-install-data-local : 
-	-cd $(pkglibdir) && ln -s libgtkpeer.so libjaphar_gtkpeer.so
-endif
-
 clean-local:
 	-rm -rf .deps
 
Index: native/lib/Makefile.am
===================================================================
RCS file: /cvsroot/classpath/classpath/native/lib/Makefile.am,v
retrieving revision 1.11
diff -u -r1.11 Makefile.am
--- native/lib/Makefile.am	2000/07/01 16:10:31	1.11
+++ native/lib/Makefile.am	2001/10/26 13:42:56
@@ -7,11 +7,6 @@
 INCLUDES += -I../lib -I../nsa -I../vmi -I. -DNO_VMI @EXTRA_INCLUDES@ \
 	    -I$(top_srcdir)/include
 
-if JAPHAR
-install-data-local : 
-	-cd $(pkglibdir) && ln -s libclasspath.so libjaphar_classpath.so
-endif
-
 clean-local:
 	-rm -rf .deps
 
Index: vm/Makefile.am
===================================================================
RCS file: /cvsroot/classpath/classpath/vm/Makefile.am,v
retrieving revision 1.3
diff -u -r1.3 Makefile.am
--- vm/Makefile.am	1999/12/30 15:36:08	1.3
+++ vm/Makefile.am	2001/10/26 13:42:56
@@ -1,15 +1,4 @@
 # used by automake to generate Makefile.in
 
-if JAPHAR
 
 SUBDIRS = reference
-
-else
-
-if KAFFE
-SUBDIRS = kaffe
-else
-SUBDIRS = reference
-endif
-
-endif
