summaryrefslogtreecommitdiff
path: root/m4/ac_prog_javac_works.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/ac_prog_javac_works.m4')
-rw-r--r--m4/ac_prog_javac_works.m440
1 files changed, 40 insertions, 0 deletions
diff --git a/m4/ac_prog_javac_works.m4 b/m4/ac_prog_javac_works.m4
new file mode 100644
index 000000000..757718e3f
--- /dev/null
+++ b/m4/ac_prog_javac_works.m4
@@ -0,0 +1,40 @@
+dnl @synopsis AC_PROG_JAVAC_WORKS
+dnl
+dnl Internal use ONLY.
+dnl
+dnl Note: This is part of the set of autoconf M4 macros for Java
+dnl programs. It is VERY IMPORTANT that you download the whole set,
+dnl some macros depend on other. Unfortunately, the autoconf archive
+dnl does not support the concept of set of macros, so I had to break it
+dnl for submission. The general documentation, as well as the sample
+dnl configure.in, is included in the AC_PROG_JAVA macro.
+dnl
+dnl @category Java
+dnl @author Stephane Bortzmeyer <bortzmeyer@pasteur.fr>
+dnl @version 2000-07-19
+dnl @license GPLWithACException
+dnl
+dnl Modified to test for 1.5 by Andrew John Hughes on 2008-02-11
+
+AC_DEFUN([AC_PROG_JAVAC_WORKS],[
+AC_CACHE_CHECK([if $JAVAC works], ac_cv_prog_javac_works, [
+JAVA_TEST=Colour.java
+CLASS_TEST=Colour.class
+cat << \EOF > $JAVA_TEST
+/* [#]line __oline__ "configure" */
+public enum Colour
+{
+RED, ORANGE, YELLOW, GREEN, BLUE, INDIGO, VIOLET;
+}
+EOF
+if AC_TRY_COMMAND($JAVAC $JAVACFLAGS -source 1.5 -target 1.5 $JAVA_TEST) >/dev/null 2>&1; then
+ ac_cv_prog_javac_works=yes
+else
+ AC_MSG_ERROR([The Java compiler $JAVAC failed (see config.log, check the CLASSPATH?)])
+ echo "configure: failed program was:" >&AC_FD_CC
+ cat $JAVA_TEST >&AC_FD_CC
+fi
+rm -f $JAVA_TEST $CLASS_TEST
+])
+AC_PROVIDE([$0])dnl
+])