8 # particular file as subject to the "Classpath" exception as provided
9 # by Oracle in the LICENSE file that accompanied this code.
10 #
11 # This code is distributed in the hope that it will be useful, but WITHOUT
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 # version 2 for more details (a copy is included in the LICENSE file that
15 # accompanied this code).
16 #
17 # You should have received a copy of the GNU General Public License version
18 # 2 along with this work; if not, write to the Free Software Foundation,
19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 #
21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 # or visit www.oracle.com if you need additional information or have any
23 # questions.
24 #
25
26 # All valid JVM features, regardless of platform
27 VALID_JVM_FEATURES="compiler1 compiler2 zero minimal dtrace jvmti jvmci \
28 graal vm-structs jni-check services management cmsgc epsilongc g1gc parallelgc serialgc zgc nmt cds \
29 static-build link-time-opt aot jfr"
30
31 # Deprecated JVM features (these are ignored, but with a warning)
32 DEPRECATED_JVM_FEATURES="trace"
33
34 # All valid JVM variants
35 VALID_JVM_VARIANTS="server client minimal core zero custom"
36
37 ###############################################################################
38 # Check if the specified JVM variant should be built. To be used in shell if
39 # constructs, like this:
40 # if HOTSPOT_CHECK_JVM_VARIANT(server); then
41 #
42 # Only valid to use after HOTSPOT_SETUP_JVM_VARIANTS has setup variants.
43
44 # Definition kept in one line to allow inlining in if statements.
45 # Additional [] needed to keep m4 from mangling shell constructs.
46 AC_DEFUN([HOTSPOT_CHECK_JVM_VARIANT],
47 [ [ [[ " $JVM_VARIANTS " =~ " $1 " ]] ] ])
48
335 AC_MSG_ERROR([Specified JVM feature 'management' requires feature 'nmt'])
336 fi
337
338 if HOTSPOT_CHECK_JVM_FEATURE(jvmci) && ! (HOTSPOT_CHECK_JVM_FEATURE(compiler1) || HOTSPOT_CHECK_JVM_FEATURE(compiler2)); then
339 AC_MSG_ERROR([Specified JVM feature 'jvmci' requires feature 'compiler2' or 'compiler1'])
340 fi
341
342 if HOTSPOT_CHECK_JVM_FEATURE(cmsgc) && ! HOTSPOT_CHECK_JVM_FEATURE(serialgc); then
343 AC_MSG_ERROR([Specified JVM feature 'cmsgc' requires feature 'serialgc'])
344 fi
345
346 # Enable JFR by default, except for Zero, linux-sparcv9 and on minimal.
347 if ! HOTSPOT_CHECK_JVM_VARIANT(zero); then
348 if test "x$OPENJDK_TARGET_OS" != xaix; then
349 if test "x$OPENJDK_TARGET_OS" != xlinux || test "x$OPENJDK_TARGET_CPU" != xsparcv9; then
350 NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES jfr"
351 fi
352 fi
353 fi
354
355 # Only enable ZGC on supported platforms
356 AC_MSG_CHECKING([if zgc can be built])
357 if test "x$OPENJDK_TARGET_OS" = "xlinux" && test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then
358 AC_MSG_RESULT([yes])
359 else
360 DISABLED_JVM_FEATURES="$DISABLED_JVM_FEATURES zgc"
361 AC_MSG_RESULT([no, platform not supported])
362 fi
363
364 # Disable unsupported GCs for Zero
365 if HOTSPOT_CHECK_JVM_VARIANT(zero); then
366 DISABLED_JVM_FEATURES="$DISABLED_JVM_FEATURES epsilongc g1gc zgc"
367 fi
368
369 # Turn on additional features based on other parts of configure
370 if test "x$INCLUDE_DTRACE" = "xtrue"; then
371 JVM_FEATURES="$JVM_FEATURES dtrace"
372 else
373 if HOTSPOT_CHECK_JVM_FEATURE(dtrace); then
374 AC_MSG_ERROR([To enable dtrace, you must use --enable-dtrace])
375 fi
376 fi
377
378 if test "x$STATIC_BUILD" = "xtrue"; then
379 JVM_FEATURES="$JVM_FEATURES static-build"
380 else
381 if HOTSPOT_CHECK_JVM_FEATURE(static-build); then
382 AC_MSG_ERROR([To enable static-build, you must use --enable-static-build])
383 fi
384 fi
385
386 if ! HOTSPOT_CHECK_JVM_VARIANT(zero); then
477 AC_MSG_RESULT([no, forced])
478 else
479 AC_MSG_RESULT([no])
480 fi
481 JVM_FEATURES_aot=""
482 if HOTSPOT_CHECK_JVM_FEATURE(aot); then
483 AC_MSG_ERROR([To enable aot, you must use --enable-aot])
484 fi
485 fi
486
487 AC_SUBST(ENABLE_AOT)
488
489 if test "x$OPENJDK_TARGET_CPU" = xarm ; then
490 # Default to use link time optimizations on minimal on arm
491 JVM_FEATURES_link_time_opt="link-time-opt"
492 else
493 JVM_FEATURES_link_time_opt=""
494 fi
495
496 # All variants but minimal (and custom) get these features
497 NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES cmsgc g1gc parallelgc serialgc epsilongc jni-check jvmti management nmt services vm-structs zgc"
498
499 AC_MSG_CHECKING([if cds should be enabled])
500 if test "x$ENABLE_CDS" = "xtrue"; then
501 if test "x$enable_cds" = "xyes"; then
502 AC_MSG_RESULT([yes, forced])
503 else
504 AC_MSG_RESULT([yes])
505 fi
506 NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES cds"
507 else
508 if test "x$enable_cds" = "xno"; then
509 AC_MSG_RESULT([no, forced])
510 else
511 AC_MSG_RESULT([no])
512 fi
513 fi
514
515 # Enable features depending on variant.
516 JVM_FEATURES_server="compiler1 compiler2 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci $JVM_FEATURES_aot $JVM_FEATURES_graal"
517 JVM_FEATURES_client="compiler1 $NON_MINIMAL_FEATURES $JVM_FEATURES"
|
8 # particular file as subject to the "Classpath" exception as provided
9 # by Oracle in the LICENSE file that accompanied this code.
10 #
11 # This code is distributed in the hope that it will be useful, but WITHOUT
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 # version 2 for more details (a copy is included in the LICENSE file that
15 # accompanied this code).
16 #
17 # You should have received a copy of the GNU General Public License version
18 # 2 along with this work; if not, write to the Free Software Foundation,
19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 #
21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 # or visit www.oracle.com if you need additional information or have any
23 # questions.
24 #
25
26 # All valid JVM features, regardless of platform
27 VALID_JVM_FEATURES="compiler1 compiler2 zero minimal dtrace jvmti jvmci \
28 graal vm-structs jni-check services management cmsgc epsilongc g1gc parallelgc serialgc shenandoahgc zgc nmt cds \
29 static-build link-time-opt aot jfr"
30
31 # Deprecated JVM features (these are ignored, but with a warning)
32 DEPRECATED_JVM_FEATURES="trace"
33
34 # All valid JVM variants
35 VALID_JVM_VARIANTS="server client minimal core zero custom"
36
37 ###############################################################################
38 # Check if the specified JVM variant should be built. To be used in shell if
39 # constructs, like this:
40 # if HOTSPOT_CHECK_JVM_VARIANT(server); then
41 #
42 # Only valid to use after HOTSPOT_SETUP_JVM_VARIANTS has setup variants.
43
44 # Definition kept in one line to allow inlining in if statements.
45 # Additional [] needed to keep m4 from mangling shell constructs.
46 AC_DEFUN([HOTSPOT_CHECK_JVM_VARIANT],
47 [ [ [[ " $JVM_VARIANTS " =~ " $1 " ]] ] ])
48
335 AC_MSG_ERROR([Specified JVM feature 'management' requires feature 'nmt'])
336 fi
337
338 if HOTSPOT_CHECK_JVM_FEATURE(jvmci) && ! (HOTSPOT_CHECK_JVM_FEATURE(compiler1) || HOTSPOT_CHECK_JVM_FEATURE(compiler2)); then
339 AC_MSG_ERROR([Specified JVM feature 'jvmci' requires feature 'compiler2' or 'compiler1'])
340 fi
341
342 if HOTSPOT_CHECK_JVM_FEATURE(cmsgc) && ! HOTSPOT_CHECK_JVM_FEATURE(serialgc); then
343 AC_MSG_ERROR([Specified JVM feature 'cmsgc' requires feature 'serialgc'])
344 fi
345
346 # Enable JFR by default, except for Zero, linux-sparcv9 and on minimal.
347 if ! HOTSPOT_CHECK_JVM_VARIANT(zero); then
348 if test "x$OPENJDK_TARGET_OS" != xaix; then
349 if test "x$OPENJDK_TARGET_OS" != xlinux || test "x$OPENJDK_TARGET_CPU" != xsparcv9; then
350 NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES jfr"
351 fi
352 fi
353 fi
354
355 # Only enable Shenandoah on supported arches
356 AC_MSG_CHECKING([if shenandoah can be built])
357 if test "x$OPENJDK_TARGET_CPU_ARCH" = "xx86" || test "x$OPENJDK_TARGET_CPU" = "xaarch64" ; then
358 AC_MSG_RESULT([yes])
359 else
360 DISABLED_JVM_FEATURES="$DISABLED_JVM_FEATURES shenandoahgc"
361 AC_MSG_RESULT([no, platform not supported])
362 fi
363
364 # Only enable ZGC on supported platforms
365 AC_MSG_CHECKING([if zgc can be built])
366 if test "x$OPENJDK_TARGET_OS" = "xlinux" && test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then
367 AC_MSG_RESULT([yes])
368 else
369 DISABLED_JVM_FEATURES="$DISABLED_JVM_FEATURES zgc"
370 AC_MSG_RESULT([no, platform not supported])
371 fi
372
373 # Disable unsupported GCs for Zero
374 if HOTSPOT_CHECK_JVM_VARIANT(zero); then
375 DISABLED_JVM_FEATURES="$DISABLED_JVM_FEATURES epsilongc g1gc shenandoahgc zgc"
376 fi
377
378 # Turn on additional features based on other parts of configure
379 if test "x$INCLUDE_DTRACE" = "xtrue"; then
380 JVM_FEATURES="$JVM_FEATURES dtrace"
381 else
382 if HOTSPOT_CHECK_JVM_FEATURE(dtrace); then
383 AC_MSG_ERROR([To enable dtrace, you must use --enable-dtrace])
384 fi
385 fi
386
387 if test "x$STATIC_BUILD" = "xtrue"; then
388 JVM_FEATURES="$JVM_FEATURES static-build"
389 else
390 if HOTSPOT_CHECK_JVM_FEATURE(static-build); then
391 AC_MSG_ERROR([To enable static-build, you must use --enable-static-build])
392 fi
393 fi
394
395 if ! HOTSPOT_CHECK_JVM_VARIANT(zero); then
486 AC_MSG_RESULT([no, forced])
487 else
488 AC_MSG_RESULT([no])
489 fi
490 JVM_FEATURES_aot=""
491 if HOTSPOT_CHECK_JVM_FEATURE(aot); then
492 AC_MSG_ERROR([To enable aot, you must use --enable-aot])
493 fi
494 fi
495
496 AC_SUBST(ENABLE_AOT)
497
498 if test "x$OPENJDK_TARGET_CPU" = xarm ; then
499 # Default to use link time optimizations on minimal on arm
500 JVM_FEATURES_link_time_opt="link-time-opt"
501 else
502 JVM_FEATURES_link_time_opt=""
503 fi
504
505 # All variants but minimal (and custom) get these features
506 NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES cmsgc g1gc parallelgc serialgc epsilongc shenandoahgc jni-check jvmti management nmt services vm-structs zgc"
507
508 AC_MSG_CHECKING([if cds should be enabled])
509 if test "x$ENABLE_CDS" = "xtrue"; then
510 if test "x$enable_cds" = "xyes"; then
511 AC_MSG_RESULT([yes, forced])
512 else
513 AC_MSG_RESULT([yes])
514 fi
515 NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES cds"
516 else
517 if test "x$enable_cds" = "xno"; then
518 AC_MSG_RESULT([no, forced])
519 else
520 AC_MSG_RESULT([no])
521 fi
522 fi
523
524 # Enable features depending on variant.
525 JVM_FEATURES_server="compiler1 compiler2 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci $JVM_FEATURES_aot $JVM_FEATURES_graal"
526 JVM_FEATURES_client="compiler1 $NON_MINIMAL_FEATURES $JVM_FEATURES"
|