8217404: --with-jvm-features doesn't work when multiple features are explicitly disabled

Reviewed-by: vlivanov, kbarrett
This commit is contained in:
Magnus Ihse Bursie 2019-01-22 18:13:30 -08:00
parent d98fe57b18
commit 5063110306

View File

@ -47,8 +47,8 @@ AC_DEFUN([HOTSPOT_CHECK_JVM_VARIANT],
[ [ [[ " $JVM_VARIANTS " =~ " $1 " ]] ] ]) [ [ [[ " $JVM_VARIANTS " =~ " $1 " ]] ] ])
############################################################################### ###############################################################################
# Check if the specified JVM features are explicitly enabled. To be used in # Check if the specified JVM feature is enabled. To be used in shell if
# shell if constructs, like this: # constructs, like this:
# if HOTSPOT_CHECK_JVM_FEATURE(jvmti); then # if HOTSPOT_CHECK_JVM_FEATURE(jvmti); then
# #
# Only valid to use after HOTSPOT_SETUP_JVM_FEATURES has setup features. # Only valid to use after HOTSPOT_SETUP_JVM_FEATURES has setup features.
@ -58,6 +58,20 @@ AC_DEFUN([HOTSPOT_CHECK_JVM_VARIANT],
AC_DEFUN([HOTSPOT_CHECK_JVM_FEATURE], AC_DEFUN([HOTSPOT_CHECK_JVM_FEATURE],
[ [ [[ " $JVM_FEATURES " =~ " $1 " ]] ] ]) [ [ [[ " $JVM_FEATURES " =~ " $1 " ]] ] ])
###############################################################################
# Check if the specified JVM feature is explicitly disabled. To be used in
# shell if constructs, like this:
# if HOTSPOT_IS_JVM_FEATURE_DISABLED(jvmci); then
#
# This function is internal to hotspot.m4, and is only used when constructing
# the valid set of enabled JVM features. Users outside of hotspot.m4 should just
# use HOTSPOT_CHECK_JVM_FEATURE to check if a feature is enabled or not.
# Definition kept in one line to allow inlining in if statements.
# Additional [] needed to keep m4 from mangling shell constructs.
AC_DEFUN([HOTSPOT_IS_JVM_FEATURE_DISABLED],
[ [ [[ " $DISABLED_JVM_FEATURES " =~ " $1 " ]] ] ])
############################################################################### ###############################################################################
# Check which variants of the JVM that we want to build. Available variants are: # Check which variants of the JVM that we want to build. Available variants are:
# server: normal interpreter, and a tiered C1/C2 compiler # server: normal interpreter, and a tiered C1/C2 compiler
@ -373,8 +387,7 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_FEATURES],
AC_MSG_CHECKING([if jvmci module jdk.internal.vm.ci should be built]) AC_MSG_CHECKING([if jvmci module jdk.internal.vm.ci should be built])
# Check if jvmci is diabled # Check if jvmci is diabled
DISABLE_JVMCI=`$ECHO $DISABLED_JVM_FEATURES | $GREP jvmci` if HOTSPOT_IS_JVM_FEATURE_DISABLED(jvmci); then
if test "x$DISABLE_JVMCI" = "xjvmci"; then
AC_MSG_RESULT([no, forced]) AC_MSG_RESULT([no, forced])
JVM_FEATURES_jvmci="" JVM_FEATURES_jvmci=""
INCLUDE_JVMCI="false" INCLUDE_JVMCI="false"
@ -400,8 +413,7 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_FEATURES],
AC_MSG_CHECKING([if graal module jdk.internal.vm.compiler should be built]) AC_MSG_CHECKING([if graal module jdk.internal.vm.compiler should be built])
# Check if graal is diabled # Check if graal is diabled
DISABLE_GRAAL=`$ECHO $DISABLED_JVM_FEATURES | $GREP graal` if HOTSPOT_IS_JVM_FEATURE_DISABLED(graal); then
if test "x$DISABLE_GRAAL" = "xgraal"; then
AC_MSG_RESULT([no, forced]) AC_MSG_RESULT([no, forced])
JVM_FEATURES_graal="" JVM_FEATURES_graal=""
INCLUDE_GRAAL="false" INCLUDE_GRAAL="false"
@ -433,8 +445,7 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_FEATURES],
AC_SUBST(INCLUDE_GRAAL) AC_SUBST(INCLUDE_GRAAL)
# Disable aot with '--with-jvm-features=-aot' # Disable aot with '--with-jvm-features=-aot'
DISABLE_AOT=`$ECHO $DISABLED_JVM_FEATURES | $GREP aot` if HOTSPOT_IS_JVM_FEATURE_DISABLED(aot); then
if test "x$DISABLE_AOT" = "xaot"; then
ENABLE_AOT="false" ENABLE_AOT="false"
fi fi
@ -458,7 +469,7 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_FEATURES],
JVM_FEATURES_aot="aot" JVM_FEATURES_aot="aot"
fi fi
else else
if test "x$enable_aot" = "xno" || test "x$DISABLE_AOT" = "xaot"; then if test "x$enable_aot" = "xno" || HOTSPOT_IS_JVM_FEATURE_DISABLED(aot); then
AC_MSG_RESULT([no, forced]) AC_MSG_RESULT([no, forced])
else else
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
@ -490,8 +501,7 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_FEATURES],
fi fi
# Disable CDS if user requested it with --with-jvm-features=-cds. # Disable CDS if user requested it with --with-jvm-features=-cds.
DISABLE_CDS=`$ECHO $DISABLED_JVM_FEATURES | $GREP cds` if HOTSPOT_IS_JVM_FEATURE_DISABLED(cds); then
if test "x$DISABLE_CDS" = "xcds"; then
ENABLE_CDS="false" ENABLE_CDS="false"
if test "x$enable_cds" = "xyes"; then if test "x$enable_cds" = "xyes"; then
AC_MSG_ERROR([CDS was disabled by --with-jvm-features=-cds. Remove --enable-cds.]) AC_MSG_ERROR([CDS was disabled by --with-jvm-features=-cds. Remove --enable-cds.])