annotate make/autoconf/hotspot.m4 @ 49707:f7fd051519ac

8201591: JVM features with "-" in name is not correctly handled Reviewed-by: erikj
author ihse
date Tue, 17 Apr 2018 15:39:20 +0200
parents 68ac1caf3d7e
children 9042ffe5b7fe
rev   line source
erikj@13133 1 #
ihse@49120 2 # Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
erikj@13133 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
erikj@13133 4 #
erikj@13133 5 # This code is free software; you can redistribute it and/or modify it
erikj@13133 6 # under the terms of the GNU General Public License version 2 only, as
erikj@13133 7 # published by the Free Software Foundation. Oracle designates this
erikj@13133 8 # particular file as subject to the "Classpath" exception as provided
erikj@13133 9 # by Oracle in the LICENSE file that accompanied this code.
erikj@13133 10 #
erikj@13133 11 # This code is distributed in the hope that it will be useful, but WITHOUT
erikj@13133 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
erikj@13133 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
erikj@13133 14 # version 2 for more details (a copy is included in the LICENSE file that
erikj@13133 15 # accompanied this code).
erikj@13133 16 #
erikj@13133 17 # You should have received a copy of the GNU General Public License version
erikj@13133 18 # 2 along with this work; if not, write to the Free Software Foundation,
erikj@13133 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
erikj@13133 20 #
erikj@13133 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
erikj@13133 22 # or visit www.oracle.com if you need additional information or have any
erikj@13133 23 # questions.
erikj@13133 24 #
erikj@13133 25
erikj@37402 26 # All valid JVM features, regardless of platform
rkennke@47687 27 VALID_JVM_FEATURES="compiler1 compiler2 zero minimal dtrace jvmti jvmci \
gziemski@47061 28 graal vm-structs jni-check services management all-gcs nmt cds \
bobv@42538 29 static-build link-time-opt aot"
simonis@22460 30
erikj@37402 31 # All valid JVM variants
rkennke@47687 32 VALID_JVM_VARIANTS="server client minimal core zero custom"
simonis@22460 33
ihse@34596 34 ###############################################################################
erikj@37402 35 # Check if the specified JVM variant should be built. To be used in shell if
erikj@37402 36 # constructs, like this:
erikj@37402 37 # if HOTSPOT_CHECK_JVM_VARIANT(server); then
erikj@37402 38 #
erikj@37402 39 # Only valid to use after HOTSPOT_SETUP_JVM_VARIANTS has setup variants.
erikj@37402 40
erikj@37402 41 # Definition kept in one line to allow inlining in if statements.
erikj@37402 42 # Additional [] needed to keep m4 from mangling shell constructs.
erikj@37402 43 AC_DEFUN([HOTSPOT_CHECK_JVM_VARIANT],
erikj@37402 44 [ [ [[ " $JVM_VARIANTS " =~ " $1 " ]] ] ])
erikj@37402 45
erikj@37402 46 ###############################################################################
erikj@37402 47 # Check if the specified JVM features are explicitly enabled. To be used in
erikj@37402 48 # shell if constructs, like this:
erikj@37402 49 # if HOTSPOT_CHECK_JVM_FEATURE(jvmti); then
erikj@37402 50 #
erikj@37402 51 # Only valid to use after HOTSPOT_SETUP_JVM_FEATURES has setup features.
erikj@37402 52
erikj@37402 53 # Definition kept in one line to allow inlining in if statements.
erikj@37402 54 # Additional [] needed to keep m4 from mangling shell constructs.
erikj@37402 55 AC_DEFUN([HOTSPOT_CHECK_JVM_FEATURE],
erikj@37402 56 [ [ [[ " $JVM_FEATURES " =~ " $1 " ]] ] ])
erikj@37402 57
erikj@37402 58 ###############################################################################
erikj@37402 59 # Check which variants of the JVM that we want to build. Available variants are:
erikj@37402 60 # server: normal interpreter, and a tiered C1/C2 compiler
erikj@37402 61 # client: normal interpreter, and C1 (no C2 compiler)
erikj@37402 62 # minimal: reduced form of client with optional features stripped out
erikj@37402 63 # core: normal interpreter only, no compiler
erikj@37402 64 # zero: C++ based interpreter only, no compiler
erikj@37402 65 # custom: baseline JVM with no default features
erikj@37402 66 #
ihse@34596 67 AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_VARIANTS],
erikj@13133 68 [
ihse@20363 69 AC_ARG_WITH([jvm-variants], [AS_HELP_STRING([--with-jvm-variants],
rkennke@47687 70 [JVM variants (separated by commas) to build (server,client,minimal,core,zero,custom) @<:@server@:>@])])
erikj@13133 71
bobv@42538 72 SETUP_HOTSPOT_TARGET_CPU_PORT
bobv@42538 73
ihse@20363 74 if test "x$with_jvm_variants" = x; then
ihse@20363 75 with_jvm_variants="server"
ihse@20363 76 fi
erikj@37402 77 JVM_VARIANTS_OPT="$with_jvm_variants"
erikj@13133 78
erikj@37402 79 # Has the user listed more than one variant?
erikj@37402 80 # Additional [] needed to keep m4 from mangling shell constructs.
erikj@37402 81 if [ [[ "$JVM_VARIANTS_OPT" =~ "," ]] ]; then
erikj@37402 82 BUILDING_MULTIPLE_JVM_VARIANTS=true
erikj@37402 83 else
erikj@37402 84 BUILDING_MULTIPLE_JVM_VARIANTS=false
erikj@37402 85 fi
erikj@37402 86 # Replace the commas with AND for use in the build directory name.
erikj@37402 87 JVM_VARIANTS_WITH_AND=`$ECHO "$JVM_VARIANTS_OPT" | $SED -e 's/,/AND/g'`
erikj@13133 88
erikj@37402 89 AC_MSG_CHECKING([which variants of the JVM to build])
erikj@37402 90 # JVM_VARIANTS is a space-separated list.
erikj@37402 91 # Also use minimal, not minimal1 (which is kept for backwards compatibility).
erikj@37402 92 JVM_VARIANTS=`$ECHO $JVM_VARIANTS_OPT | $SED -e 's/,/ /g' -e 's/minimal1/minimal/'`
erikj@37402 93 AC_MSG_RESULT([$JVM_VARIANTS])
erikj@37402 94
erikj@37402 95 # Check that the selected variants are valid
ihse@49582 96 BASIC_GET_NON_MATCHING_VALUES(INVALID_VARIANTS, $JVM_VARIANTS, $VALID_JVM_VARIANTS)
erikj@37402 97 if test "x$INVALID_VARIANTS" != x; then
ihse@49582 98 AC_MSG_NOTICE([Unknown variant(s) specified: "$INVALID_VARIANTS"])
ihse@49582 99 AC_MSG_NOTICE([The available JVM variants are: "$VALID_JVM_VARIANTS"])
ihse@49582 100 AC_MSG_ERROR([Cannot continue])
ihse@20363 101 fi
erikj@13133 102
erikj@37402 103 # All "special" variants share the same output directory ("server")
erikj@37402 104 VALID_MULTIPLE_JVM_VARIANTS="server client minimal"
ihse@49582 105 BASIC_GET_NON_MATCHING_VALUES(INVALID_MULTIPLE_VARIANTS, $JVM_VARIANTS, $VALID_MULTIPLE_JVM_VARIANTS)
erikj@37402 106 if test "x$INVALID_MULTIPLE_VARIANTS" != x && test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = xtrue; then
erikj@37402 107 AC_MSG_ERROR([You cannot build multiple variants with anything else than $VALID_MULTIPLE_JVM_VARIANTS.])
erikj@37402 108 fi
erikj@13133 109
erikj@42510 110 # The "main" variant is the one used by other libs to link against during the
erikj@42510 111 # build.
erikj@42510 112 if test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = "xtrue"; then
erikj@42510 113 MAIN_VARIANT_PRIO_ORDER="server client minimal"
erikj@42510 114 for variant in $MAIN_VARIANT_PRIO_ORDER; do
erikj@42510 115 if HOTSPOT_CHECK_JVM_VARIANT($variant); then
erikj@42510 116 JVM_VARIANT_MAIN="$variant"
erikj@42510 117 break
erikj@42510 118 fi
erikj@42510 119 done
erikj@42510 120 else
erikj@42510 121 JVM_VARIANT_MAIN="$JVM_VARIANTS"
erikj@42510 122 fi
erikj@42510 123
erikj@37402 124 AC_SUBST(JVM_VARIANTS)
erikj@37402 125 AC_SUBST(VALID_JVM_VARIANTS)
erikj@42510 126 AC_SUBST(JVM_VARIANT_MAIN)
erikj@37402 127
rkennke@47687 128 if HOTSPOT_CHECK_JVM_VARIANT(zero); then
erikj@37402 129 # zero behaves as a platform and rewrites these values. This is really weird. :(
erikj@37402 130 # We are guaranteed that we do not build any other variants when building zero.
erikj@37402 131 HOTSPOT_TARGET_CPU=zero
erikj@37402 132 HOTSPOT_TARGET_CPU_ARCH=zero
erikj@37402 133 fi
erikj@37402 134 ])
erikj@37402 135
erikj@37402 136 ###############################################################################
erikj@37402 137 # Check if dtrace should be enabled and has all prerequisites present.
erikj@37402 138 #
erikj@37402 139 AC_DEFUN_ONCE([HOTSPOT_SETUP_DTRACE],
erikj@37402 140 [
erikj@37402 141 # Test for dtrace dependencies
erikj@37402 142 AC_ARG_ENABLE([dtrace], [AS_HELP_STRING([--enable-dtrace@<:@=yes/no/auto@:>@],
erikj@37402 143 [enable dtrace. Default is auto, where dtrace is enabled if all dependencies
erikj@37402 144 are present.])])
erikj@37402 145
erikj@37402 146 DTRACE_DEP_MISSING=false
erikj@37402 147
erikj@37402 148 AC_MSG_CHECKING([for dtrace tool])
erikj@37402 149 if test "x$DTRACE" != "x" && test -x "$DTRACE"; then
erikj@37402 150 AC_MSG_RESULT([$DTRACE])
erikj@37402 151 else
erikj@37402 152 AC_MSG_RESULT([not found, cannot build dtrace])
erikj@37402 153 DTRACE_DEP_MISSING=true
erikj@37402 154 fi
erikj@37402 155
erikj@37402 156 AC_CHECK_HEADERS([sys/sdt.h], [DTRACE_HEADERS_OK=yes],[DTRACE_HEADERS_OK=no])
erikj@37402 157 if test "x$DTRACE_HEADERS_OK" != "xyes"; then
erikj@37402 158 DTRACE_DEP_MISSING=true
erikj@37402 159 fi
erikj@37402 160
erikj@37402 161 AC_MSG_CHECKING([if dtrace should be built])
erikj@37402 162 if test "x$enable_dtrace" = "xyes"; then
erikj@37402 163 if test "x$DTRACE_DEP_MISSING" = "xtrue"; then
erikj@37402 164 AC_MSG_RESULT([no, missing dependencies])
erikj@37402 165 HELP_MSG_MISSING_DEPENDENCY([dtrace])
erikj@37402 166 AC_MSG_ERROR([Cannot enable dtrace with missing dependencies. See above. $HELP_MSG])
erikj@37402 167 else
erikj@37402 168 INCLUDE_DTRACE=true
erikj@37402 169 AC_MSG_RESULT([yes, forced])
erikj@13133 170 fi
erikj@37402 171 elif test "x$enable_dtrace" = "xno"; then
erikj@37402 172 INCLUDE_DTRACE=false
erikj@37402 173 AC_MSG_RESULT([no, forced])
erikj@37402 174 elif test "x$enable_dtrace" = "xauto" || test "x$enable_dtrace" = "x"; then
erikj@39384 175 if test "x$DTRACE_DEP_MISSING" = "xtrue"; then
erikj@37402 176 INCLUDE_DTRACE=false
erikj@37402 177 AC_MSG_RESULT([no, missing dependencies])
erikj@37402 178 else
erikj@37402 179 INCLUDE_DTRACE=true
erikj@37402 180 AC_MSG_RESULT([yes, dependencies present])
erikj@37402 181 fi
erikj@37402 182 else
erikj@37402 183 AC_MSG_ERROR([Invalid value for --enable-dtrace: $enable_dtrace])
ihse@20363 184 fi
erikj@37402 185 ])
erikj@37402 186
kvn@42532 187 ################################################################################
kvn@42532 188 # Check if AOT should be enabled
kvn@42532 189 #
kvn@42532 190 AC_DEFUN_ONCE([HOTSPOT_ENABLE_DISABLE_AOT],
kvn@42532 191 [
kvn@42532 192 AC_ARG_ENABLE([aot], [AS_HELP_STRING([--enable-aot@<:@=yes/no/auto@:>@],
kvn@42532 193 [enable ahead of time compilation feature. Default is auto, where aot is enabled if all dependencies are present.])])
kvn@42532 194
kvn@42532 195 if test "x$enable_aot" = "x" || test "x$enable_aot" = "xauto"; then
kvn@42532 196 ENABLE_AOT="true"
kvn@42532 197 elif test "x$enable_aot" = "xyes"; then
kvn@42532 198 ENABLE_AOT="true"
kvn@42532 199 elif test "x$enable_aot" = "xno"; then
kvn@42532 200 ENABLE_AOT="false"
kvn@42532 201 AC_MSG_CHECKING([if aot should be enabled])
kvn@42532 202 AC_MSG_RESULT([no, forced])
kvn@42532 203 else
kvn@42532 204 AC_MSG_ERROR([Invalid value for --enable-aot: $enable_aot])
kvn@42532 205 fi
kvn@42532 206
kvn@42532 207 if test "x$ENABLE_AOT" = "xtrue"; then
bobv@46191 208 # Only enable AOT on X64 platforms.
bobv@46233 209 if test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then
erikj@47217 210 if test -e "${TOPDIR}/src/jdk.aot"; then
erikj@47217 211 if test -e "${TOPDIR}/src/jdk.internal.vm.compiler"; then
kvn@42532 212 ENABLE_AOT="true"
kvn@42532 213 else
kvn@42532 214 ENABLE_AOT="false"
kvn@42532 215 if test "x$enable_aot" = "xyes"; then
erikj@47217 216 AC_MSG_ERROR([Cannot build AOT without src/jdk.internal.vm.compiler sources. Remove --enable-aot.])
kvn@42532 217 fi
kvn@42532 218 fi
kvn@42532 219 else
kvn@42532 220 ENABLE_AOT="false"
kvn@42532 221 if test "x$enable_aot" = "xyes"; then
erikj@47217 222 AC_MSG_ERROR([Cannot build AOT without src/jdk.aot sources. Remove --enable-aot.])
kvn@42532 223 fi
kvn@42532 224 fi
kvn@42532 225 else
kvn@42532 226 ENABLE_AOT="false"
kvn@42532 227 if test "x$enable_aot" = "xyes"; then
kvn@46218 228 AC_MSG_ERROR([AOT is currently only supported on x86_64. Remove --enable-aot.])
kvn@42532 229 fi
kvn@42532 230 fi
kvn@42532 231 fi
kvn@42532 232
kvn@42532 233 AC_SUBST(ENABLE_AOT)
kvn@42532 234 ])
kvn@42532 235
goetz@47060 236 ################################################################################
goetz@47060 237 # Allow to disable CDS
goetz@47060 238 #
goetz@47060 239 AC_DEFUN_ONCE([HOTSPOT_ENABLE_DISABLE_CDS],
goetz@47060 240 [
goetz@47060 241 AC_ARG_ENABLE([cds], [AS_HELP_STRING([--enable-cds@<:@=yes/no@:>@],
goetz@47060 242 [enable class data sharing feature in non-minimal VM. Default is yes.])])
goetz@47060 243
goetz@47060 244 if test "x$enable_cds" = "x" || test "x$enable_cds" = "xyes"; then
goetz@47060 245 ENABLE_CDS="true"
goetz@47060 246 elif test "x$enable_cds" = "xno"; then
goetz@47060 247 ENABLE_CDS="false"
goetz@47060 248 else
goetz@47060 249 AC_MSG_ERROR([Invalid value for --enable-cds: $enable_cds])
goetz@47060 250 fi
goetz@47060 251
goetz@47060 252 AC_SUBST(ENABLE_CDS)
goetz@47060 253 ])
goetz@47060 254
erikj@37402 255 ###############################################################################
erikj@37402 256 # Set up all JVM features for each JVM variant.
erikj@37402 257 #
erikj@37402 258 AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_FEATURES],
erikj@37402 259 [
ihse@49582 260 # Prettify the VALID_JVM_FEATURES string
ihse@49582 261 BASIC_SORT_LIST(VALID_JVM_FEATURES, $VALID_JVM_FEATURES)
ihse@49582 262
erikj@37402 263 # The user can in some cases supply additional jvm features. For the custom
erikj@37402 264 # variant, this defines the entire variant.
erikj@37402 265 AC_ARG_WITH([jvm-features], [AS_HELP_STRING([--with-jvm-features],
ihse@49582 266 [JVM features to enable (foo) or disable (-foo), separated by comma. Use '--help' to show possible values @<:@none@:>@])])
erikj@37402 267 if test "x$with_jvm_features" != x; then
ihse@49582 268 AC_MSG_CHECKING([user specified JVM feature list])
ihse@49582 269 USER_JVM_FEATURE_LIST=`$ECHO $with_jvm_features | $SED -e 's/,/ /g'`
ihse@49582 270 AC_MSG_RESULT([$user_jvm_feature_list])
ihse@49582 271 # These features will be added to all variant defaults
ihse@49707 272 JVM_FEATURES=`$ECHO $USER_JVM_FEATURE_LIST | $AWK '{ for (i=1; i<=NF; i++) if (!match($i, /^-.*/)) print $i }'`
ihse@49582 273 # These features will be removed from all variant defaults
ihse@49707 274 DISABLED_JVM_FEATURES=`$ECHO $USER_JVM_FEATURE_LIST | $AWK '{ for (i=1; i<=NF; i++) if (match($i, /^-.*/)) print substr($i, 2) }'`
ihse@49582 275
ihse@49582 276 # Verify that the user has provided valid features
ihse@49582 277 BASIC_GET_NON_MATCHING_VALUES(INVALID_FEATURES, $JVM_FEATURES $DISABLED_JVM_FEATURES, $VALID_JVM_FEATURES)
ihse@49582 278 if test "x$INVALID_FEATURES" != x; then
ihse@49582 279 AC_MSG_NOTICE([Unknown JVM features specified: "$INVALID_FEATURES"])
ihse@49582 280 AC_MSG_NOTICE([The available JVM features are: "$VALID_JVM_FEATURES"])
ihse@49582 281 AC_MSG_ERROR([Cannot continue])
ihse@49582 282 fi
ihse@49582 283
erikj@37402 284 fi
erikj@37402 285
bobv@42538 286 # Override hotspot cpu definitions for ARM platforms
bobv@42538 287 if test "x$OPENJDK_TARGET_CPU" = xarm; then
bobv@42538 288 HOTSPOT_TARGET_CPU=arm_32
bobv@42538 289 HOTSPOT_TARGET_CPU_DEFINE="ARM32"
bobv@42538 290 elif test "x$OPENJDK_TARGET_CPU" = xaarch64 && test "x$HOTSPOT_TARGET_CPU_PORT" = xarm64; then
bobv@42538 291 HOTSPOT_TARGET_CPU=arm_64
bobv@42538 292 HOTSPOT_TARGET_CPU_ARCH=arm
bobv@42538 293 fi
bobv@42538 294
erikj@37402 295 # Verify that dependencies are met for explicitly set features.
erikj@37402 296 if HOTSPOT_CHECK_JVM_FEATURE(jvmti) && ! HOTSPOT_CHECK_JVM_FEATURE(services); then
erikj@37402 297 AC_MSG_ERROR([Specified JVM feature 'jvmti' requires feature 'services'])
erikj@37402 298 fi
erikj@37402 299
erikj@37402 300 if HOTSPOT_CHECK_JVM_FEATURE(management) && ! HOTSPOT_CHECK_JVM_FEATURE(nmt); then
erikj@37402 301 AC_MSG_ERROR([Specified JVM feature 'management' requires feature 'nmt'])
erikj@37402 302 fi
erikj@37402 303
dnsimon@39946 304 if HOTSPOT_CHECK_JVM_FEATURE(jvmci) && ! (HOTSPOT_CHECK_JVM_FEATURE(compiler1) || HOTSPOT_CHECK_JVM_FEATURE(compiler2)); then
dnsimon@39946 305 AC_MSG_ERROR([Specified JVM feature 'jvmci' requires feature 'compiler2' or 'compiler1'])
erikj@37402 306 fi
erikj@37402 307
erikj@37402 308 if HOTSPOT_CHECK_JVM_FEATURE(compiler2) && ! HOTSPOT_CHECK_JVM_FEATURE(all-gcs); then
erikj@37402 309 AC_MSG_ERROR([Specified JVM feature 'compiler2' requires feature 'all-gcs'])
erikj@37402 310 fi
erikj@37402 311
erikj@37402 312 if HOTSPOT_CHECK_JVM_FEATURE(vm-structs) && ! HOTSPOT_CHECK_JVM_FEATURE(all-gcs); then
erikj@37402 313 AC_MSG_ERROR([Specified JVM feature 'vm-structs' requires feature 'all-gcs'])
erikj@37402 314 fi
erikj@37402 315
erikj@37402 316 # Turn on additional features based on other parts of configure
erikj@37402 317 if test "x$INCLUDE_DTRACE" = "xtrue"; then
erikj@37402 318 JVM_FEATURES="$JVM_FEATURES dtrace"
erikj@37402 319 else
erikj@37402 320 if HOTSPOT_CHECK_JVM_FEATURE(dtrace); then
erikj@37402 321 AC_MSG_ERROR([To enable dtrace, you must use --enable-dtrace])
dholmes@14810 322 fi
ihse@20363 323 fi
erikj@13133 324
erikj@37402 325 if test "x$STATIC_BUILD" = "xtrue"; then
erikj@37402 326 JVM_FEATURES="$JVM_FEATURES static-build"
ihse@20363 327 else
erikj@37402 328 if HOTSPOT_CHECK_JVM_FEATURE(static-build); then
erikj@37402 329 AC_MSG_ERROR([To enable static-build, you must use --enable-static-build])
erikj@37402 330 fi
ihse@20363 331 fi
erikj@13133 332
rkennke@47687 333 if ! HOTSPOT_CHECK_JVM_VARIANT(zero); then
erikj@37402 334 if HOTSPOT_CHECK_JVM_FEATURE(zero); then
rkennke@47687 335 AC_MSG_ERROR([To enable zero, you must use --with-jvm-variants=zero])
erikj@37402 336 fi
erikj@37402 337 fi
erikj@37402 338
dnsimon@39946 339 # Only enable jvmci on x86_64, sparcv9 and aarch64.
erikj@37402 340 if test "x$OPENJDK_TARGET_CPU" = "xx86_64" || \
kvn@42531 341 test "x$OPENJDK_TARGET_CPU" = "xsparcv9" || \
kvn@42531 342 test "x$OPENJDK_TARGET_CPU" = "xaarch64" ; then
erikj@37402 343 JVM_FEATURES_jvmci="jvmci"
erikj@37402 344 else
erikj@37402 345 JVM_FEATURES_jvmci=""
erikj@37402 346 fi
erikj@37402 347
kvn@43925 348 AC_MSG_CHECKING([if jdk.internal.vm.compiler should be built])
kvn@42531 349 if HOTSPOT_CHECK_JVM_FEATURE(graal); then
kvn@42531 350 AC_MSG_RESULT([yes, forced])
kvn@42531 351 if test "x$JVM_FEATURES_jvmci" != "xjvmci" ; then
kvn@42531 352 AC_MSG_ERROR([Specified JVM feature 'graal' requires feature 'jvmci'])
kvn@42531 353 fi
kvn@42531 354 INCLUDE_GRAAL="true"
kvn@42531 355 else
kvn@49485 356 # By default enable graal build on x64 or where AOT is available.
kvn@47056 357 # graal build requires jvmci.
kvn@47056 358 if test "x$JVM_FEATURES_jvmci" = "xjvmci" && \
kvn@49485 359 (test "x$OPENJDK_TARGET_CPU" = "xx86_64" || \
kvn@47056 360 test "x$ENABLE_AOT" = "xtrue") ; then
kvn@42531 361 AC_MSG_RESULT([yes])
kvn@42531 362 JVM_FEATURES_graal="graal"
kvn@42531 363 INCLUDE_GRAAL="true"
kvn@42531 364 else
kvn@42531 365 AC_MSG_RESULT([no])
kvn@42531 366 JVM_FEATURES_graal=""
kvn@42531 367 INCLUDE_GRAAL="false"
kvn@42531 368 fi
kvn@42531 369 fi
kvn@42531 370
kvn@42531 371 AC_SUBST(INCLUDE_GRAAL)
kvn@42531 372
kvn@42532 373 AC_MSG_CHECKING([if aot should be enabled])
kvn@42532 374 if test "x$ENABLE_AOT" = "xtrue"; then
kvn@42532 375 if test "x$enable_aot" = "xyes"; then
kvn@42532 376 AC_MSG_RESULT([yes, forced])
kvn@42532 377 else
kvn@42532 378 AC_MSG_RESULT([yes])
kvn@42532 379 fi
kvn@42532 380 JVM_FEATURES_aot="aot"
kvn@42532 381 else
kvn@42532 382 if test "x$enable_aot" = "xno"; then
kvn@42532 383 AC_MSG_RESULT([no, forced])
kvn@42532 384 else
kvn@42532 385 AC_MSG_RESULT([no])
kvn@42532 386 fi
kvn@42532 387 JVM_FEATURES_aot=""
kvn@42532 388 fi
kvn@42532 389
bobv@42538 390 if test "x$OPENJDK_TARGET_CPU" = xarm ; then
bobv@42538 391 # Default to use link time optimizations on minimal on arm
bobv@42538 392 JVM_FEATURES_link_time_opt="link-time-opt"
bobv@42538 393 else
bobv@42538 394 JVM_FEATURES_link_time_opt=""
bobv@42538 395 fi
bobv@42538 396
erikj@37402 397 # All variants but minimal (and custom) get these features
gziemski@47061 398 NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES jvmti vm-structs jni-check services management all-gcs nmt"
goetz@47060 399 if test "x$ENABLE_CDS" = "xtrue"; then
goetz@47060 400 NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES cds"
ihse@47871 401 fi
erikj@37402 402
ihse@49582 403 # Enable default features depending on variant.
kvn@42532 404 JVM_FEATURES_server="compiler1 compiler2 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci $JVM_FEATURES_aot $JVM_FEATURES_graal"
dnsimon@39946 405 JVM_FEATURES_client="compiler1 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci"
erikj@37402 406 JVM_FEATURES_core="$NON_MINIMAL_FEATURES $JVM_FEATURES"
bobv@42538 407 JVM_FEATURES_minimal="compiler1 minimal $JVM_FEATURES $JVM_FEATURES_link_time_opt"
erikj@37402 408 JVM_FEATURES_zero="zero $NON_MINIMAL_FEATURES $JVM_FEATURES"
erikj@37402 409 JVM_FEATURES_custom="$JVM_FEATURES"
erikj@37402 410
erikj@37402 411 AC_SUBST(JVM_FEATURES_server)
erikj@37402 412 AC_SUBST(JVM_FEATURES_client)
erikj@37402 413 AC_SUBST(JVM_FEATURES_core)
erikj@37402 414 AC_SUBST(JVM_FEATURES_minimal)
erikj@37402 415 AC_SUBST(JVM_FEATURES_zero)
erikj@37402 416 AC_SUBST(JVM_FEATURES_custom)
erikj@37402 417
erikj@37402 418 # Used for verification of Makefiles by check-jvm-feature
erikj@37402 419 AC_SUBST(VALID_JVM_FEATURES)
erikj@37402 420
erikj@37402 421 # We don't support --with-jvm-interpreter anymore, use zero instead.
erikj@37402 422 BASIC_DEPRECATED_ARG_WITH(jvm-interpreter)
erikj@37402 423 ])
erikj@37402 424
erikj@37402 425 ###############################################################################
ihse@49582 426 # Finalize JVM features once all setup is complete, including custom setup.
erikj@37402 427 #
ihse@49582 428 AC_DEFUN_ONCE([HOTSPOT_FINALIZE_JVM_FEATURES],
erikj@37402 429 [
erikj@37402 430 for variant in $JVM_VARIANTS; do
erikj@37402 431 AC_MSG_CHECKING([JVM features for JVM variant '$variant'])
erikj@37402 432 features_var_name=JVM_FEATURES_$variant
ihse@49582 433 JVM_FEATURES_FOR_VARIANT=${!features_var_name}
ihse@49582 434
ihse@49582 435 # Filter out user-requested disabled features
ihse@49582 436 BASIC_GET_NON_MATCHING_VALUES(JVM_FEATURES_FOR_VARIANT, $JVM_FEATURES_FOR_VARIANT, $DISABLED_JVM_FEATURES)
ihse@49582 437
ihse@49582 438 # Keep feature lists sorted and free of duplicates
ihse@49582 439 BASIC_SORT_LIST(JVM_FEATURES_FOR_VARIANT, $JVM_FEATURES_FOR_VARIANT)
ihse@49582 440
ihse@49582 441 # Update real feature set variable
ihse@49582 442 eval $features_var_name='"'$JVM_FEATURES_FOR_VARIANT'"'
ihse@49582 443 AC_MSG_RESULT(["$JVM_FEATURES_FOR_VARIANT"])
ihse@49582 444
ihse@49582 445 # Validate features (for configure script errors, not user errors)
goetz@49705 446 BASIC_GET_NON_MATCHING_VALUES(INVALID_FEATURES, $JVM_FEATURES_FOR_VARIANT, $VALID_JVM_FEATURES)
erikj@37402 447 if test "x$INVALID_FEATURES" != x; then
ihse@49582 448 AC_MSG_ERROR([Internal configure script error. Invalid JVM feature(s): $INVALID_FEATURES])
erikj@37402 449 fi
erikj@37402 450 done
erikj@37402 451 ])
erikj@37978 452
erikj@37978 453 ################################################################################
bobv@42538 454 #
bobv@42538 455 # Specify which sources will be used to build the 64-bit ARM port
bobv@42538 456 #
bobv@42538 457 # --with-cpu-port=arm64 will use hotspot/src/cpu/arm
bobv@42538 458 # --with-cpu-port=aarch64 will use hotspot/src/cpu/aarch64
bobv@42538 459 #
bobv@42538 460 AC_DEFUN([SETUP_HOTSPOT_TARGET_CPU_PORT],
bobv@42538 461 [
bobv@42538 462 AC_ARG_WITH(cpu-port, [AS_HELP_STRING([--with-cpu-port],
bobv@42538 463 [specify sources to use for Hotspot 64-bit ARM port (arm64,aarch64) @<:@aarch64@:>@ ])])
bobv@42538 464
bobv@42538 465 if test "x$with_cpu_port" != x; then
bobv@42538 466 if test "x$OPENJDK_TARGET_CPU" != xaarch64; then
bobv@42538 467 AC_MSG_ERROR([--with-cpu-port only available on aarch64])
bobv@42538 468 fi
bobv@42538 469 if test "x$with_cpu_port" != xarm64 && \
bobv@42538 470 test "x$with_cpu_port" != xaarch64; then
bobv@42538 471 AC_MSG_ERROR([--with-cpu-port must specify arm64 or aarch64])
bobv@42538 472 fi
bobv@42538 473 HOTSPOT_TARGET_CPU_PORT="$with_cpu_port"
bobv@42538 474 fi
bobv@42538 475 ])
bobv@42538 476
bobv@42538 477
bobv@42538 478 ################################################################################
erikj@37978 479 # Check if gtest should be built
erikj@37978 480 #
erikj@37978 481 AC_DEFUN_ONCE([HOTSPOT_ENABLE_DISABLE_GTEST],
erikj@37978 482 [
erikj@37978 483 AC_ARG_ENABLE([hotspot-gtest], [AS_HELP_STRING([--disable-hotspot-gtest],
ihse@47871 484 [Disables building of the Hotspot unit tests @<:@enabled@:>@])])
erikj@37978 485
erikj@47217 486 if test -e "${TOPDIR}/test/hotspot/gtest"; then
erikj@37978 487 GTEST_DIR_EXISTS="true"
erikj@37978 488 else
erikj@37978 489 GTEST_DIR_EXISTS="false"
erikj@37978 490 fi
erikj@37978 491
erikj@37978 492 AC_MSG_CHECKING([if Hotspot gtest unit tests should be built])
erikj@37978 493 if test "x$enable_hotspot_gtest" = "xyes"; then
erikj@37978 494 if test "x$GTEST_DIR_EXISTS" = "xtrue"; then
erikj@37978 495 AC_MSG_RESULT([yes, forced])
erikj@37978 496 BUILD_GTEST="true"
erikj@37978 497 else
erikj@37978 498 AC_MSG_ERROR([Cannot build gtest without the test source])
erikj@37978 499 fi
erikj@37978 500 elif test "x$enable_hotspot_gtest" = "xno"; then
erikj@37978 501 AC_MSG_RESULT([no, forced])
erikj@37978 502 BUILD_GTEST="false"
erikj@37978 503 elif test "x$enable_hotspot_gtest" = "x"; then
stuefe@42855 504 if test "x$GTEST_DIR_EXISTS" = "xtrue"; then
erikj@37978 505 AC_MSG_RESULT([yes])
erikj@37978 506 BUILD_GTEST="true"
erikj@37978 507 else
erikj@37978 508 AC_MSG_RESULT([no])
erikj@37978 509 BUILD_GTEST="false"
erikj@37978 510 fi
erikj@37978 511 else
erikj@37978 512 AC_MSG_ERROR([--enable-gtest must be either yes or no])
erikj@37978 513 fi
erikj@37978 514
erikj@37978 515 AC_SUBST(BUILD_GTEST)
erikj@37978 516 ])