Index: acinclude.m4 =================================================================== RCS file: /cvsroot/classpath/classpath/acinclude.m4,v retrieving revision 1.42.2.2 diff -u -3 -p -u -r1.42.2.2 acinclude.m4 --- acinclude.m4 16 Jan 2005 15:14:52 -0000 1.42.2.2 +++ acinclude.m4 31 Jan 2005 17:52:28 -0000 @@ -9,13 +9,16 @@ AC_DEFUN([CLASSPATH_FIND_JAVAC], CLASSPATH_WITH_JIKES CLASSPATH_WITH_KJC CLASSPATH_WITH_GCJX + CLASSPATH_WITH_ECJ if test "x${user_specified_javac}" = x; then AM_CONDITIONAL(FOUND_GCJ, test "x${GCJ}" != x) AM_CONDITIONAL(FOUND_JIKES, test "x${JIKES}" != x) + AM_CONDITIONAL(FOUND_ECJ, test "x${ECJ}" != x) else AM_CONDITIONAL(FOUND_GCJ, test "x${user_specified_javac}" = xgcj) AM_CONDITIONAL(FOUND_JIKES, test "x${user_specified_javac}" = xjikes) + AM_CONDITIONAL(FOUND_ECJ, test "x${user_specified_javac}" = xecj) fi AM_CONDITIONAL(FOUND_KJC, test "x${user_specified_javac}" = xkjc) AM_CONDITIONAL(FOUND_GCJX, test "x${user_specified_javac}" = xgcjx) @@ -404,3 +407,38 @@ AC_DEFUN([REGEN_WITH_JAY], ]) AM_CONDITIONAL(REGEN_PARSERS, test "x${JAY_FOUND}" = xyes) ]) + +dnl ----------------------------------------------------------- +AC_DEFUN([CLASSPATH_WITH_ECJ], +[ + AC_ARG_WITH([ecj], + [AS_HELP_STRING(--with-ecj,bytecode compilation with ecj)], + [ + if test "x${withval}" != x && test "x${withval}" != xyes && test "x${withval}" != xno; then + CLASSPATH_CHECK_ECJ(${withval}) + else + if test "x${withval}" != xno; then + CLASSPATH_CHECK_ECJ + fi + fi + user_specified_javac=ecj + ], + [ + CLASSPATH_CHECK_ECJ + ]) + AC_SUBST(ECJ) +]) + +dnl ----------------------------------------------------------- +AC_DEFUN([CLASSPATH_CHECK_ECJ], +[ + if test "x$1" != x; then + if test -f "$1"; then + ECJ="$1" + else + AC_PATH_PROG(ECJ, "$1") + fi + else + AC_PATH_PROG(ECJ, "ecj") + fi +]) Index: examples/Makefile.am =================================================================== RCS file: /cvsroot/classpath/classpath/examples/Makefile.am,v retrieving revision 1.1.2.1 diff -u -3 -p -u -r1.1.2.1 Makefile.am --- examples/Makefile.am 16 Jan 2005 15:14:53 -0000 1.1.2.1 +++ examples/Makefile.am 31 Jan 2005 17:52:28 -0000 @@ -1,6 +1,9 @@ ## Input file for automake to generate the Makefile.in used by configure # Setup the compiler to use the GNU Classpath library we just build +if FOUND_ECJ +JCOMPILER = $(ECJ) -1.5 --bootclasspath '$(top_builddir)/lib' --classpath . +else if FOUND_GCJ JCOMPILER = $(GCJ) --bootclasspath '$(top_builddir)/lib' --classpath . -C else @@ -14,6 +17,7 @@ error dunno how to setup the JCOMPILER a endif endif endif +endif # All our example java source files EXAMPLE_JAVA_FILES = $(srcdir)/gnu/classpath/examples/*/*.java Index: lib/Makefile.am =================================================================== RCS file: /cvsroot/classpath/classpath/lib/Makefile.am,v retrieving revision 1.63.2.5 diff -u -3 -p -u -r1.63.2.5 Makefile.am --- lib/Makefile.am 16 Jan 2005 15:15:14 -0000 1.63.2.5 +++ lib/Makefile.am 31 Jan 2005 17:52:29 -0000 @@ -11,6 +11,9 @@ propertyfiles := $(shell cd $(top_srcdi compile_classpath = $(top_srcdir):$(top_srcdir)/vm/reference:$(top_srcdir)/external/w3c_dom:$(top_srcdir)/external/sax:.:$(USER_CLASSLIB) # handling source to bytecode compiler programs like gcj, jikes and kjc +if FOUND_ECJ +JAVAC = $(ECJ) -1.5 -warn:-deprecation,serial -proceedOnError -bootclasspath '' -classpath $(compile_classpath) -d . @classes +else if FOUND_GCJ JAVAC = $(GCJ) --bootclasspath '' --classpath $(compile_classpath) -C -d . @classes.standard \ && $(GCJ) -Wno-deprecated --bootclasspath '' --classpath $(compile_classpath) -C -d . @classes.awt \ @@ -30,6 +33,7 @@ endif # FOUND_GCJX endif # FOUND_KJC endif # FOUND_GCJ endif # FOUND_JIKES +endif # FOUND_ECJ JAVAH = $(USER_JAVAH) -jni -classpath .:$(USER_CLASSLIB)