changeset 2569:8c21507c2875

PR2339: Fail early if there is no native HotSpot JIT & all other options are disabled 2014-06-12 Andrew John Hughes <gnu.andrew@member.fsf.org> PR2339: Fail early if there is no native HotSpot JIT & all other options are disabled * acinclude.m4: (IT_ENABLE_ZERO_BUILD): Depend on IT_HAS_NATIVE_HOTSPOT_PORT. Split out arch-dependent code into that macro. Make ENABLE_CACAO test more readable. (IT_ENABLE_CACAO): Handle enableval same as other macros so possible values are only ever yes or no. (IT_ENABLE_JAMVM): Likewise. (IT_HAS_NATIVE_HOTSPOT_PORT): Architecture detection split out from IT_ENABLE_ZERO_BUILD. Now sets has_native_hotspot_port for later reference. * configure.ac: Error out if there is no native HotSpot port and Zero (which implies Shark & ARM32 JIT), CACAO and JamVM are all disabled.
author Andrew John Hughes <gnu_andrew@member.fsf.org>
date Mon, 08 Jun 2015 05:58:21 +0100
parents f7e2e0904a87
children a0886ab83260
files ChangeLog NEWS acinclude.m4 configure.ac
diffstat 4 files changed, 72 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Jun 08 05:40:53 2015 +0100
+++ b/ChangeLog	Mon Jun 08 05:58:21 2015 +0100
@@ -1,3 +1,23 @@
+2014-06-12  Andrew John Hughes  <gnu.andrew@member.fsf.org>
+
+	PR2339: Fail early if there is no native HotSpot JIT
+	& all other options are disabled
+	* acinclude.m4:
+	(IT_ENABLE_ZERO_BUILD): Depend on
+	IT_HAS_NATIVE_HOTSPOT_PORT. Split out arch-dependent
+	code into that macro. Make ENABLE_CACAO test more
+	readable.
+	(IT_ENABLE_CACAO): Handle enableval same as other macros
+	so possible values are only ever yes or no.
+	(IT_ENABLE_JAMVM): Likewise.
+	(IT_HAS_NATIVE_HOTSPOT_PORT): Architecture detection
+	split out from IT_ENABLE_ZERO_BUILD. Now sets
+	has_native_hotspot_port for later reference.
+	* configure.ac:
+	Error out if there is no native HotSpot port and
+	Zero (which implies Shark & ARM32 JIT), CACAO and
+	JamVM are all disabled.
+
 2014-09-16  Andrew John Hughes  <gnu.andrew@member.fsf.org>
 
 	PR2001: Synchronise HEAD tarball paths with
--- a/NEWS	Mon Jun 08 05:40:53 2015 +0100
+++ b/NEWS	Mon Jun 08 05:58:21 2015 +0100
@@ -69,6 +69,7 @@
   - PR2256: Add SystemTap tests
   - PR2257: clean-extract-nashorn rule is never run
   - PR2329: jamvm parallel unpack failures
+  - PR2339: Fail early if there is no native HotSpot JIT & all other options are disabled
   - PR2348: Avoid following symlinks for CACAO and JamVM patches
   - PR2363: Remove EC source code prior to build
   - PR2369: SunEC provider is partially installed
--- a/acinclude.m4	Mon Jun 08 05:40:53 2015 +0100
+++ b/acinclude.m4	Mon Jun 08 05:58:21 2015 +0100
@@ -612,6 +612,7 @@
 AC_DEFUN([IT_ENABLE_ZERO_BUILD],
 [
   AC_REQUIRE([IT_SET_ARCH_SETTINGS])
+  AC_REQUIRE([IT_HAS_NATIVE_HOTSPOT_PORT])
   AC_MSG_CHECKING([whether to use the zero-assembler port])
   use_zero=no
   AC_ARG_ENABLE([zero],
@@ -630,21 +631,14 @@
   [
     if test "x${use_shark}" = "xyes"; then
       use_zero=yes;
-    else
-      case "${host}" in
-        i?86-*-*) ;;
-        sparc*-*-*) ;;
-        x86_64-*-*) ;;
-        *)
-          if test "x${ENABLE_CACAO}" != xno || \
-	     test "x${ENABLE_JAMVM}" = xyes; then
-            use_zero=no
-          else
-            use_zero=yes
-          fi
-          ;;
-      esac
-    fi
+    else if test "x$has_native_hotspot_port" = "xno"; then
+      if test "x${ENABLE_CACAO}" = xyes || \
+         test "x${ENABLE_JAMVM}" = xyes; then
+           use_zero=no
+      else
+           use_zero=yes
+      fi
+    fi; fi
   ])
   AC_MSG_RESULT($use_zero)
   AM_CONDITIONAL(ZERO_BUILD, test "x${use_zero}" = xyes)
@@ -715,7 +709,14 @@
   AC_ARG_ENABLE([cacao],
 	      [AS_HELP_STRING(--enable-cacao,use CACAO as VM [[default=no]])],
   [
-    ENABLE_CACAO="${enableval}"
+    case "${enableval}" in
+      yes)
+        ENABLE_CACAO=yes
+        ;;
+      *)
+        ENABLE_CACAO=no
+        ;;
+    esac
   ],
   [
     ENABLE_CACAO=no
@@ -1682,7 +1683,14 @@
   AC_ARG_ENABLE([jamvm],
 	      [AS_HELP_STRING(--enable-jamvm,use JamVM as VM [[default=no]])],
   [
-    ENABLE_JAMVM="${enableval}"
+    case "${enableval}" in
+      yes)
+        ENABLE_JAMVM=yes
+        ;;
+      *)
+        ENABLE_JAMVM=no
+        ;;
+    esac
   ],
   [
     ENABLE_JAMVM=no
@@ -1856,3 +1864,20 @@
   AC_SUBST([ICEDTEA_BRANCH])
 ])
 
+AC_DEFUN_ONCE([IT_HAS_NATIVE_HOTSPOT_PORT],
+[
+  AC_MSG_CHECKING([if a native HotSpot port is available for this architecture])
+  has_native_hotspot_port=yes;
+  case "${host_cpu}" in
+    aarch64) ;;
+    arm64) ;;
+    i?86) ;;
+    sparc) ;;
+    x86_64) ;;
+    powerpc64) ;;
+    powerpc64le) ;;
+    *) has_native_hotspot_port=no;
+  esac
+  AC_MSG_RESULT([$has_native_hotspot_port])
+])
+
--- a/configure.ac	Mon Jun 08 05:40:53 2015 +0100
+++ b/configure.ac	Mon Jun 08 05:58:21 2015 +0100
@@ -418,4 +418,13 @@
 AC_SUBST(CONFIGURE_ARGS)
 CONFIGURE_ARGS="$ac_configure_args"
 
+# Sanity check; make sure we have a JVM
+if test "x$has_native_hotspot_port" = "xno" ; then
+  if test "x${use_zero}" = "xno" ; then
+    if test "x${ENABLE_CACAO}" = "xno" -a "x${ENABLE_JAMVM}" = "xno"; then
+      AC_MSG_ERROR([No native HotSpot port available for ${host_cpu} and all alternatives disabled.])
+    fi
+  fi
+fi
+
 AC_OUTPUT