changeset 3212:f26bd7c5e3dd

PR2340: 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> PR2340: 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@redhat.com>
date Wed, 22 Jul 2015 15:10:10 +0100
parents 927710fac2ce
children 79457be1a5cf
files ChangeLog NEWS acinclude.m4 configure.ac
diffstat 4 files changed, 69 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Jul 22 14:41:55 2015 +0100
+++ b/ChangeLog	Wed Jul 22 15:10:10 2015 +0100
@@ -1,3 +1,24 @@
+2014-06-12  Andrew John Hughes  <gnu.andrew@member.fsf.org>
+
+	PR2340: Fail early if there is no native HotSpot JIT
+	& all other options are disabled
+	* NEWS: Updated.
+	* 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.
+
 2015-07-22  Andrew John Hughes  <gnu.andrew@redhat.com>
 
 	* patches/hotspot/hs23/systemtap.patch:
--- a/NEWS	Wed Jul 22 14:41:55 2015 +0100
+++ b/NEWS	Wed Jul 22 15:10:10 2015 +0100
@@ -47,6 +47,7 @@
   - S8087120, RH1206656, PR2554: [GCC5] java.lang.StackOverflowError on Zero JVM initialization on non x86 platforms.
  * Bug fixes
   - PR2319: Checksum of policy JAR files changes on every build
+  - PR2340: Fail early if there is no native HotSpot JIT & all other options are disabled
   - PR2460: Policy JAR files should be timestamped with the date of the policy file they hold
   - PR2481, RH489586, RH1236619: OpenJDK can't handle spaces in zone names in /etc/sysconfig/clock
   - PR2486: JSSE server is still limited to 768-bit DHE
--- a/acinclude.m4	Wed Jul 22 14:41:55 2015 +0100
+++ b/acinclude.m4	Wed Jul 22 15:10:10 2015 +0100
@@ -722,6 +722,7 @@
   AC_REQUIRE([IT_ENABLE_CACAO])
   AC_REQUIRE([IT_ENABLE_JAMVM])
   AC_REQUIRE([IT_SET_SHARK_BUILD])
+  AC_REQUIRE([IT_HAS_NATIVE_HOTSPOT_PORT])
   AC_MSG_CHECKING([whether to use the zero-assembler port])
   use_zero=no
   AC_ARG_ENABLE([zero],
@@ -740,21 +741,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)
@@ -827,7 +821,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
@@ -866,7 +867,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
@@ -1344,6 +1352,19 @@
   AC_PROVIDE([$0])dnl
 ])
 
+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
+    i?86) ;;
+    sparc) ;;
+    x86_64) ;;
+    *) has_native_hotspot_port=no;
+  esac
+  AC_MSG_RESULT([$has_native_hotspot_port])
+])
+
 AC_DEFUN_ONCE([IT_GETDTDTYPE_CHECK],[
   AC_REQUIRE([IT_CHECK_JAVA_AND_JAVAC_WORK])
   AC_CACHE_CHECK([if javax.xml.stream.events.Attribute.getDTDType() wrongly returns a QName], it_cv_dtdtype, [
--- a/configure.ac	Wed Jul 22 14:41:55 2015 +0100
+++ b/configure.ac	Wed Jul 22 15:10:10 2015 +0100
@@ -570,4 +570,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