This patch adds support to configure for testing javac
for 1.5 compatability and support for -J.

Changelog:

2007-10-12  Andrew John Hughes  <[EMAIL PROTECTED]>

        PR classpath/33622:
        * lib/Makefile.am: Use JAVAC_ARGS variable.
        * m4/acinclude.m4: Check javac is 1.5 compliant
        and whether it supports -J.

-- 
Andrew :-)

Escape the Java Trap with GNU Classpath!
http://www.gnu.org/philosophy/java-trap.html
public class gcj extends Freedom implements Java { ... }
Index: lib/Makefile.am
===================================================================
RCS file: /cvsroot/classpath/classpath/lib/Makefile.am,v
retrieving revision 1.137
diff -u -3 -p -u -r1.137 Makefile.am
--- lib/Makefile.am	12 Oct 2007 14:20:20 -0000	1.137
+++ lib/Makefile.am	12 Oct 2007 21:27:15 -0000
@@ -12,7 +12,7 @@ if FOUND_ECJ
 JCOMPILER = $(ECJ) -1.5 -warn:-deprecation,serial,typeHiding,unchecked,unused,varargsCast -proceedOnError -bootclasspath '' -classpath $(compile_classpath) -d . @classes
 else
 if FOUND_JAVAC
-JCOMPILER = $(JAVAC) -J-Xmx512M -bootclasspath '' -classpath $(compile_classpath) -d . @classes
+JCOMPILER = $(JAVAC) $(JAVAC_OPTS) -bootclasspath '' -classpath $(compile_classpath) -d . @classes
 #else
 #if FOUND_GCJ
 ## This should never be used when gcj is the compiler.
Index: m4/acinclude.m4
===================================================================
RCS file: /cvsroot/classpath/classpath/m4/acinclude.m4,v
retrieving revision 1.21
diff -u -3 -p -u -r1.21 acinclude.m4
--- m4/acinclude.m4	12 Oct 2007 07:56:12 -0000	1.21
+++ m4/acinclude.m4	12 Oct 2007 21:27:15 -0000
@@ -444,6 +444,7 @@ AC_DEFUN([CLASSPATH_WITH_JAVAC],
     CLASSPATH_CHECK_JAVAC
   ])
   AC_SUBST(JAVAC)
+  AC_SUBST(JAVAC_OPTS)
 ])
 
 dnl -----------------------------------------------------------
@@ -454,4 +455,28 @@ AC_DEFUN([CLASSPATH_CHECK_JAVAC],
   else
     AC_PATH_PROG(JAVAC, "javac")
   fi
+  dnl Test the given javac
+  AC_MSG_CHECKING([if javac is 1.5-capable])
+  cat > conftest.java << EOF
+public class conftest {
+public static void main(String[] args) {
+java.util.List<String> l;
+}}
+EOF
+  $JAVAC conftest.java 
+  javac_result=$?
+  if test "x$javac_result" = "x0"; then
+    AC_MSG_RESULT([yes])
+  else
+    AC_MSG_WARN([1.5 capable javac required])
+  fi
+  AC_MSG_CHECKING([whether javac supports -J])
+  $JAVAC -J-Xmx512M conftest.java
+  javac_result=$?
+  if test "x$javac_result" = "x0"; then
+    AC_MSG_RESULT([yes])
+    JAVAC_OPTS="-J-Xmx512M"
+  else
+    AC_MSG_RESULT([javac doesn't support -J])
+  fi
 ])

Attachment: signature.asc
Description: Digital signature

Reply via email to