This updates the cp-tools javac check using the additional
compilers in GNU Classpath's version. It also makes it so
this check is only performed if a non-native build is taking
place.
ChangeLog:
2008-06-29 Andrew John Hughes <[EMAIL PROTECTED]>
* configure.ac:
Only check for JAVAC if a native build
is not used.
* m4/ac_prog_javac.m4:
Updated with additional compilers from Classpath.
--
Andrew :)
Support Free Java!
Contribute to GNU Classpath and the OpenJDK
http://www.gnu.org/software/classpath
http://openjdk.java.net
PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint = F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8
Index: configure.ac
===================================================================
RCS file: /sources/classpath/cp-tools/configure.ac,v
retrieving revision 1.7
diff -u -u -r1.7 configure.ac
--- configure.ac 29 Jun 2008 01:07:01 -0000 1.7
+++ configure.ac 29 Jun 2008 17:06:09 -0000
@@ -4,18 +4,45 @@
AM_INIT_AUTOMAKE
AC_DISABLE_STATIC
-
AM_PROG_GCJ
AC_PROG_LIBTOOL
+
+dnl
+dnl Compile natively with gcj?
+dnl
+AC_ARG_ENABLE([native],
+ [AS_HELP_STRING(--disable-native, disable generation of native binaries
[[default=no]])],
+ [
+ if test "x${enableval}" = xno; then
+ enable_gcj=no
+ else
+ enable_gcj=yes
+ fi
+ ],
+ [
+ enable_gcj=yes
+ ]
+)
+if test "x${enable_gcj}" = xyes; then
+ if test "x${GCJ}" = xfalse; then
+ enable_gcj=no
+ echo "Native compilation disabled because gcj not found"
+ fi
+fi
+
+if test "x${enable_gcj}" = xno; then
+ AC_PROG_JAVAC
+fi
+
+AM_CONDITIONAL(ENABLE_GCJ_BINARY, test "x${enable_gcj}" = xyes)
+
+AC_PROG_JAVA
AC_PROG_JAR
AC_CHECK_CLASSPATH
-AC_PROG_JAVA
-AC_PROG_JAVAC
dnl Check if required jars are in $prefix/share/java and prepend it to the
dnl CLASSPATH.
-
if test -z $CLASSPATH
then
export CLASSPATH=.
@@ -38,28 +65,6 @@
fi
dnl
-dnl Compile natively with gcj?
-dnl
-AC_ARG_ENABLE([native],
- [AS_HELP_STRING(--disable-native, disable generation of native binaries
[[default=no]])],
- [
- if test "x${enableval}" = xno; then
- enable_gcj=no
- else
- enable_gcj=yes
- fi
- ],
- [
- enable_gcj=yes
- ]
-)
-if test "x${GCJ}" = xfalse; then
- enable_gcj=no
- echo "Native compilation disabled because gcj not found"
-fi
-AM_CONDITIONAL(ENABLE_GCJ_BINARY, test "x${enable_gcj}" = xyes)
-
-dnl
dnl GNU bytecode library
dnl
AC_ARG_WITH([gnu-bytecode],
Index: m4/ac_prog_javac.m4
===================================================================
RCS file: /sources/classpath/cp-tools/m4/ac_prog_javac.m4,v
retrieving revision 1.1
diff -u -u -r1.1 ac_prog_javac.m4
--- m4/ac_prog_javac.m4 17 Feb 2005 03:31:37 -0000 1.1
+++ m4/ac_prog_javac.m4 29 Jun 2008 17:06:09 -0000
@@ -3,10 +3,12 @@
dnl
AC_DEFUN([AC_PROG_JAVAC],[
AC_REQUIRE([AC_EXEEXT])dnl
+ECJ_OPTS="-1.5 -warn:-deprecation,serial,unusedImport,unchecked,raw"
+JAVAC_OPTS="-Xlint:cast,divzero,empty,finally,overrides"
if test "x$JAVAPREFIX" = x; then
- test "x$JAVAC" = x && AC_CHECK_PROGS(JAVAC, "gcj$EXEEXT -C"
jikes$EXEEXT ejc$EXEEXT guavac$EXEEXT javac$EXEEXT)
+ test "x$JAVAC" = x && AC_CHECK_PROGS(JAVAC, jikes$EXEEXT ["ecj$EXEEXT
$ECJ_OPTS"] ["ecj-3.3$EXEEXT $ECJ_OPTS"] ["ecj-3.2$EXEEXT $ECJ_OPTS"]
["javac$EXEEXT $JAVAC_OPTS"] "gcj$EXEEXT -C")
else
- test "x$JAVAC" = x && AC_CHECK_PROGS(JAVAC, "gcj$EXEEXT -C"
jikes$EXEEXT ejc$EXEEXT guavac$EXEEXT javac$EXEEXT, $JAVAPREFIX)
+ test "x$JAVAC" = x && AC_CHECK_PROGS(JAVAC, jikes$EXEEXT ["ecj$EXEEXT
$ECJ_OPTS"] ["ecj-3.3$EXEEXT $ECJ_OPTS"] ["ecj-3.2$EXEEXT $ECJ_OPTS"]
["javac$EXEEXT $JAVAC_OPTS"] "gcj$EXEEXT -C", $JAVAPREFIX)
fi
test "x$JAVAC" = x && AC_MSG_ERROR([no acceptable Java compiler found in
\$PATH])
AC_PROG_JAVAC_WORKS