1 # 2 # Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 # 5 # This code is free software; you can redistribute it and/or modify it 6 # under the terms of the GNU General Public License version 2 only, as 7 # published by the Free Software Foundation. Oracle designates this 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 49 ############################################################################### 50 # Check if the specified JVM feature is enabled. To be used in shell if 51 # constructs, like this: 52 # if HOTSPOT_CHECK_JVM_FEATURE(jvmti); then 53 # 54 # Only valid to use after HOTSPOT_SETUP_JVM_FEATURES has setup features. 55 56 # Definition kept in one line to allow inlining in if statements. 57 # Additional [] needed to keep m4 from mangling shell constructs. 58 AC_DEFUN([HOTSPOT_CHECK_JVM_FEATURE], 59 [ [ [[ " $JVM_FEATURES " =~ " $1 " ]] ] ]) 60 61 ############################################################################### 62 # Check if the specified JVM feature is explicitly disabled. To be used in 63 # shell if constructs, like this: 64 # if HOTSPOT_IS_JVM_FEATURE_DISABLED(jvmci); then 65 # 66 # This function is internal to hotspot.m4, and is only used when constructing 67 # the valid set of enabled JVM features. Users outside of hotspot.m4 should just 68 # use HOTSPOT_CHECK_JVM_FEATURE to check if a feature is enabled or not. 69 70 # Definition kept in one line to allow inlining in if statements. 71 # Additional [] needed to keep m4 from mangling shell constructs. 72 AC_DEFUN([HOTSPOT_IS_JVM_FEATURE_DISABLED], 73 [ [ [[ " $DISABLED_JVM_FEATURES " =~ " $1 " ]] ] ]) 74 75 ############################################################################### 76 # Check which variants of the JVM that we want to build. Available variants are: 77 # server: normal interpreter, and a tiered C1/C2 compiler 78 # client: normal interpreter, and C1 (no C2 compiler) 79 # minimal: reduced form of client with optional features stripped out 80 # core: normal interpreter only, no compiler 81 # zero: C++ based interpreter only, no compiler 82 # custom: baseline JVM with no default features 83 # 84 AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_VARIANTS], 85 [ 86 AC_ARG_WITH([jvm-variants], [AS_HELP_STRING([--with-jvm-variants], 87 [JVM variants (separated by commas) to build (server,client,minimal,core,zero,custom) @<:@server@:>@])]) 88 89 SETUP_HOTSPOT_TARGET_CPU_PORT 90 91 if test "x$with_jvm_variants" = x; then 92 with_jvm_variants="server" 93 fi 94 JVM_VARIANTS_OPT="$with_jvm_variants" 95 96 # Has the user listed more than one variant? 97 # Additional [] needed to keep m4 from mangling shell constructs. 98 if [ [[ "$JVM_VARIANTS_OPT" =~ "," ]] ]; then 99 BUILDING_MULTIPLE_JVM_VARIANTS=true 100 else 101 BUILDING_MULTIPLE_JVM_VARIANTS=false 102 fi 103 # Replace the commas with AND for use in the build directory name. 104 JVM_VARIANTS_WITH_AND=`$ECHO "$JVM_VARIANTS_OPT" | $SED -e 's/,/AND/g'` 105 106 AC_MSG_CHECKING([which variants of the JVM to build]) 107 # JVM_VARIANTS is a space-separated list. 108 # Also use minimal, not minimal1 (which is kept for backwards compatibility). 109 JVM_VARIANTS=`$ECHO $JVM_VARIANTS_OPT | $SED -e 's/,/ /g' -e 's/minimal1/minimal/'` 110 AC_MSG_RESULT([$JVM_VARIANTS]) 111 112 # Check that the selected variants are valid 113 BASIC_GET_NON_MATCHING_VALUES(INVALID_VARIANTS, $JVM_VARIANTS, $VALID_JVM_VARIANTS) 114 if test "x$INVALID_VARIANTS" != x; then 115 AC_MSG_NOTICE([Unknown variant(s) specified: "$INVALID_VARIANTS"]) 116 AC_MSG_NOTICE([The available JVM variants are: "$VALID_JVM_VARIANTS"]) 117 AC_MSG_ERROR([Cannot continue]) 118 fi 119 120 # All "special" variants share the same output directory ("server") 121 VALID_MULTIPLE_JVM_VARIANTS="server client minimal" 122 BASIC_GET_NON_MATCHING_VALUES(INVALID_MULTIPLE_VARIANTS, $JVM_VARIANTS, $VALID_MULTIPLE_JVM_VARIANTS) 123 if test "x$INVALID_MULTIPLE_VARIANTS" != x && test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = xtrue; then 124 AC_MSG_ERROR([You cannot build multiple variants with anything else than $VALID_MULTIPLE_JVM_VARIANTS.]) 125 fi 126 127 # The "main" variant is the one used by other libs to link against during the 128 # build. 129 if test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = "xtrue"; then 130 MAIN_VARIANT_PRIO_ORDER="server client minimal" 131 for variant in $MAIN_VARIANT_PRIO_ORDER; do 132 if HOTSPOT_CHECK_JVM_VARIANT($variant); then 133 JVM_VARIANT_MAIN="$variant" 134 break 135 fi 136 done 137 else 138 JVM_VARIANT_MAIN="$JVM_VARIANTS" 139 fi 140 141 AC_SUBST(JVM_VARIANTS) 142 AC_SUBST(VALID_JVM_VARIANTS) 143 AC_SUBST(JVM_VARIANT_MAIN) 144 145 if HOTSPOT_CHECK_JVM_VARIANT(zero); then 146 # zero behaves as a platform and rewrites these values. This is really weird. :( 147 # We are guaranteed that we do not build any other variants when building zero. 148 HOTSPOT_TARGET_CPU=zero 149 HOTSPOT_TARGET_CPU_ARCH=zero 150 fi 151 ]) 152 153 ############################################################################### 154 # Check if dtrace should be enabled and has all prerequisites present. 155 # 156 AC_DEFUN_ONCE([HOTSPOT_SETUP_DTRACE], 157 [ 158 # Test for dtrace dependencies 159 AC_ARG_ENABLE([dtrace], [AS_HELP_STRING([--enable-dtrace@<:@=yes/no/auto@:>@], 160 [enable dtrace. Default is auto, where dtrace is enabled if all dependencies 161 are present.])]) 162 163 DTRACE_DEP_MISSING=false 164 165 AC_MSG_CHECKING([for dtrace tool]) 166 if test "x$DTRACE" != "x" && test -x "$DTRACE"; then 167 AC_MSG_RESULT([$DTRACE]) 168 else 169 AC_MSG_RESULT([not found, cannot build dtrace]) 170 DTRACE_DEP_MISSING=true 171 fi 172 173 AC_CHECK_HEADERS([sys/sdt.h], [DTRACE_HEADERS_OK=yes],[DTRACE_HEADERS_OK=no]) 174 if test "x$DTRACE_HEADERS_OK" != "xyes"; then 175 DTRACE_DEP_MISSING=true 176 fi 177 178 AC_MSG_CHECKING([if dtrace should be built]) 179 if test "x$enable_dtrace" = "xyes"; then 180 if test "x$DTRACE_DEP_MISSING" = "xtrue"; then 181 AC_MSG_RESULT([no, missing dependencies]) 182 HELP_MSG_MISSING_DEPENDENCY([dtrace]) 183 AC_MSG_ERROR([Cannot enable dtrace with missing dependencies. See above. $HELP_MSG]) 184 else 185 INCLUDE_DTRACE=true 186 AC_MSG_RESULT([yes, forced]) 187 fi 188 elif test "x$enable_dtrace" = "xno"; then 189 INCLUDE_DTRACE=false 190 AC_MSG_RESULT([no, forced]) 191 elif test "x$enable_dtrace" = "xauto" || test "x$enable_dtrace" = "x"; then 192 if test "x$DTRACE_DEP_MISSING" = "xtrue"; then 193 INCLUDE_DTRACE=false 194 AC_MSG_RESULT([no, missing dependencies]) 195 else 196 INCLUDE_DTRACE=true 197 AC_MSG_RESULT([yes, dependencies present]) 198 fi 199 else 200 AC_MSG_ERROR([Invalid value for --enable-dtrace: $enable_dtrace]) 201 fi 202 ]) 203 204 ################################################################################ 205 # Check if AOT should be enabled 206 # 207 AC_DEFUN_ONCE([HOTSPOT_ENABLE_DISABLE_AOT], 208 [ 209 AC_ARG_ENABLE([aot], [AS_HELP_STRING([--enable-aot@<:@=yes/no/auto@:>@], 210 [enable ahead of time compilation feature. Default is auto, where aot is enabled if all dependencies are present.])]) 211 212 if test "x$enable_aot" = "x" || test "x$enable_aot" = "xauto"; then 213 ENABLE_AOT="true" 214 elif test "x$enable_aot" = "xyes"; then 215 ENABLE_AOT="true" 216 elif test "x$enable_aot" = "xno"; then 217 ENABLE_AOT="false" 218 else 219 AC_MSG_ERROR([Invalid value for --enable-aot: $enable_aot]) 220 fi 221 222 if test "x$ENABLE_AOT" = "xtrue"; then 223 # Only enable AOT on X64 platforms. 224 if test "x$OPENJDK_TARGET_CPU" = "xx86_64" || test "x$OPENJDK_TARGET_CPU" = "xaarch64" ; then 225 if test -e "${TOPDIR}/src/jdk.aot"; then 226 if test -e "${TOPDIR}/src/jdk.internal.vm.compiler"; then 227 ENABLE_AOT="true" 228 else 229 ENABLE_AOT="false" 230 if test "x$enable_aot" = "xyes"; then 231 AC_MSG_ERROR([Cannot build AOT without src/jdk.internal.vm.compiler sources. Remove --enable-aot.]) 232 fi 233 fi 234 else 235 ENABLE_AOT="false" 236 if test "x$enable_aot" = "xyes"; then 237 AC_MSG_ERROR([Cannot build AOT without src/jdk.aot sources. Remove --enable-aot.]) 238 fi 239 fi 240 else 241 ENABLE_AOT="false" 242 if test "x$enable_aot" = "xyes"; then 243 AC_MSG_ERROR([AOT is currently only supported on x86_64 and aarch64. Remove --enable-aot.]) 244 fi 245 fi 246 fi 247 248 AC_SUBST(ENABLE_AOT) 249 ]) 250 251 ################################################################################ 252 # Allow to disable CDS 253 # 254 AC_DEFUN_ONCE([HOTSPOT_ENABLE_DISABLE_CDS], 255 [ 256 AC_ARG_ENABLE([cds], [AS_HELP_STRING([--enable-cds@<:@=yes/no/auto@:>@], 257 [enable class data sharing feature in non-minimal VM. Default is auto, where cds is enabled if supported on the platform.])]) 258 259 if test "x$enable_cds" = "x" || test "x$enable_cds" = "xauto"; then 260 ENABLE_CDS="true" 261 elif test "x$enable_cds" = "xyes"; then 262 ENABLE_CDS="true" 263 elif test "x$enable_cds" = "xno"; then 264 ENABLE_CDS="false" 265 else 266 AC_MSG_ERROR([Invalid value for --enable-cds: $enable_cds]) 267 fi 268 269 # Disable CDS on AIX. 270 if test "x$OPENJDK_TARGET_OS" = "xaix"; then 271 ENABLE_CDS="false" 272 if test "x$enable_cds" = "xyes"; then 273 AC_MSG_ERROR([CDS is currently not supported on AIX. Remove --enable-cds.]) 274 fi 275 fi 276 277 AC_SUBST(ENABLE_CDS) 278 ]) 279 280 ############################################################################### 281 # Set up all JVM features for each JVM variant. 282 # 283 AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_FEATURES], 284 [ 285 # Prettify the VALID_JVM_FEATURES string 286 BASIC_SORT_LIST(VALID_JVM_FEATURES, $VALID_JVM_FEATURES) 287 288 # The user can in some cases supply additional jvm features. For the custom 289 # variant, this defines the entire variant. 290 AC_ARG_WITH([jvm-features], [AS_HELP_STRING([--with-jvm-features], 291 [JVM features to enable (foo) or disable (-foo), separated by comma. Use '--help' to show possible values @<:@none@:>@])]) 292 if test "x$with_jvm_features" != x; then 293 AC_MSG_CHECKING([user specified JVM feature list]) 294 USER_JVM_FEATURE_LIST=`$ECHO $with_jvm_features | $SED -e 's/,/ /g'` 295 AC_MSG_RESULT([$user_jvm_feature_list]) 296 # These features will be added to all variant defaults 297 JVM_FEATURES=`$ECHO $USER_JVM_FEATURE_LIST | $AWK '{ for (i=1; i<=NF; i++) if (!match($i, /^-.*/)) printf("%s ", $i) }'` 298 # These features will be removed from all variant defaults 299 DISABLED_JVM_FEATURES=`$ECHO $USER_JVM_FEATURE_LIST | $AWK '{ for (i=1; i<=NF; i++) if (match($i, /^-.*/)) printf("%s ", substr($i, 2))}'` 300 301 # Verify that the user has provided valid features 302 BASIC_GET_NON_MATCHING_VALUES(INVALID_FEATURES, $JVM_FEATURES $DISABLED_JVM_FEATURES, $VALID_JVM_FEATURES $DEPRECATED_JVM_FEATURES) 303 if test "x$INVALID_FEATURES" != x; then 304 AC_MSG_NOTICE([Unknown JVM features specified: "$INVALID_FEATURES"]) 305 AC_MSG_NOTICE([The available JVM features are: "$VALID_JVM_FEATURES"]) 306 AC_MSG_ERROR([Cannot continue]) 307 fi 308 309 # Check if the user has provided deprecated features 310 BASIC_GET_MATCHING_VALUES(DEPRECATED_FEATURES, $JVM_FEATURES $DISABLED_JVM_FEATURES, $DEPRECATED_JVM_FEATURES) 311 if test "x$DEPRECATED_FEATURES" != x; then 312 AC_MSG_WARN([Deprecated JVM features specified (will be ignored): "$DEPRECATED_FEATURES"]) 313 # Filter out deprecated features 314 BASIC_GET_NON_MATCHING_VALUES(JVM_FEATURES, $JVM_FEATURES, $DEPRECATED_FEATURES) 315 BASIC_GET_NON_MATCHING_VALUES(DISABLED_JVM_FEATURES, $DISABLED_JVM_FEATURES, $DEPRECATED_FEATURES) 316 fi 317 318 fi 319 320 # Override hotspot cpu definitions for ARM platforms 321 if test "x$OPENJDK_TARGET_CPU" = xarm; then 322 HOTSPOT_TARGET_CPU=arm_32 323 HOTSPOT_TARGET_CPU_DEFINE="ARM32" 324 elif test "x$OPENJDK_TARGET_CPU" = xaarch64 && test "x$HOTSPOT_TARGET_CPU_PORT" = xarm64; then 325 HOTSPOT_TARGET_CPU=arm_64 326 HOTSPOT_TARGET_CPU_ARCH=arm 327 fi 328 329 # Verify that dependencies are met for explicitly set features. 330 if HOTSPOT_CHECK_JVM_FEATURE(jvmti) && ! HOTSPOT_CHECK_JVM_FEATURE(services); then 331 AC_MSG_ERROR([Specified JVM feature 'jvmti' requires feature 'services']) 332 fi 333 334 if HOTSPOT_CHECK_JVM_FEATURE(management) && ! HOTSPOT_CHECK_JVM_FEATURE(nmt); then 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 396 if HOTSPOT_CHECK_JVM_FEATURE(zero); then 397 AC_MSG_ERROR([To enable zero, you must use --with-jvm-variants=zero]) 398 fi 399 fi 400 401 AC_MSG_CHECKING([if jvmci module jdk.internal.vm.ci should be built]) 402 # Check if jvmci is diabled 403 if HOTSPOT_IS_JVM_FEATURE_DISABLED(jvmci); then 404 AC_MSG_RESULT([no, forced]) 405 JVM_FEATURES_jvmci="" 406 INCLUDE_JVMCI="false" 407 else 408 # Only enable jvmci on x86_64, sparcv9 and aarch64 409 if test "x$OPENJDK_TARGET_CPU" = "xx86_64" || \ 410 test "x$OPENJDK_TARGET_CPU" = "xsparcv9" || \ 411 test "x$OPENJDK_TARGET_CPU" = "xaarch64" ; then 412 AC_MSG_RESULT([yes]) 413 JVM_FEATURES_jvmci="jvmci" 414 INCLUDE_JVMCI="true" 415 else 416 AC_MSG_RESULT([no]) 417 JVM_FEATURES_jvmci="" 418 INCLUDE_JVMCI="false" 419 if HOTSPOT_CHECK_JVM_FEATURE(jvmci); then 420 AC_MSG_ERROR([JVMCI is currently not supported on this platform.]) 421 fi 422 fi 423 fi 424 425 AC_SUBST(INCLUDE_JVMCI) 426 427 AC_MSG_CHECKING([if graal module jdk.internal.vm.compiler should be built]) 428 # Check if graal is diabled 429 if HOTSPOT_IS_JVM_FEATURE_DISABLED(graal); then 430 AC_MSG_RESULT([no, forced]) 431 JVM_FEATURES_graal="" 432 INCLUDE_GRAAL="false" 433 else 434 if HOTSPOT_CHECK_JVM_FEATURE(graal); then 435 AC_MSG_RESULT([yes, forced]) 436 if test "x$JVM_FEATURES_jvmci" != "xjvmci" ; then 437 AC_MSG_ERROR([Specified JVM feature 'graal' requires feature 'jvmci']) 438 fi 439 JVM_FEATURES_graal="graal" 440 INCLUDE_GRAAL="true" 441 else 442 # By default enable graal build on x64 or where AOT is available. 443 # graal build requires jvmci. 444 if test "x$JVM_FEATURES_jvmci" = "xjvmci" && \ 445 (test "x$OPENJDK_TARGET_CPU" = "xx86_64" || \ 446 test "x$ENABLE_AOT" = "xtrue") ; then 447 AC_MSG_RESULT([yes]) 448 JVM_FEATURES_graal="graal" 449 INCLUDE_GRAAL="true" 450 else 451 AC_MSG_RESULT([no]) 452 JVM_FEATURES_graal="" 453 INCLUDE_GRAAL="false" 454 fi 455 fi 456 fi 457 458 AC_SUBST(INCLUDE_GRAAL) 459 460 # Disable aot with '--with-jvm-features=-aot' 461 if HOTSPOT_IS_JVM_FEATURE_DISABLED(aot); then 462 ENABLE_AOT="false" 463 fi 464 465 AC_MSG_CHECKING([if aot should be enabled]) 466 if test "x$ENABLE_AOT" = "xtrue"; then 467 if test "x$JVM_FEATURES_graal" != "xgraal"; then 468 if test "x$enable_aot" = "xyes" || HOTSPOT_CHECK_JVM_FEATURE(aot); then 469 AC_MSG_RESULT([yes, forced]) 470 AC_MSG_ERROR([Specified JVM feature 'aot' requires feature 'graal']) 471 else 472 AC_MSG_RESULT([no]) 473 fi 474 JVM_FEATURES_aot="" 475 ENABLE_AOT="false" 476 else 477 if test "x$enable_aot" = "xyes" || HOTSPOT_CHECK_JVM_FEATURE(aot); then 478 AC_MSG_RESULT([yes, forced]) 479 else 480 AC_MSG_RESULT([yes]) 481 fi 482 JVM_FEATURES_aot="aot" 483 fi 484 else 485 if test "x$enable_aot" = "xno" || HOTSPOT_IS_JVM_FEATURE_DISABLED(aot); 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" 527 JVM_FEATURES_core="$NON_MINIMAL_FEATURES $JVM_FEATURES" 528 JVM_FEATURES_minimal="compiler1 minimal serialgc $JVM_FEATURES $JVM_FEATURES_link_time_opt" 529 JVM_FEATURES_zero="zero $NON_MINIMAL_FEATURES $JVM_FEATURES" 530 JVM_FEATURES_custom="$JVM_FEATURES" 531 532 AC_SUBST(JVM_FEATURES_server) 533 AC_SUBST(JVM_FEATURES_client) 534 AC_SUBST(JVM_FEATURES_core) 535 AC_SUBST(JVM_FEATURES_minimal) 536 AC_SUBST(JVM_FEATURES_zero) 537 AC_SUBST(JVM_FEATURES_custom) 538 539 # Used for verification of Makefiles by check-jvm-feature 540 AC_SUBST(VALID_JVM_FEATURES) 541 542 # We don't support --with-jvm-interpreter anymore, use zero instead. 543 BASIC_DEPRECATED_ARG_WITH(jvm-interpreter) 544 ]) 545 546 ############################################################################### 547 # Finalize JVM features once all setup is complete, including custom setup. 548 # 549 AC_DEFUN_ONCE([HOTSPOT_FINALIZE_JVM_FEATURES], 550 [ 551 for variant in $JVM_VARIANTS; do 552 AC_MSG_CHECKING([JVM features for JVM variant '$variant']) 553 features_var_name=JVM_FEATURES_$variant 554 JVM_FEATURES_FOR_VARIANT=${!features_var_name} 555 556 # Filter out user-requested disabled features 557 BASIC_GET_NON_MATCHING_VALUES(JVM_FEATURES_FOR_VARIANT, $JVM_FEATURES_FOR_VARIANT, $DISABLED_JVM_FEATURES) 558 559 # Keep feature lists sorted and free of duplicates 560 BASIC_SORT_LIST(JVM_FEATURES_FOR_VARIANT, $JVM_FEATURES_FOR_VARIANT) 561 562 # Update real feature set variable 563 eval $features_var_name='"'$JVM_FEATURES_FOR_VARIANT'"' 564 AC_MSG_RESULT(["$JVM_FEATURES_FOR_VARIANT"]) 565 566 # Verify that we have at least one gc selected 567 GC_FEATURES=`$ECHO $JVM_FEATURES_FOR_VARIANT | $GREP gc` 568 if test "x$GC_FEATURES" = x; then 569 AC_MSG_WARN([Invalid JVM features: No gc selected for variant $variant.]) 570 fi 571 572 # Validate features (for configure script errors, not user errors) 573 BASIC_GET_NON_MATCHING_VALUES(INVALID_FEATURES, $JVM_FEATURES_FOR_VARIANT, $VALID_JVM_FEATURES) 574 if test "x$INVALID_FEATURES" != x; then 575 AC_MSG_ERROR([Internal configure script error. Invalid JVM feature(s): $INVALID_FEATURES]) 576 fi 577 done 578 ]) 579 580 ################################################################################ 581 # 582 # Specify which sources will be used to build the 64-bit ARM port 583 # 584 # --with-cpu-port=arm64 will use hotspot/src/cpu/arm 585 # --with-cpu-port=aarch64 will use hotspot/src/cpu/aarch64 586 # 587 AC_DEFUN([SETUP_HOTSPOT_TARGET_CPU_PORT], 588 [ 589 AC_ARG_WITH(cpu-port, [AS_HELP_STRING([--with-cpu-port], 590 [specify sources to use for Hotspot 64-bit ARM port (arm64,aarch64) @<:@aarch64@:>@ ])]) 591 592 if test "x$with_cpu_port" != x; then 593 if test "x$OPENJDK_TARGET_CPU" != xaarch64; then 594 AC_MSG_ERROR([--with-cpu-port only available on aarch64]) 595 fi 596 if test "x$with_cpu_port" != xarm64 && \ 597 test "x$with_cpu_port" != xaarch64; then 598 AC_MSG_ERROR([--with-cpu-port must specify arm64 or aarch64]) 599 fi 600 HOTSPOT_TARGET_CPU_PORT="$with_cpu_port" 601 fi 602 ]) 603 604 605 ################################################################################ 606 # Check if gtest should be built 607 # 608 AC_DEFUN_ONCE([HOTSPOT_ENABLE_DISABLE_GTEST], 609 [ 610 AC_ARG_ENABLE([hotspot-gtest], [AS_HELP_STRING([--disable-hotspot-gtest], 611 [Disables building of the Hotspot unit tests @<:@enabled@:>@])]) 612 613 if test -e "${TOPDIR}/test/hotspot/gtest"; then 614 GTEST_DIR_EXISTS="true" 615 else 616 GTEST_DIR_EXISTS="false" 617 fi 618 619 AC_MSG_CHECKING([if Hotspot gtest unit tests should be built]) 620 if test "x$enable_hotspot_gtest" = "xyes"; then 621 if test "x$GTEST_DIR_EXISTS" = "xtrue"; then 622 AC_MSG_RESULT([yes, forced]) 623 BUILD_GTEST="true" 624 else 625 AC_MSG_ERROR([Cannot build gtest without the test source]) 626 fi 627 elif test "x$enable_hotspot_gtest" = "xno"; then 628 AC_MSG_RESULT([no, forced]) 629 BUILD_GTEST="false" 630 elif test "x$enable_hotspot_gtest" = "x"; then 631 if test "x$GTEST_DIR_EXISTS" = "xtrue"; then 632 AC_MSG_RESULT([yes]) 633 BUILD_GTEST="true" 634 else 635 AC_MSG_RESULT([no]) 636 BUILD_GTEST="false" 637 fi 638 else 639 AC_MSG_ERROR([--enable-gtest must be either yes or no]) 640 fi 641 642 AC_SUBST(BUILD_GTEST) 643 ])