308 AC_MSG_CHECKING([if Boot JDK supports modules]) 309 if "$JAVA" --list-modules > /dev/null 2>&1; then 310 AC_MSG_RESULT([yes]) 311 BOOT_JDK_MODULAR="true" 312 else 313 AC_MSG_RESULT([no]) 314 BOOT_JDK_MODULAR="false" 315 fi 316 AC_SUBST(BOOT_JDK_MODULAR) 317 318 AC_SUBST(JAVAC_FLAGS) 319 320 # Check if the boot jdk is 32 or 64 bit 321 if "$JAVA" -version 2>&1 | $GREP -q "64-Bit"; then 322 BOOT_JDK_BITS="64" 323 else 324 BOOT_JDK_BITS="32" 325 fi 326 AC_MSG_CHECKING([if Boot JDK is 32 or 64 bits]) 327 AC_MSG_RESULT([$BOOT_JDK_BITS]) 328 ]) 329 330 AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS], 331 [ 332 ############################################################################## 333 # 334 # Specify jvm options for anything that is run with the Boot JDK. 335 # Not all JVM:s accept the same arguments on the command line. 336 # 337 AC_ARG_WITH(boot-jdk-jvmargs, [AS_HELP_STRING([--with-boot-jdk-jvmargs], 338 [specify JVM arguments to be passed to all java invocations of boot JDK, overriding the default values, 339 e.g --with-boot-jdk-jvmargs="-Xmx8G -enableassertions"])]) 340 341 AC_MSG_CHECKING([flags for boot jdk java command] ) 342 343 # Disable special log output when a debug build is used as Boot JDK... 344 ADD_JVM_ARG_IF_OK([-XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput],boot_jdk_jvmargs,[$JAVA]) 345 346 # Force en-US environment 347 ADD_JVM_ARG_IF_OK([-Duser.language=en -Duser.country=US],boot_jdk_jvmargs,[$JAVA]) 348 349 # Apply user provided options. 350 ADD_JVM_ARG_IF_OK([$with_boot_jdk_jvmargs],boot_jdk_jvmargs,[$JAVA]) 351 352 AC_MSG_RESULT([$boot_jdk_jvmargs]) 353 354 # For now, general JAVA_FLAGS are the same as the boot jdk jvmargs 355 JAVA_FLAGS=$boot_jdk_jvmargs 356 AC_SUBST(JAVA_FLAGS) 357 358 359 AC_MSG_CHECKING([flags for boot jdk java command for big workloads]) 360 361 # Starting amount of heap memory. 362 ADD_JVM_ARG_IF_OK([-Xms64M],boot_jdk_jvmargs_big,[$JAVA]) 363 BOOTCYCLE_JVM_ARGS_BIG=-Xms64M 364 365 # Maximum amount of heap memory and stack size. 366 JVM_HEAP_LIMIT_32="1024" 367 # Running a 64 bit JVM allows for and requires a bigger heap | 308 AC_MSG_CHECKING([if Boot JDK supports modules]) 309 if "$JAVA" --list-modules > /dev/null 2>&1; then 310 AC_MSG_RESULT([yes]) 311 BOOT_JDK_MODULAR="true" 312 else 313 AC_MSG_RESULT([no]) 314 BOOT_JDK_MODULAR="false" 315 fi 316 AC_SUBST(BOOT_JDK_MODULAR) 317 318 AC_SUBST(JAVAC_FLAGS) 319 320 # Check if the boot jdk is 32 or 64 bit 321 if "$JAVA" -version 2>&1 | $GREP -q "64-Bit"; then 322 BOOT_JDK_BITS="64" 323 else 324 BOOT_JDK_BITS="32" 325 fi 326 AC_MSG_CHECKING([if Boot JDK is 32 or 64 bits]) 327 AC_MSG_RESULT([$BOOT_JDK_BITS]) 328 329 AC_MSG_CHECKING([for Boot JDK Class Data Sharing (CDS)]) 330 existing_cds_data=`$FIND $BOOT_JDK -name classes.jsa 2> /dev/null` 331 if test "x$existing_cds_data" != x; then 332 BOOTJDK_USE_CDS=true 333 AC_MSG_RESULT([yes, already present]) 334 else 335 # Try creating a CDS archive 336 "$JAVA" -Xshare:dump > /dev/null 2>&1 337 if test $? -eq 0; then 338 BOOTJDK_USE_CDS=true 339 AC_MSG_RESULT([yes, created]) 340 else 341 # Generation failed (typically due to write privileges missing), don't 342 # use CDS. 343 BOOTJDK_USE_CDS=false 344 AC_MSG_RESULT([no, creation failed]) 345 fi 346 fi 347 ]) 348 349 AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS], 350 [ 351 ############################################################################## 352 # 353 # Specify jvm options for anything that is run with the Boot JDK. 354 # Not all JVM:s accept the same arguments on the command line. 355 # 356 AC_ARG_WITH(boot-jdk-jvmargs, [AS_HELP_STRING([--with-boot-jdk-jvmargs], 357 [specify JVM arguments to be passed to all java invocations of boot JDK, overriding the default values, 358 e.g --with-boot-jdk-jvmargs="-Xmx8G -enableassertions"])]) 359 360 AC_MSG_CHECKING([flags for boot jdk java command] ) 361 362 # Disable special log output when a debug build is used as Boot JDK... 363 ADD_JVM_ARG_IF_OK([-XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput],boot_jdk_jvmargs,[$JAVA]) 364 365 # Force en-US environment 366 ADD_JVM_ARG_IF_OK([-Duser.language=en -Duser.country=US],boot_jdk_jvmargs,[$JAVA]) 367 368 # Use CDS, if available 369 if test "x$BOOTJDK_USE_CDS" = xtrue; then 370 ADD_JVM_ARG_IF_OK([-Xshare:auto],boot_jdk_jvmargs,[$JAVA]) 371 fi 372 373 # Apply user provided options. 374 ADD_JVM_ARG_IF_OK([$with_boot_jdk_jvmargs],boot_jdk_jvmargs,[$JAVA]) 375 376 AC_MSG_RESULT([$boot_jdk_jvmargs]) 377 378 # For now, general JAVA_FLAGS are the same as the boot jdk jvmargs 379 JAVA_FLAGS=$boot_jdk_jvmargs 380 AC_SUBST(JAVA_FLAGS) 381 382 383 AC_MSG_CHECKING([flags for boot jdk java command for big workloads]) 384 385 # Starting amount of heap memory. 386 ADD_JVM_ARG_IF_OK([-Xms64M],boot_jdk_jvmargs_big,[$JAVA]) 387 BOOTCYCLE_JVM_ARGS_BIG=-Xms64M 388 389 # Maximum amount of heap memory and stack size. 390 JVM_HEAP_LIMIT_32="1024" 391 # Running a 64 bit JVM allows for and requires a bigger heap |