]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
tests: look for GNU Java compiler at configure time
authorStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 24 Feb 2012 14:22:25 +0000 (15:22 +0100)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 24 Feb 2012 16:16:04 +0000 (17:16 +0100)
Do this for consistency with what is done with other compilers.

* configure.ac: Look for GNU java compiler at configure time.
* tests/defs (gcj): Adjust and simplify.
($am__tool_prefix): Remove definition, it's not used anymore.

configure.ac
tests/defs

index a9dd20bd49d4bd9871ebd20502a98992f1ca2668..c8d5a344ae03e8647aff80ad9c0ef8fb1535bd70 100644 (file)
@@ -378,6 +378,14 @@ AS_IF([AM_RUN_LOG([$GNU_F77 --version && $GNU_F77 -v])], [],
       [AC_MSG_WARN([botched installation for GNU Fortran 77 compiler])
       _AM_SKIP_COMP_TESTS([GNU Fortran 77])])
 
+# GNU Java compiler.
+AC_ARG_VAR([GNU_GCJ], [GNU Java compiler])
+AC_ARG_VAR([GNU_GCJFLAGS], [GNU Java compiler flags])
+AC_CHECK_TOOLS([GNU_GCJ], [gcj], [false])
+AS_IF([AM_RUN_LOG([$GNU_GCJ --version && $GNU_GCJ -v])], [],
+      [AC_MSG_WARN([botched installation for GNU Java compiler])
+      _AM_SKIP_COMP_TESTS([GNU Java])])
+
 # If we have been able to find at least a working compiler above, we
 # know what the object and executable extensions for this platform are.
 OBJEXT=${ac_cv_objext-UNKNOWN}
index ab5717b5a8c7ab1072d05ae798eefd5ddcdd8e8a..e925222520a229dac41977841dcaaf7acd919d9f 100644 (file)
@@ -725,14 +725,6 @@ require_compiler_ ()
 ##  required by them.                                          ##
 ## ----------------------------------------------------------- ##
 
-# So that we can force the use of correct gcc, g++ etc., consistently
-# with cross-compilation settings.
-if cross_compiling; then
-  am__tool_prefix="$host_alias-"
-else
-  am__tool_prefix=
-fi
-
 # Look for (and maybe set up) required tools and/or system features; skip
 # the current test if they are not found.
 for tool in : $required
@@ -803,12 +795,8 @@ do
       unset make_
       ;;
     gcj)
-      GCJ=${am__tool_prefix}gcj
-      export GCJ
-      echo "$me: running $GCJ --version"
-      $GCJ --version || skip_all_ "GNU Java compiler not available"
-      echo "$me: running $GCJ -v"
-      $GCJ -v || skip_all_ "botched installation for GNU Java compiler"
+      GCJ=$GNU_GCJ GCJFLAGS=$GNU_GCJFLAGS; export GCJ GCJFLAGS
+      test "$GCJ" = false && skip_all_ "GNU Java compiler unavailable"
       ;;
     gcc)
       CC=$GNU_CC CFLAGS=$GNU_CFLAGS; export CC CFLAGS CPPFLAGS