diff options
author | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2010-05-27 10:32:54 +0000 |
---|---|---|
committer | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2010-05-27 10:32:54 +0000 |
commit | e6c6a0238291db27ccdaee229bda59d7981a3182 (patch) | |
tree | 8c17474ce357e3eea2aa57fc1f46b9e34249b809 /m4 | |
parent | 5281557e2f7bb61e2ddfc188540b76ffbb57d34e (diff) | |
download | classpath-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.
Diffstat (limited to 'm4')
-rw-r--r-- | m4/ac_prog_java.m4 | 1 | ||||
-rw-r--r-- | m4/ac_prog_java_works.m4 | 11 | ||||
-rw-r--r-- | m4/ac_prog_javac.m4 | 3 | ||||
-rw-r--r-- | m4/ac_prog_javac_works.m4 | 3 |
4 files changed, 8 insertions, 10 deletions
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 |