common/autoconf/boot-jdk.m4
changeset 33032 19ae7cdc0cd0
parent 32921 8e0250dfa145
child 34101 a1db3b482137
child 33951 cc5ca0725e70
--- a/common/autoconf/boot-jdk.m4	Tue Oct 20 16:40:01 2015 +0200
+++ b/common/autoconf/boot-jdk.m4	Tue Oct 20 17:29:53 2015 +0200
@@ -305,6 +305,16 @@
   BOOT_JDK_SOURCETARGET="-source 8 -target 8"
   AC_SUBST(BOOT_JDK_SOURCETARGET)
   AC_SUBST(JAVAC_FLAGS)
+
+  # Check if the boot jdk is 32 or 64 bit
+  if "$JAVA" -d64 -version > /dev/null 2>&1; then
+    BOOT_JDK_BITS="64"
+  else
+    BOOT_JDK_BITS="32"
+  fi
+  AC_MSG_CHECKING([if Boot JDK is 32 or 64 bits])
+  AC_MSG_RESULT([$BOOT_JDK_BITS])
+  AC_SUBST(BOOT_JDK_BITS)
 ])
 
 AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS],
@@ -341,7 +351,7 @@
   # Maximum amount of heap memory.
   # Maximum stack size.
   JVM_MAX_HEAP=`expr $MEMORY_SIZE / 2`
-  if test "x$BUILD_NUM_BITS" = x32; then
+  if test "x$BOOT_JDK_BITS" = "x32"; then
     if test "$JVM_MAX_HEAP" -gt "1100"; then
       JVM_MAX_HEAP=1100
     elif test "$JVM_MAX_HEAP" -lt "512"; then
@@ -349,10 +359,7 @@
     fi
     STACK_SIZE=768
   else
-    # Running Javac on a JVM on a 64-bit machine, takes more space since 64-bit
-    # pointers are used. Apparently, we need to increase the heap and stack
-    # space for the jvm. More specifically, when running javac to build huge
-    # jdk batch
+    # Running a 64 bit JVM allows for and requires a bigger heap
     if test "$JVM_MAX_HEAP" -gt "1600"; then
       JVM_MAX_HEAP=1600
     elif test "$JVM_MAX_HEAP" -lt "512"; then