common/autoconf/boot-jdk.m4
changeset 22728 0a9d96bf2023
parent 22477 789f51111cb9
child 23171 56a45cb104d1
equal deleted inserted replaced
22727:7d0c85ad2eec 22728:0a9d96bf2023
   339 
   339 
   340 AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS],
   340 AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS],
   341 [
   341 [
   342   ##############################################################################
   342   ##############################################################################
   343   #
   343   #
   344   # Specify options for anything that is run with the Boot JDK.
   344   # Specify jvm options for anything that is run with the Boot JDK.
       
   345   # Not all JVM:s accept the same arguments on the command line.
   345   #
   346   #
   346   AC_ARG_WITH(boot-jdk-jvmargs, [AS_HELP_STRING([--with-boot-jdk-jvmargs],
   347   AC_ARG_WITH(boot-jdk-jvmargs, [AS_HELP_STRING([--with-boot-jdk-jvmargs],
   347   [specify JVM arguments to be passed to all invocations of the Boot JDK, overriding the default values,
   348   [specify JVM arguments to be passed to all java invocations of boot JDK, overriding the default values,
   348   e.g --with-boot-jdk-jvmargs="-Xmx8G -enableassertions"])])
   349   e.g --with-boot-jdk-jvmargs="-Xmx8G -enableassertions"])])
   349 
   350 
   350   if test "x$with_boot_jdk_jvmargs" = x; then
   351   AC_MSG_CHECKING([flags for boot jdk java command] )
   351     # Not all JVM:s accept the same arguments on the command line.
   352 
   352     # OpenJDK specific increase in thread stack for JDK build,
   353   # Starting amount of heap memory.
   353     # well more specifically, when running javac.
   354   ADD_JVM_ARG_IF_OK([-Xms64M],boot_jdk_jvmargs,[$JAVA])
   354     if test "x$BUILD_NUM_BITS" = x32; then
   355 
   355       STACK_SIZE=768
   356   # Maximum amount of heap memory.
   356     else
   357   # Maximum stack size.
   357       # Running Javac on a JVM on a 64-bit machine, the stack takes more space
   358   if test "x$BUILD_NUM_BITS" = x32; then
   358       # since 64-bit pointers are pushed on the stach. Apparently, we need
   359     JVM_MAX_HEAP=1100M
   359       # to increase the stack space when javacing the JDK....
   360     STACK_SIZE=768
   360       STACK_SIZE=1536
   361   else
   361     fi
   362     # Running Javac on a JVM on a 64-bit machine, takes more space since 64-bit
   362 
   363     # pointers are used. Apparently, we need to increase the heap and stack
   363     # Minimum amount of heap memory.
   364     # space for the jvm. More specifically, when running javac to build huge
   364     ADD_JVM_ARG_IF_OK([-Xms64M],boot_jdk_jvmargs,[$JAVA])
   365     # jdk batch
   365     if test "x$OPENJDK_TARGET_OS" = "xmacosx" || test "x$OPENJDK_TARGET_CPU" = "xppc64" ; then
   366     JVM_MAX_HEAP=1600M
   366       # Why does macosx need more heap? Its the huge JDK batch.
   367     STACK_SIZE=1536
   367       ADD_JVM_ARG_IF_OK([-Xmx1600M],boot_jdk_jvmargs,[$JAVA])
   368   fi
   368     else
   369   ADD_JVM_ARG_IF_OK([-Xmx$JVM_MAX_HEAP],boot_jdk_jvmargs,[$JAVA])
   369       ADD_JVM_ARG_IF_OK([-Xmx1100M],boot_jdk_jvmargs,[$JAVA])
   370   ADD_JVM_ARG_IF_OK([-XX:ThreadStackSize=$STACK_SIZE],boot_jdk_jvmargs,[$JAVA])
   370     fi
   371 
   371     # When is adding -client something that speeds up the JVM?
   372   # Disable special log output when a debug build is used as Boot JDK...
   372     # ADD_JVM_ARG_IF_OK([-client],boot_jdk_jvmargs,[$JAVA])
   373   ADD_JVM_ARG_IF_OK([-XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput],boot_jdk_jvmargs,[$JAVA])
   373     ADD_JVM_ARG_IF_OK([-XX:ThreadStackSize=$STACK_SIZE],boot_jdk_jvmargs,[$JAVA])
   374 
   374     # Disable special log output when a debug build is used as Boot JDK...
   375   # Apply user provided options.
   375     ADD_JVM_ARG_IF_OK([-XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput],boot_jdk_jvmargs,[$JAVA])
   376   ADD_JVM_ARG_IF_OK([$with_boot_jdk_jvmargs],boot_jdk_jvmargs,[$JAVA])
   376   fi
   377 
       
   378   AC_MSG_RESULT([$boot_jdk_jvmargs])
       
   379 
       
   380   # For now, general JAVA_FLAGS are the same as the boot jdk jvmargs
       
   381   JAVA_FLAGS=$boot_jdk_jvmargs
   377 
   382 
   378   AC_SUBST(BOOT_JDK_JVMARGS, $boot_jdk_jvmargs)
   383   AC_SUBST(BOOT_JDK_JVMARGS, $boot_jdk_jvmargs)
   379 ])
   384   AC_SUBST(JAVA_FLAGS, $JAVA_FLAGS)
       
   385 ])