summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew John Hughes <gnu_andrew@member.fsf.org>2010-05-27 10:32:54 +0000
committerAndrew John Hughes <gnu_andrew@member.fsf.org>2010-05-27 10:32:54 +0000
commite6c6a0238291db27ccdaee229bda59d7981a3182 (patch)
tree8c17474ce357e3eea2aa57fc1f46b9e34249b809
parent5281557e2f7bb61e2ddfc188540b76ffbb57d34e (diff)
downloadclasspath-e6c6a0238291db27ccdaee229bda59d7981a3182.tar.gz
Define macros only once and require dependencies rather than using inclusion.
2010-05-04 Andrew John Hughes <ahughes@redhat.com> * configure.ac: Call AC_PROG_JAVA_WORKS and AC_PROG_JAVAC_WORKS in place of AC_PROG_JAVA and AC_PROG_JAVAC respectively, as this is the real test we want. * m4/ac_prog_java.m4: (AC_PROG_JAVA): Don't include AC_PROG_JAVA_WORKS. * m4/ac_prog_java_works.m4: (AC_PROG_JAVA_WORKS): Require AC_PROG_JAVA and be defined only once. Require AC_PROG_JAVAC_WORKS for compilation of test class. Remove inclusion of AC_PROG_JAVAC. (AC_TRY_COMPILE_JAVA): Require AC_PROG_JAVAC_WORKS rather than AC_PROG_JAVAC. Be defined only once. * m4/ac_prog_javac.m: (AC_PROG_JAVAC): Be defined only once. Don't include AC_PROG_JAVAC_WORKS. * m4/ac_prog_javac_works.m4: (AC_PROG_JAVAC_WORKS): Be defined only once. Require AC_PROG_JAVAC.
-rw-r--r--ChangeLog23
-rw-r--r--configure.ac4
-rw-r--r--m4/ac_prog_java.m41
-rw-r--r--m4/ac_prog_java_works.m411
-rw-r--r--m4/ac_prog_javac.m43
-rw-r--r--m4/ac_prog_javac_works.m43
6 files changed, 33 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 3f63028d9..f1db8fcdb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2010-05-04 Andrew John Hughes <ahughes@redhat.com>
+
+ * configure.ac:
+ Call AC_PROG_JAVA_WORKS and AC_PROG_JAVAC_WORKS
+ in place of AC_PROG_JAVA and AC_PROG_JAVAC
+ respectively, as this is the real test we want.
+ * m4/ac_prog_java.m4:
+ (AC_PROG_JAVA): Don't include AC_PROG_JAVA_WORKS.
+ * m4/ac_prog_java_works.m4:
+ (AC_PROG_JAVA_WORKS): Require AC_PROG_JAVA and be
+ defined only once. Require AC_PROG_JAVAC_WORKS for
+ compilation of test class. Remove inclusion of
+ AC_PROG_JAVAC.
+ (AC_TRY_COMPILE_JAVA): Require AC_PROG_JAVAC_WORKS
+ rather than AC_PROG_JAVAC. Be defined only once.
+ * m4/ac_prog_javac.m:
+ (AC_PROG_JAVAC): Be defined only once. Don't include
+ AC_PROG_JAVAC_WORKS.
+ * m4/ac_prog_javac_works.m4:
+ (AC_PROG_JAVAC_WORKS): Be defined only once. Require
+ AC_PROG_JAVAC.
+
2010-05-04 Andrew Haley <aph@redhat.com>
* lib/gen-classlist.sh.in: Use absolute pathnames for all the
@@ -324,6 +346,7 @@
2010-04-27 Andrew Haley <aph@redhat.com>
+ PR classpath/43536
* java/util/concurrent/CopyOnWriteArrayList.java: Fix for empty
list.
diff --git a/configure.ac b/configure.ac
index 29fb0dd40..7f75a6ae6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -974,7 +974,7 @@ AC_SUBST(PATH_TO_GLIBJ_ZIP)
if test "x${TOOLSDIR}" != x; then
if test "x${COMPILE_WRAPPERS}" = xno; then
- AC_PROG_JAVA
+ AC_PROG_JAVA_WORKS
fi
if test "x${COMPILE_GJDOC}" = xyes; then
AC_LIB_ANTLR
@@ -990,7 +990,7 @@ if test "x${use_glibj_zip}" = xfalse || \
test "x${EXAMPLESDIR}" != x || \
test "x${TOOLSDIR}" != x && \
test "x${build_class_files}" != xno; then
- AC_PROG_JAVAC
+ AC_PROG_JAVAC_WORKS
CLASSPATH_JAVAC_MEM_CHECK
fi
diff --git a/m4/ac_prog_java.m4 b/m4/ac_prog_java.m4
index 356d99d80..12aa07c13 100644
--- a/m4/ac_prog_java.m4
+++ b/m4/ac_prog_java.m4
@@ -12,6 +12,5 @@ else
test "x$JAVA" = x && AC_CHECK_PROGS(JAVA, cacao$EXEEXT jamvm$EXEEXT kaffe$EXEEXT gij$EXEEXT java$EXEEXT, $JAVAPREFIX)
fi
test "x$JAVA" = x && AC_MSG_ERROR([no acceptable Java virtual machine found in \$PATH])
-AC_PROG_JAVA_WORKS
AC_PROVIDE([$0])dnl
])
diff --git a/m4/ac_prog_java_works.m4 b/m4/ac_prog_java_works.m4
index ffde1ffc4..d3f274478 100644
--- a/m4/ac_prog_java_works.m4
+++ b/m4/ac_prog_java_works.m4
@@ -1,7 +1,8 @@
dnl Available from the GNU Autoconf Macro Archive at:
dnl http://www.gnu.org/software/ac-archive/htmldoc/ac_prog_java_works.html
dnl
-AC_DEFUN([AC_PROG_JAVA_WORKS], [
+AC_DEFUN_ONCE([AC_PROG_JAVA_WORKS], [
+AC_REQUIRE([AC_PROG_JAVA])
AC_CHECK_PROG(uudecode, uudecode$EXEEXT, yes)
if test x$uudecode = xyes; then
AC_CACHE_CHECK([if uudecode can decode base 64 file], ac_cv_prog_uudecode_base64, [
@@ -45,9 +46,6 @@ if test x$ac_cv_prog_uudecode_base64 != xyes; then
if test x$ac_cv_prog_javac_works = xno; then
AC_MSG_ERROR([Cannot compile java source. $JAVAC does not work properly])
fi
- if test x$ac_cv_prog_javac_works = x; then
- AC_PROG_JAVAC
- fi
fi
AC_CACHE_CHECK(if $JAVA works, ac_cv_prog_java_works, [
JAVA_TEST=Test.java
@@ -63,6 +61,7 @@ public static void main (String args[]) {
EOF
changequote([, ])dnl
if test x$ac_cv_prog_uudecode_base64 != xyes; then
+ AC_REQUIRE([AC_PROG_JAVAC_WORKS])
if AC_TRY_COMMAND($JAVAC $JAVACFLAGS $JAVA_TEST) && test -s $CLASS_TEST; then
:
else
@@ -86,8 +85,8 @@ AC_PROVIDE([$0])dnl
dnl Available from the GNU Autoconf Macro Archive at:
dnl http://www.gnu.org/software/ac-archive/htmldoc/ac_try_compile_java.html
dnl
-AC_DEFUN([AC_TRY_COMPILE_JAVA],[
-AC_REQUIRE([AC_PROG_JAVAC])dnl
+AC_DEFUN_ONCE([AC_TRY_COMPILE_JAVA],[
+AC_REQUIRE([AC_PROG_JAVAC_WORKS])dnl
cat << \EOF > Test.java
/* [#]line __oline__ "configure" */
ifelse([$1], , , [import $1;])
diff --git a/m4/ac_prog_javac.m4 b/m4/ac_prog_javac.m4
index 84a72206a..1057f88e1 100644
--- a/m4/ac_prog_javac.m4
+++ b/m4/ac_prog_javac.m4
@@ -34,7 +34,7 @@ dnl @license GPLWithACException
dnl
dnl Modified to remove jikes by Andrew John Hughes on 2008-02-11
-AC_DEFUN([AC_PROG_JAVAC],[
+AC_DEFUN_ONCE([AC_PROG_JAVAC],[
AC_REQUIRE([AC_EXEEXT])dnl
ECJ_OPTS="-warn:-deprecation,serial,unusedImport"
JAVAC_OPTS="-Xlint:unchecked,cast,divzero,empty,finally,overrides"
@@ -55,6 +55,5 @@ fi
])
AC_SUBST(JAVAC_IS_GCJ, $ac_cv_prog_javac_is_gcj)
AM_CONDITIONAL(GCJ_JAVAC, test x"${JAVAC_IS_GCJ}" = xyes)
-AC_PROG_JAVAC_WORKS
AC_PROVIDE([$0])dnl
])
diff --git a/m4/ac_prog_javac_works.m4 b/m4/ac_prog_javac_works.m4
index a03f476e3..7fb298d49 100644
--- a/m4/ac_prog_javac_works.m4
+++ b/m4/ac_prog_javac_works.m4
@@ -16,7 +16,8 @@ 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_DEFUN_ONCE([AC_PROG_JAVAC_WORKS],[
+AC_REQUIRE([AC_PROG_JAVAC])
AC_CACHE_CHECK([if $JAVAC works], ac_cv_prog_javac_works, [
JAVA_TEST=Object.java
CLASS_TEST=Object.class