changeset 2728:87847ca9d356

PR1843: 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> PR1843: 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 Fri, 13 Jun 2014 02:02:33 +0100
parents be6a6d7150e5
children 3e8a142adaf7
files ChangeLog NEWS acinclude.m4 configure.ac
diffstat 4 files changed, 72 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Apr 02 20:10:19 2014 +0100
+++ b/ChangeLog	Fri Jun 13 02:02:33 2014 +0100
@@ -1,3 +1,23 @@
+2014-06-12  Andrew John Hughes  <gnu.andrew@member.fsf.org>
+
+	PR1843: 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-03-27  Andrew John Hughes  <gnu.andrew@member.fsf.org>
 
 	* acinclude.m4:
--- a/NEWS	Wed Apr 02 20:10:19 2014 +0100
+++ b/NEWS	Fri Jun 13 02:02:33 2014 +0100
@@ -192,6 +192,7 @@
   - PR1830: Drop version requirement for LCMS 2
   - PR1833, RH1022017: Report elliptic curves supported by NSS, not the SunEC library
   - PR1741: Break PulseAudio provider out into IcedTea-Sound
+  - PR1843: Fail early if there is no native HotSpot JIT & all other options are disabled
 
 New in release 2.5.0 (2014-XX-XX):
 
--- a/acinclude.m4	Wed Apr 02 20:10:19 2014 +0100
+++ b/acinclude.m4	Fri Jun 13 02:02:33 2014 +0100
@@ -686,6 +686,7 @@
   AC_REQUIRE([IT_ENABLE_CACAO])
   AC_REQUIRE([IT_ENABLE_JAMVM])
   AC_REQUIRE([IT_ENABLE_SHARK])
+  AC_REQUIRE([IT_HAS_NATIVE_HOTSPOT_PORT])
   AC_MSG_CHECKING([whether to use the zero-assembler port])
   use_zero=no
   AC_ARG_ENABLE([zero],
@@ -704,25 +705,14 @@
   [
     if test "x${use_shark}" = "xyes"; then
       use_zero=yes;
-    else
-      case "${host_cpu}" in
-        aarch64) ;;
-        arm64) ;;
-        i?86) ;;
-        sparc) ;;
-        x86_64) ;;
-	powerpc64) ;;
-	powerpc64le) ;;
-        *)
-          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)
@@ -785,7 +775,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
@@ -2240,7 +2237,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
@@ -2786,3 +2790,20 @@
   AC_MSG_RESULT([$enable_java_debuginfo])
   AM_CONDITIONAL([ENABLE_JAVA_DEBUGINFO], test x"${enable_java_debuginfo}" = "xyes")
 ])
+
+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	Wed Apr 02 20:10:19 2014 +0100
+++ b/configure.ac	Fri Jun 13 02:02:33 2014 +0100
@@ -445,4 +445,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