# HG changeset patch # User simonis # Date 1538992912 -7200 # Mon Oct 08 12:01:52 2018 +0200 # Node ID dd737309b6457ec5efc145b3a2309bc361654bd7 # Parent f697ba5b18d2d011dbdc5438a6b1e2d451a41705 8211837: Creation of the default CDS Archive should depend on ENABLE_CDS diff --git a/make/autoconf/hotspot.m4 b/make/autoconf/hotspot.m4 --- a/make/autoconf/hotspot.m4 +++ b/make/autoconf/hotspot.m4 @@ -252,14 +252,6 @@ AC_MSG_ERROR([Invalid value for --enable-cds: $enable_cds]) fi - # Disable CDS on AIX. - if test "x$OPENJDK_TARGET_OS" = "xaix"; then - ENABLE_CDS="false" - if test "x$enable_cds" = "xyes"; then - AC_MSG_ERROR([CDS is currently not supported on AIX. Remove --enable-cds.]) - fi - fi - AC_SUBST(ENABLE_CDS) ]) @@ -489,6 +481,34 @@ # All variants but minimal (and custom) get these features NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES cmsgc g1gc parallelgc serialgc epsilongc jni-check jvmti management nmt services vm-structs" + # Disable CDS on AIX. + if test "x$OPENJDK_TARGET_OS" = "xaix"; then + ENABLE_CDS="false" + if test "x$enable_cds" = "xyes"; then + AC_MSG_ERROR([CDS is currently not supported on AIX. Remove --enable-cds.]) + fi + fi + + # Disable CDS if user requested it with --with-jvm-features=-cds. + DISABLE_CDS=`$ECHO $DISABLED_JVM_FEATURES | $GREP cds` + if test "x$DISABLE_CDS" = "xcds"; then + ENABLE_CDS="false" + if test "x$enable_cds" = "xyes"; then + AC_MSG_ERROR([CDS was disabled by --with-jvm-features=-cds. Remove --enable-cds.]) + fi + fi + + # Disable CDS for zero, minimal, core.. + if HOTSPOT_CHECK_JVM_VARIANT(zero) || HOTSPOT_CHECK_JVM_VARIANT(minimal) || HOTSPOT_CHECK_JVM_VARIANT(core); then + # ..except when the user explicitely requested it with --enable-jvm-features + if ! HOTSPOT_CHECK_JVM_FEATURE(cds); then + ENABLE_CDS="false" + if test "x$enable_cds" = "xyes"; then + AC_MSG_ERROR([CDS not implemented for variants zero, minimal, core. Remove --enable-cds.]) + fi + fi + fi + AC_MSG_CHECKING([if cds should be enabled]) if test "x$ENABLE_CDS" = "xtrue"; then if test "x$enable_cds" = "xyes"; then diff --git a/make/autoconf/jdk-options.m4 b/make/autoconf/jdk-options.m4 --- a/make/autoconf/jdk-options.m4 +++ b/make/autoconf/jdk-options.m4 @@ -527,7 +527,7 @@ # Check if it's likely that it's possible to generate the classlist. Depending # on exact jvm configuration it could be possible anyway. - if test "x$ENABLE_CDS" = "xtrue" && (HOTSPOT_CHECK_JVM_VARIANT(server) || HOTSPOT_CHECK_JVM_VARIANT(client)); then + if test "x$ENABLE_CDS" = "xtrue" && (HOTSPOT_CHECK_JVM_VARIANT(server) || HOTSPOT_CHECK_JVM_VARIANT(client) || HOTSPOT_CHECK_JVM_FEATURE(cds)); then ENABLE_GENERATE_CLASSLIST_POSSIBLE="true" else ENABLE_GENERATE_CLASSLIST_POSSIBLE="false" @@ -618,15 +618,15 @@ [Set to disable generation of a default CDS archive in the product image @<:@enabled@:>@])]) AC_MSG_CHECKING([if a default CDS archive should be generated]) - if test "x$COMPILE_TYPE" = "xcross"; then + if test "x$ENABLE_CDS" = "xfalse"; then + AC_MSG_RESULT([no, because CDS is disabled]) + BUILD_CDS_ARCHIVE="false" + elif test "x$COMPILE_TYPE" = "xcross"; then AC_MSG_RESULT([no, not possible with cross compilation]) BUILD_CDS_ARCHIVE="false" elif test "x$enable_cds_archive" = "xyes"; then AC_MSG_RESULT([yes, forced]) BUILD_CDS_ARCHIVE="true" - elif HOTSPOT_CHECK_JVM_VARIANT(zero); then - AC_MSG_RESULT([no]) - BUILD_CDS_ARCHIVE="false" elif test "x$enable_cds_archive" = "x"; then AC_MSG_RESULT([yes]) BUILD_CDS_ARCHIVE="true"