diff options
author | Andrew John Hughes <[email protected]> | 2010-11-03 23:06:23 +0000 |
---|---|---|
committer | Andrew John Hughes <[email protected]> | 2010-11-03 23:06:23 +0000 |
commit | b4a175cdf642bb058b183dcf66f264aa85630354 (patch) | |
tree | da02d9993acc964dd9ee1aceec8c8a807dcc9de9 /acinclude.m4 | |
parent | 906dabe74dac87a2495fdede424a40035bfaba66 (diff) |
Check for required proprietary Sun classes during configure.
2010-10-28 Andrew John Hughes <[email protected]>
* Makefile.am:
(NETX_BOOTSTRAP_CLASSES): Removed.
(PLUGIN_BOOTSTRAP_CLASSES): Likewise.
(NETX_SUN_CLASSES): Likewise.
(PLUGIN_SUN_CLASSES): Likewise.
* acinclude.m4:
(IT_CHECK_FOR_CLASS): Require detection
of javac and java. Put test class in
sun.applet to get access to some internal
classes. Change test to use forName for
the same reason. I expect to be able to
revert this when usage of sun.applet is fixed.
(IT_FIND_JAVA): Ported from IcedTea6. Change
to prioritise 'java' over 'gij'.
* configure.ac:
Add IT_CHECK_FOR_CLASS checks for classes which
are required but not found in JDKs other than
Oracle-based ones. Also check for java.* classes
missing from current versions of gcj but which
may appear there in future.
Diffstat (limited to 'acinclude.m4')
-rw-r--r-- | acinclude.m4 | 46 |
1 files changed, 41 insertions, 5 deletions
diff --git a/acinclude.m4 b/acinclude.m4 index d4ad033..614d2ce 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -302,19 +302,27 @@ dnl Takes the name of the class as an argument. The macro name dnl is usually the name of the class with '.' dnl replaced by '_' and all letters capitalised. dnl e.g. IT_CHECK_FOR_CLASS([JAVA_UTIL_SCANNER],[java.util.Scanner]) +dnl Test class has to be in sun.applet for some internal classes AC_DEFUN([IT_CHECK_FOR_CLASS],[ -AC_CACHE_CHECK([if $2 is missing], it_cv_$1, [ -CLASS=Test.java +AC_REQUIRE([IT_FIND_JAVAC]) +AC_REQUIRE([IT_FIND_JAVA]) +AC_CACHE_CHECK([if $2 is available], it_cv_$1, [ +CLASS=sun/applet/Test.java BYTECODE=$(echo $CLASS|sed 's#\.java##') -mkdir tmp.$$ +mkdir -p tmp.$$/$(dirname $CLASS) cd tmp.$$ cat << \EOF > $CLASS [/* [#]line __oline__ "configure" */ +package sun.applet; + +import $2; + public class Test { public static void main(String[] args) + throws Exception { - $2.class.toString(); + System.out.println(Class.forName("$2")); } } ] @@ -331,7 +339,8 @@ fi ]) rm -f $CLASS *.class cd .. -rmdir tmp.$$ +# should be rmdir but has to be rm -rf due to sun.applet usage +rm -rf tmp.$$ if test x"${it_cv_$1}" = "xno"; then AC_MSG_ERROR([$2 not found.]) fi @@ -507,3 +516,30 @@ AC_DEFUN([IT_SET_ARCH_SETTINGS], AC_SUBST(ARCH_PREFIX) AC_SUBST(ARCHFLAG) ]) + +AC_DEFUN_ONCE([IT_FIND_JAVA], +[ + AC_MSG_CHECKING([for a Java virtual machine]) + AC_ARG_WITH([java], + [AS_HELP_STRING(--with-java,specify location of the 1.5 java vm)], + [ + JAVA="${withval}" + ], + [ + JAVA=${SYSTEM_JDK_DIR}/bin/java + ]) + if ! test -f "${JAVA}"; then + AC_PATH_PROG(JAVA, "${JAVA}") + fi + if test -z "${JAVA}"; then + AC_PATH_PROG(JAVA, "java") + fi + if test -z "${JAVA}"; then + AC_PATH_PROG(JAVA, "gij") + fi + if test -z "${JAVA}"; then + AC_MSG_ERROR("A 1.5-compatible Java VM is required.") + fi + AC_MSG_RESULT(${JAVA}) + AC_SUBST(JAVA) +]) |