source: gs2-extensions/tdb/trunk/src/jni/m4/ac_prog_java_works.m4@ 30206

Last change on this file since 30206 was 30206, checked in by jmt12, 5 years ago

A m4 directory containing a number of M4 packages used to compile this project. Running aclocal will cause the other (default) M4 packages to be linked into here too (so there is a .svnignore to ignore them)

File size: 3.1 KB
Line 
1dnl @synopsis AC_PROG_JAVA_WORKS
2dnl
3dnl Internal use ONLY.
4dnl
5dnl Note: This is part of the set of autoconf M4 macros for Java
6dnl programs. It is VERY IMPORTANT that you download the whole set,
7dnl some macros depend on other. Unfortunately, the autoconf archive
8dnl does not support the concept of set of macros, so I had to break it
9dnl for submission. The general documentation, as well as the sample
10dnl configure.in, is included in the AC_PROG_JAVA macro.
11dnl
12dnl @category Java
13dnl @author Stephane Bortzmeyer <bortzmeyer@pasteur.fr>
14dnl @version 2000-07-19
15dnl @license GPLWithACException
16
17AC_DEFUN([AC_PROG_JAVA_WORKS], [
18AC_CHECK_PROG(uudecode, uudecode$EXEEXT, yes)
19if test x$uudecode = xyes; then
20AC_CACHE_CHECK([if uudecode can decode base 64 file], ac_cv_prog_uudecode_base64, [
21dnl /**
22dnl * Test.java: used to test if java compiler works.
23dnl */
24dnl public class Test
25dnl {
26dnl
27dnl public static void
28dnl main( String[] argv )
29dnl {
30dnl System.exit (0);
31dnl }
32dnl
33dnl }
34cat << \EOF > Test.uue
35begin-base64 644 Test.class
36yv66vgADAC0AFQcAAgEABFRlc3QHAAQBABBqYXZhL2xhbmcvT2JqZWN0AQAE
37bWFpbgEAFihbTGphdmEvbGFuZy9TdHJpbmc7KVYBAARDb2RlAQAPTGluZU51
38bWJlclRhYmxlDAAKAAsBAARleGl0AQAEKEkpVgoADQAJBwAOAQAQamF2YS9s
39YW5nL1N5c3RlbQEABjxpbml0PgEAAygpVgwADwAQCgADABEBAApTb3VyY2VG
40aWxlAQAJVGVzdC5qYXZhACEAAQADAAAAAAACAAkABQAGAAEABwAAACEAAQAB
41AAAABQO4AAyxAAAAAQAIAAAACgACAAAACgAEAAsAAQAPABAAAQAHAAAAIQAB
42AAEAAAAFKrcAErEAAAABAAgAAAAKAAIAAAAEAAQABAABABMAAAACABQ=
43====
44EOF
45if uudecode$EXEEXT Test.uue; then
46 ac_cv_prog_uudecode_base64=yes
47else
48 echo "configure: __oline__: uudecode had trouble decoding base 64 file 'Test.uue'" >&AC_FD_CC
49 echo "configure: failed file was:" >&AC_FD_CC
50 cat Test.uue >&AC_FD_CC
51 ac_cv_prog_uudecode_base64=no
52fi
53rm -f Test.uue])
54fi
55if test x$ac_cv_prog_uudecode_base64 != xyes; then
56 rm -f Test.class
57 AC_MSG_WARN([I have to compile Test.class from scratch])
58 if test x$ac_cv_prog_javac_works = xno; then
59 AC_MSG_ERROR([Cannot compile java source. $JAVAC does not work properly])
60 fi
61 if test x$ac_cv_prog_javac_works = x; then
62 AC_PROG_JAVAC
63 fi
64fi
65AC_CACHE_CHECK(if $JAVA works, ac_cv_prog_java_works, [
66JAVA_TEST=Test.java
67CLASS_TEST=Test.class
68TEST=Test
69changequote(, )dnl
70cat << \EOF > $JAVA_TEST
71/* [#]line __oline__ "configure" */
72public class Test {
73public static void main (String args[]) {
74 System.exit (0);
75} }
76EOF
77changequote([, ])dnl
78if test x$ac_cv_prog_uudecode_base64 != xyes; then
79 if AC_TRY_COMMAND($JAVAC $JAVACFLAGS $JAVA_TEST) && test -s $CLASS_TEST; then
80 :
81 else
82 echo "configure: failed program was:" >&AC_FD_CC
83 cat $JAVA_TEST >&AC_FD_CC
84 AC_MSG_ERROR(The Java compiler $JAVAC failed (see config.log, check the CLASSPATH?))
85 fi
86fi
87if AC_TRY_COMMAND($JAVA $JAVAFLAGS $TEST) >/dev/null 2>&1; then
88 ac_cv_prog_java_works=yes
89else
90 echo "configure: failed program was:" >&AC_FD_CC
91 cat $JAVA_TEST >&AC_FD_CC
92 AC_MSG_ERROR(The Java VM $JAVA failed (see config.log, check the CLASSPATH?))
93fi
94rm -fr $JAVA_TEST $CLASS_TEST Test.uue
95])
96AC_PROVIDE([$0])dnl
97]
98)
Note: See TracBrowser for help on using the repository browser.