[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cp-patches] [generics] Add ecj option to build
From: |
Andrew John Hughes |
Subject: |
Re: [cp-patches] [generics] Add ecj option to build |
Date: |
Mon, 07 Feb 2005 02:32:02 +0000 |
On Sun, 2005-02-06 at 14:57 +0100, Mark Wielaard wrote:
> Hi,
>
> On Mon, 2005-01-31 at 18:02 +0000, Andrew John Hughes wrote:
> > I'm committing the attached patch to the generics branch,
> > which adds an option to build with ecj. Currently, the only
> > options (that I know of) for building the branch are ecj or
> > the proprietary javac, so this saves me some Makefile jiggery-pokery
> > at least.
>
> I think this would be nice to have on the trunk also.
> Tom Tromey said a while ago he had some cleanups to the compiler
> selection code. But I don't think he ever committed those.
>
> Cheers,
>
> Mark
I'm committing the attached patch (adapted from the generics one) to add
this functionality to HEAD.
Changelog:
2005-02-07 Andrew John Hughes <address@hidden>
* acinclude.m4:
(CLASSPATH_FIND_JAVAC): Add ECJ option.
(CLASSPATH_WITH_ECJ): New function.
(CLASSPATH_CHECK_ECJ): New function.
* examples/Makefile.am:
Allow examples to be built with ecj.
* lib/Makefile.am:
Allow Classpath to be built with ecj.
Cheers,
--
Andrew :-)
Please avoid sending me Microsoft Office (e.g. Word, PowerPoint)
attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html
No software patents in Europe -- http://nosoftwarepatents.com
"Value your freedom, or you will lose it, teaches history.
`Don't bother us with politics' respond those who don't want to learn."
-- Richard Stallman
"We've all been part of the biggest beta test the world has ever known
--
Windows"
-- Victor Wheatman, Gartner
Index: acinclude.m4
===================================================================
RCS file: /cvsroot/classpath/classpath/acinclude.m4,v
retrieving revision 1.48
diff -u -3 -p -u -r1.48 acinclude.m4
--- acinclude.m4 11 Jan 2005 23:21:42 -0000 1.48
+++ acinclude.m4 7 Feb 2005 02:27:14 -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.2
diff -u -3 -p -u -r1.2 Makefile.am
--- examples/Makefile.am 25 Dec 2004 23:10:06 -0000 1.2
+++ examples/Makefile.am 7 Feb 2005 02:27:14 -0000
@@ -10,10 +10,14 @@ else
if FOUND_GCJX
JCOMPILER = $(GCJX) -bootclasspath '' -sourcepath '' -classpath
$(top_builddir)/lib:.
else
+if FOUND_ECJ
+JCOMPILER = $(ECJ) --bootclasspath '$(top_builddir)/lib' --classpath .
+else
error dunno how to setup the JCOMPILER and compile
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.78
diff -u -3 -p -u -r1.78 Makefile.am
--- lib/Makefile.am 5 Jan 2005 23:01:03 -0000 1.78
+++ lib/Makefile.am 7 Feb 2005 02:27:15 -0000
@@ -26,6 +26,10 @@ JAVAC = $(KJC) -classpath .:$(USER_CLASS
else
if FOUND_GCJX
JAVAC = $(GCJX) -classpath .:$(USER_CLASSLIB) -d . @classes
+else
+if FOUND_ECJ
+JAVAC = $(ECJ) -warn:-deprecation,serial -proceedOnError -bootclasspath ''
-classpath $(compile_classpath) -d . @classes
+endif # FOUND_ECJ
endif # FOUND_GCJX
endif # FOUND_KJC
endif # FOUND_GCJ
signature.asc
Description: This is a digitally signed message part