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
308 AC_MSG_ERROR([Specified JVM feature 'management' requires feature 'nmt'])
309 fi
310
311 if HOTSPOT_CHECK_JVM_FEATURE(jvmci) && ! (HOTSPOT_CHECK_JVM_FEATURE(compiler1) || HOTSPOT_CHECK_JVM_FEATURE(compiler2)); then
312 AC_MSG_ERROR([Specified JVM feature 'jvmci' requires feature 'compiler2' or 'compiler1'])
313 fi
314
315 if HOTSPOT_CHECK_JVM_FEATURE(cmsgc) && ! HOTSPOT_CHECK_JVM_FEATURE(serialgc); then
316 AC_MSG_ERROR([Specified JVM feature 'cmsgc' requires feature 'serialgc'])
317 fi
318
319 # Enable JFR by default, except for Zero, linux-sparcv9 and on minimal.
320 if ! HOTSPOT_CHECK_JVM_VARIANT(zero); then
321 if test "x$OPENJDK_TARGET_OS" != xaix; then
322 if test "x$OPENJDK_TARGET_OS" != xlinux || test "x$OPENJDK_TARGET_CPU" != xsparcv9; then
323 NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES jfr"
324 fi
325 fi
326 fi
327
328 # Only enable ZGC on supported platforms
329 AC_MSG_CHECKING([if zgc can be built])
330 if test "x$OPENJDK_TARGET_OS" = "xlinux" && test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then
331 AC_MSG_RESULT([yes])
332 else
333 DISABLED_JVM_FEATURES="$DISABLED_JVM_FEATURES zgc"
334 AC_MSG_RESULT([no, platform not supported])
335 fi
336
337 # Disable unsupported GCs for Zero
338 if HOTSPOT_CHECK_JVM_VARIANT(zero); then
339 DISABLED_JVM_FEATURES="$DISABLED_JVM_FEATURES epsilongc g1gc zgc"
340 fi
341
342 # Turn on additional features based on other parts of configure
343 if test "x$INCLUDE_DTRACE" = "xtrue"; then
344 JVM_FEATURES="$JVM_FEATURES dtrace"
345 else
346 if HOTSPOT_CHECK_JVM_FEATURE(dtrace); then
347 AC_MSG_ERROR([To enable dtrace, you must use --enable-dtrace])
348 fi
349 fi
350
351 if test "x$STATIC_BUILD" = "xtrue"; then
352 JVM_FEATURES="$JVM_FEATURES static-build"
353 else
354 if HOTSPOT_CHECK_JVM_FEATURE(static-build); then
355 AC_MSG_ERROR([To enable static-build, you must use --enable-static-build])
356 fi
357 fi
358
359 if ! HOTSPOT_CHECK_JVM_VARIANT(zero); then
453 AC_MSG_RESULT([no, forced])
454 else
455 AC_MSG_RESULT([no])
456 fi
457 JVM_FEATURES_aot=""
458 if HOTSPOT_CHECK_JVM_FEATURE(aot); then
459 AC_MSG_ERROR([To enable aot, you must use --enable-aot])
460 fi
461 fi
462
463 AC_SUBST(ENABLE_AOT)
464
465 if test "x$OPENJDK_TARGET_CPU" = xarm ; then
466 # Default to use link time optimizations on minimal on arm
467 JVM_FEATURES_link_time_opt="link-time-opt"
468 else
469 JVM_FEATURES_link_time_opt=""
470 fi
471
472 # All variants but minimal (and custom) get these features
473 NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES cmsgc g1gc parallelgc serialgc epsilongc jni-check jvmti management nmt services vm-structs zgc"
474
475 # Disable CDS on AIX.
476 if test "x$OPENJDK_TARGET_OS" = "xaix"; then
477 ENABLE_CDS="false"
478 if test "x$enable_cds" = "xyes"; then
479 AC_MSG_ERROR([CDS is currently not supported on AIX. Remove --enable-cds.])
480 fi
481 fi
482
483 # Disable CDS if user requested it with --with-jvm-features=-cds.
484 DISABLE_CDS=`$ECHO $DISABLED_JVM_FEATURES | $GREP cds`
485 if test "x$DISABLE_CDS" = "xcds"; then
486 ENABLE_CDS="false"
487 if test "x$enable_cds" = "xyes"; then
488 AC_MSG_ERROR([CDS was disabled by --with-jvm-features=-cds. Remove --enable-cds.])
489 fi
490 fi
491
492 # Disable CDS for zero, minimal, core..
493 if HOTSPOT_CHECK_JVM_VARIANT(zero) || HOTSPOT_CHECK_JVM_VARIANT(minimal) || HOTSPOT_CHECK_JVM_VARIANT(core); then
|
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
308 AC_MSG_ERROR([Specified JVM feature 'management' requires feature 'nmt'])
309 fi
310
311 if HOTSPOT_CHECK_JVM_FEATURE(jvmci) && ! (HOTSPOT_CHECK_JVM_FEATURE(compiler1) || HOTSPOT_CHECK_JVM_FEATURE(compiler2)); then
312 AC_MSG_ERROR([Specified JVM feature 'jvmci' requires feature 'compiler2' or 'compiler1'])
313 fi
314
315 if HOTSPOT_CHECK_JVM_FEATURE(cmsgc) && ! HOTSPOT_CHECK_JVM_FEATURE(serialgc); then
316 AC_MSG_ERROR([Specified JVM feature 'cmsgc' requires feature 'serialgc'])
317 fi
318
319 # Enable JFR by default, except for Zero, linux-sparcv9 and on minimal.
320 if ! HOTSPOT_CHECK_JVM_VARIANT(zero); then
321 if test "x$OPENJDK_TARGET_OS" != xaix; then
322 if test "x$OPENJDK_TARGET_OS" != xlinux || test "x$OPENJDK_TARGET_CPU" != xsparcv9; then
323 NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES jfr"
324 fi
325 fi
326 fi
327
328 # Only enable Shenandoah on supported arches
329 AC_MSG_CHECKING([if shenandoah can be built])
330 if test "x$OPENJDK_TARGET_CPU_ARCH" = "xx86" || test "x$OPENJDK_TARGET_CPU" = "xaarch64" ; then
331 AC_MSG_RESULT([yes])
332 else
333 DISABLED_JVM_FEATURES="$DISABLED_JVM_FEATURES shenandoahgc"
334 AC_MSG_RESULT([no, platform not supported])
335 fi
336
337 # Only enable ZGC on supported platforms
338 AC_MSG_CHECKING([if zgc can be built])
339 if test "x$OPENJDK_TARGET_OS" = "xlinux" && test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then
340 AC_MSG_RESULT([yes])
341 else
342 DISABLED_JVM_FEATURES="$DISABLED_JVM_FEATURES zgc"
343 AC_MSG_RESULT([no, platform not supported])
344 fi
345
346 # Disable unsupported GCs for Zero
347 if HOTSPOT_CHECK_JVM_VARIANT(zero); then
348 DISABLED_JVM_FEATURES="$DISABLED_JVM_FEATURES epsilongc g1gc zgc shenandoahgc"
349 fi
350
351 # Turn on additional features based on other parts of configure
352 if test "x$INCLUDE_DTRACE" = "xtrue"; then
353 JVM_FEATURES="$JVM_FEATURES dtrace"
354 else
355 if HOTSPOT_CHECK_JVM_FEATURE(dtrace); then
356 AC_MSG_ERROR([To enable dtrace, you must use --enable-dtrace])
357 fi
358 fi
359
360 if test "x$STATIC_BUILD" = "xtrue"; then
361 JVM_FEATURES="$JVM_FEATURES static-build"
362 else
363 if HOTSPOT_CHECK_JVM_FEATURE(static-build); then
364 AC_MSG_ERROR([To enable static-build, you must use --enable-static-build])
365 fi
366 fi
367
368 if ! HOTSPOT_CHECK_JVM_VARIANT(zero); then
462 AC_MSG_RESULT([no, forced])
463 else
464 AC_MSG_RESULT([no])
465 fi
466 JVM_FEATURES_aot=""
467 if HOTSPOT_CHECK_JVM_FEATURE(aot); then
468 AC_MSG_ERROR([To enable aot, you must use --enable-aot])
469 fi
470 fi
471
472 AC_SUBST(ENABLE_AOT)
473
474 if test "x$OPENJDK_TARGET_CPU" = xarm ; then
475 # Default to use link time optimizations on minimal on arm
476 JVM_FEATURES_link_time_opt="link-time-opt"
477 else
478 JVM_FEATURES_link_time_opt=""
479 fi
480
481 # All variants but minimal (and custom) get these features
482 NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES cmsgc g1gc parallelgc serialgc epsilongc shenandoahgc jni-check jvmti management nmt services vm-structs zgc"
483
484 # Disable CDS on AIX.
485 if test "x$OPENJDK_TARGET_OS" = "xaix"; then
486 ENABLE_CDS="false"
487 if test "x$enable_cds" = "xyes"; then
488 AC_MSG_ERROR([CDS is currently not supported on AIX. Remove --enable-cds.])
489 fi
490 fi
491
492 # Disable CDS if user requested it with --with-jvm-features=-cds.
493 DISABLE_CDS=`$ECHO $DISABLED_JVM_FEATURES | $GREP cds`
494 if test "x$DISABLE_CDS" = "xcds"; then
495 ENABLE_CDS="false"
496 if test "x$enable_cds" = "xyes"; then
497 AC_MSG_ERROR([CDS was disabled by --with-jvm-features=-cds. Remove --enable-cds.])
498 fi
499 fi
500
501 # Disable CDS for zero, minimal, core..
502 if HOTSPOT_CHECK_JVM_VARIANT(zero) || HOTSPOT_CHECK_JVM_VARIANT(minimal) || HOTSPOT_CHECK_JVM_VARIANT(core); then
|