1 #
   2 # Copyright (c) 2011, 2017, 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 ###############################################################################
  27 # Check which variant of the JDK that we want to build.
  28 # Currently we have:
  29 #    normal:   standard edition
  30 # but the custom make system may add other variants
  31 #
  32 # Effectively the JDK variant gives a name to a specific set of
  33 # modules to compile into the JDK.
  34 AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_VARIANT],
  35 [
  36   AC_MSG_CHECKING([which variant of the JDK to build])
  37   AC_ARG_WITH([jdk-variant], [AS_HELP_STRING([--with-jdk-variant],
  38       [JDK variant to build (normal) @<:@normal@:>@])])
  39 
  40   if test "x$with_jdk_variant" = xnormal || test "x$with_jdk_variant" = x; then
  41     JDK_VARIANT="normal"
  42   else
  43     AC_MSG_ERROR([The available JDK variants are: normal])
  44   fi
  45 
  46   AC_SUBST(JDK_VARIANT)
  47 
  48   AC_MSG_RESULT([$JDK_VARIANT])
  49 ])
  50 
  51 ###############################################################################
  52 # Set the debug level
  53 #    release: no debug information, all optimizations, no asserts.
  54 #    optimized: no debug information, all optimizations, no asserts, HotSpot target is 'optimized'.
  55 #    fastdebug: debug information (-g), all optimizations, all asserts
  56 #    slowdebug: debug information (-g), no optimizations, all asserts
  57 AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_LEVEL],
  58 [
  59   DEBUG_LEVEL="release"
  60   AC_MSG_CHECKING([which debug level to use])
  61   AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug],
  62       [set the debug level to fastdebug (shorthand for --with-debug-level=fastdebug) @<:@disabled@:>@])],
  63       [
  64         ENABLE_DEBUG="${enableval}"
  65         DEBUG_LEVEL="fastdebug"
  66       ], [ENABLE_DEBUG="no"])
  67 
  68   AC_ARG_WITH([debug-level], [AS_HELP_STRING([--with-debug-level],
  69       [set the debug level (release, fastdebug, slowdebug, optimized) @<:@release@:>@])],
  70       [
  71         DEBUG_LEVEL="${withval}"
  72         if test "x$ENABLE_DEBUG" = xyes; then
  73           AC_MSG_ERROR([You cannot use both --enable-debug and --with-debug-level at the same time.])
  74         fi
  75       ])
  76   AC_MSG_RESULT([$DEBUG_LEVEL])
  77 
  78   if test "x$DEBUG_LEVEL" != xrelease && \
  79       test "x$DEBUG_LEVEL" != xoptimized && \
  80       test "x$DEBUG_LEVEL" != xfastdebug && \
  81       test "x$DEBUG_LEVEL" != xslowdebug; then
  82     AC_MSG_ERROR([Allowed debug levels are: release, fastdebug, slowdebug and optimized])
  83   fi
  84 
  85   # Translate DEBUG_LEVEL to debug level used by Hotspot
  86   HOTSPOT_DEBUG_LEVEL="$DEBUG_LEVEL"
  87   if test "x$DEBUG_LEVEL" = xrelease; then
  88     HOTSPOT_DEBUG_LEVEL="product"
  89   elif test "x$DEBUG_LEVEL" = xslowdebug; then
  90     HOTSPOT_DEBUG_LEVEL="debug"
  91   fi
  92 
  93   if test "x$DEBUG_LEVEL" = xoptimized; then
  94     # The debug level 'optimized' is a little special because it is currently only
  95     # applicable to the HotSpot build where it means to build a completely
  96     # optimized version of the VM without any debugging code (like for the
  97     # 'release' debug level which is called 'product' in the HotSpot build) but
  98     # with the exception that it can contain additional code which is otherwise
  99     # protected by '#ifndef PRODUCT' macros. These 'optimized' builds are used to
 100     # test new and/or experimental features which are not intended for customer
 101     # shipment. Because these new features need to be tested and benchmarked in
 102     # real world scenarios, we want to build the containing JDK at the 'release'
 103     # debug level.
 104     DEBUG_LEVEL="release"
 105   fi
 106 
 107   AC_SUBST(HOTSPOT_DEBUG_LEVEL)
 108   AC_SUBST(DEBUG_LEVEL)
 109 ])
 110 
 111 ###############################################################################
 112 #
 113 # Should we build only OpenJDK even if closed sources are present?
 114 #
 115 AC_DEFUN_ONCE([JDKOPT_SETUP_OPEN_OR_CUSTOM],
 116 [
 117   AC_ARG_ENABLE([openjdk-only], [AS_HELP_STRING([--enable-openjdk-only],
 118       [suppress building custom source even if present @<:@disabled@:>@])],,[enable_openjdk_only="no"])
 119 
 120   AC_MSG_CHECKING([if custom source is suppressed (openjdk-only)])
 121   AC_MSG_RESULT([$enable_openjdk_only])
 122   if test "x$enable_openjdk_only" = "xyes"; then
 123     SUPPRESS_CUSTOM_EXTENSIONS="true"
 124   elif test "x$enable_openjdk_only" = "xno"; then
 125     SUPPRESS_CUSTOM_EXTENSIONS="false"
 126   else
 127     AC_MSG_ERROR([Invalid value for --enable-openjdk-only: $enable_openjdk_only])
 128   fi
 129 
 130   # custom-make-dir is deprecated. Please use your custom-hook.m4 to override
 131   # the IncludeCustomExtension macro.
 132   BASIC_DEPRECATED_ARG_WITH(custom-make-dir)
 133 ])
 134 
 135 AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS],
 136 [
 137   # Should we build a JDK without a graphical UI?
 138   AC_MSG_CHECKING([headless only])
 139   AC_ARG_ENABLE([headless-only], [AS_HELP_STRING([--enable-headless-only],
 140       [only build headless (no GUI) support @<:@disabled@:>@])])
 141 
 142   if test "x$enable_headless_only" = "xyes"; then
 143     ENABLE_HEADLESS_ONLY="true"
 144     AC_MSG_RESULT([yes])
 145   elif test "x$enable_headless_only" = "xno"; then
 146     ENABLE_HEADLESS_ONLY="false"
 147     AC_MSG_RESULT([no])
 148   elif test "x$enable_headless_only" = "x"; then
 149     ENABLE_HEADLESS_ONLY="false"
 150     AC_MSG_RESULT([no])
 151   else
 152     AC_MSG_ERROR([--enable-headless-only can only take yes or no])
 153   fi
 154 
 155   AC_SUBST(ENABLE_HEADLESS_ONLY)
 156 
 157   # Should we build the complete docs, or just a lightweight version?
 158   AC_ARG_ENABLE([full-docs], [AS_HELP_STRING([--enable-full-docs],
 159       [build complete documentation @<:@enabled if all tools found@:>@])])
 160 
 161   # Verify dependencies
 162   AC_MSG_CHECKING([for graphviz dot])
 163   if test "x$DOT" != "x"; then
 164     AC_MSG_RESULT([yes])
 165   else
 166     AC_MSG_RESULT([no, cannot generate full docs])
 167     FULL_DOCS_DEP_MISSING=true
 168   fi
 169 
 170   AC_MSG_CHECKING([for pandoc])
 171   if test "x$PANDOC" != "x"; then
 172     AC_MSG_RESULT([yes])
 173   else
 174     AC_MSG_RESULT([no, cannot generate full docs])
 175     FULL_DOCS_DEP_MISSING=true
 176   fi
 177 
 178   AC_MSG_CHECKING([full docs])
 179   if test "x$enable_full_docs" = xyes; then
 180     if test "x$FULL_DOCS_DEP_MISSING" = "xtrue"; then
 181       AC_MSG_RESULT([no, missing dependencies])
 182       HELP_MSG_MISSING_DEPENDENCY([dot])
 183       AC_MSG_ERROR([Cannot enable full docs with missing dependencies. See above. $HELP_MSG])
 184     else
 185       ENABLE_FULL_DOCS=true
 186       AC_MSG_RESULT([yes, forced])
 187     fi
 188   elif test "x$enable_full_docs" = xno; then
 189     ENABLE_FULL_DOCS=false
 190     AC_MSG_RESULT([no, forced])
 191   elif test "x$enable_full_docs" = x; then
 192     # Check for prerequisites
 193     if test "x$FULL_DOCS_DEP_MISSING" = xtrue; then
 194       ENABLE_FULL_DOCS=false
 195       AC_MSG_RESULT([no, missing dependencies])
 196     else
 197       ENABLE_FULL_DOCS=true
 198       AC_MSG_RESULT([yes, dependencies present])
 199     fi
 200   else
 201     AC_MSG_ERROR([--enable-full-docs can only take yes or no])
 202   fi
 203 
 204   AC_SUBST(ENABLE_FULL_DOCS)
 205 
 206   # Choose cacerts source file
 207   AC_ARG_WITH(cacerts-file, [AS_HELP_STRING([--with-cacerts-file],
 208       [specify alternative cacerts file])])
 209   AC_MSG_CHECKING([for cacerts file])
 210   if test "x$with_cacerts_file" == x; then
 211     AC_MSG_RESULT([default])
 212   else
 213     CACERTS_FILE=$with_cacerts_file
 214     if test ! -f "$CACERTS_FILE"; then
 215       AC_MSG_RESULT([fail])
 216       AC_MSG_ERROR([Specified cacerts file "$CACERTS_FILE" does not exist])
 217     fi
 218     AC_MSG_RESULT([$CACERTS_FILE])
 219   fi
 220   AC_SUBST(CACERTS_FILE)
 221 
 222   # Enable or disable unlimited crypto
 223   AC_ARG_ENABLE(unlimited-crypto, [AS_HELP_STRING([--disable-unlimited-crypto],
 224       [Disable unlimited crypto policy @<:@enabled@:>@])],,
 225       [enable_unlimited_crypto=yes])
 226   if test "x$enable_unlimited_crypto" = "xyes"; then
 227     UNLIMITED_CRYPTO=true
 228   else
 229     UNLIMITED_CRYPTO=false
 230   fi
 231   AC_SUBST(UNLIMITED_CRYPTO)
 232 
 233   # Should we build the serviceability agent (SA)?
 234   INCLUDE_SA=true
 235   if HOTSPOT_CHECK_JVM_VARIANT(zero); then
 236     INCLUDE_SA=false
 237   fi
 238   if test "x$OPENJDK_TARGET_OS" = xaix ; then
 239     INCLUDE_SA=false
 240   fi
 241   AC_SUBST(INCLUDE_SA)
 242 
 243   # Compress jars
 244   COMPRESS_JARS=false
 245 
 246   AC_SUBST(COMPRESS_JARS)
 247 
 248   # Setup default copyright year. Mostly overridden when building close to a new year.
 249   AC_ARG_WITH(copyright-year, [AS_HELP_STRING([--with-copyright-year],
 250       [Set copyright year value for build @<:@current year@:>@])])
 251   if test "x$with_copyright_year" = xyes; then
 252     AC_MSG_ERROR([Copyright year must have a value])
 253   elif test "x$with_copyright_year" != x; then
 254     COPYRIGHT_YEAR="$with_copyright_year"
 255   else
 256     COPYRIGHT_YEAR=`$DATE +'%Y'`
 257   fi
 258   AC_SUBST(COPYRIGHT_YEAR)
 259 ])
 260 
 261 ###############################################################################
 262 #
 263 # Enable or disable the elliptic curve crypto implementation
 264 #
 265 AC_DEFUN_ONCE([JDKOPT_DETECT_INTREE_EC],
 266 [
 267   AC_MSG_CHECKING([if elliptic curve crypto implementation is present])
 268 
 269   if test -d "${TOPDIR}/src/jdk.crypto.ec/share/native/libsunec/impl"; then
 270     ENABLE_INTREE_EC=true
 271     AC_MSG_RESULT([yes])
 272   else
 273     ENABLE_INTREE_EC=false
 274     AC_MSG_RESULT([no])
 275   fi
 276 
 277   AC_SUBST(ENABLE_INTREE_EC)
 278 ])
 279 
 280 AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS],
 281 [
 282   #
 283   # NATIVE_DEBUG_SYMBOLS
 284   # This must be done after the toolchain is setup, since we're looking at objcopy.
 285   #
 286   AC_MSG_CHECKING([what type of native debug symbols to use])
 287   AC_ARG_WITH([native-debug-symbols],
 288       [AS_HELP_STRING([--with-native-debug-symbols],
 289       [set the native debug symbol configuration (none, internal, external, zipped) @<:@varying@:>@])],
 290       [
 291         if test "x$OPENJDK_TARGET_OS" = xaix; then
 292           if test "x$withval" = xexternal || test "x$withval" = xzipped; then
 293             AC_MSG_ERROR([AIX only supports the parameters 'none' and 'internal' for --with-native-debug-symbols])
 294           fi
 295         fi
 296       ],
 297       [
 298         if test "x$OPENJDK_TARGET_OS" = xaix; then
 299           # AIX doesn't support 'zipped' so use 'internal' as default
 300           with_native_debug_symbols="internal"
 301         else
 302           if test "x$STATIC_BUILD" = xtrue; then
 303             with_native_debug_symbols="none"
 304           else
 305             with_native_debug_symbols="zipped"
 306           fi
 307         fi
 308       ])
 309   NATIVE_DEBUG_SYMBOLS=$with_native_debug_symbols
 310   AC_MSG_RESULT([$NATIVE_DEBUG_SYMBOLS])
 311 
 312   if test "x$NATIVE_DEBUG_SYMBOLS" = xzipped; then
 313 
 314     if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; then
 315       if test "x$OBJCOPY" = x; then
 316         # enabling of enable-debug-symbols and can't find objcopy
 317         # this is an error
 318         AC_MSG_ERROR([Unable to find objcopy, cannot enable native debug symbols])
 319       fi
 320     fi
 321 
 322     COMPILE_WITH_DEBUG_SYMBOLS=true
 323     COPY_DEBUG_SYMBOLS=true
 324     ZIP_EXTERNAL_DEBUG_SYMBOLS=true
 325   elif test "x$NATIVE_DEBUG_SYMBOLS" = xnone; then
 326     COMPILE_WITH_DEBUG_SYMBOLS=false
 327     COPY_DEBUG_SYMBOLS=false
 328     ZIP_EXTERNAL_DEBUG_SYMBOLS=false
 329   elif test "x$NATIVE_DEBUG_SYMBOLS" = xinternal; then
 330     COMPILE_WITH_DEBUG_SYMBOLS=true
 331     COPY_DEBUG_SYMBOLS=false
 332     ZIP_EXTERNAL_DEBUG_SYMBOLS=false
 333   elif test "x$NATIVE_DEBUG_SYMBOLS" = xexternal; then
 334 
 335     if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; then
 336       if test "x$OBJCOPY" = x; then
 337         # enabling of enable-debug-symbols and can't find objcopy
 338         # this is an error
 339         AC_MSG_ERROR([Unable to find objcopy, cannot enable native debug symbols])
 340       fi
 341     fi
 342 
 343     COMPILE_WITH_DEBUG_SYMBOLS=true
 344     COPY_DEBUG_SYMBOLS=true
 345     ZIP_EXTERNAL_DEBUG_SYMBOLS=false
 346   else
 347     AC_MSG_ERROR([Allowed native debug symbols are: none, internal, external, zipped])
 348   fi
 349 
 350   # --enable-debug-symbols is deprecated.
 351   # Please use --with-native-debug-symbols=[internal,external,zipped] .
 352   BASIC_DEPRECATED_ARG_ENABLE(debug-symbols, debug_symbols,
 353         [Please use --with-native-debug-symbols=[[internal,external,zipped]] .])
 354 
 355   # --enable-zip-debug-info is deprecated.
 356   # Please use --with-native-debug-symbols=zipped .
 357   BASIC_DEPRECATED_ARG_ENABLE(zip-debug-info, zip_debug_info,
 358                               [Please use --with-native-debug-symbols=zipped .])
 359 
 360   AC_SUBST(COMPILE_WITH_DEBUG_SYMBOLS)
 361   AC_SUBST(COPY_DEBUG_SYMBOLS)
 362   AC_SUBST(ZIP_EXTERNAL_DEBUG_SYMBOLS)
 363 ])
 364 
 365 ################################################################################
 366 #
 367 # Gcov coverage data for hotspot
 368 #
 369 AC_DEFUN_ONCE([JDKOPT_SETUP_CODE_COVERAGE],
 370 [
 371   AC_ARG_ENABLE(native-coverage, [AS_HELP_STRING([--enable-native-coverage],
 372       [enable native compilation with code coverage data@<:@disabled@:>@])])
 373   GCOV_ENABLED="false"
 374   if test "x$enable_native_coverage" = "xyes"; then
 375     if test "x$TOOLCHAIN_TYPE" = "xgcc"; then
 376       AC_MSG_CHECKING([if native coverage is enabled])
 377       AC_MSG_RESULT([yes])
 378       GCOV_CFLAGS="-fprofile-arcs -ftest-coverage -fno-inline"
 379       GCOV_LDFLAGS="-fprofile-arcs"
 380       JVM_CFLAGS="$JVM_CFLAGS $GCOV_CFLAGS"
 381       JVM_LDFLAGS="$JVM_LDFLAGS $GCOV_LDFLAGS"
 382       CFLAGS_JDKLIB="$CFLAGS_JDKLIB $GCOV_CFLAGS"
 383       CFLAGS_JDKEXE="$CFLAGS_JDKEXE $GCOV_CFLAGS"
 384       CXXFLAGS_JDKLIB="$CXXFLAGS_JDKLIB $GCOV_CFLAGS"
 385       CXXFLAGS_JDKEXE="$CXXFLAGS_JDKEXE $GCOV_CFLAGS"
 386       LDFLAGS_JDKLIB="$LDFLAGS_JDKLIB $GCOV_LDFLAGS"
 387       LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE $GCOV_LDFLAGS"
 388       GCOV_ENABLED="true"
 389     else
 390       AC_MSG_ERROR([--enable-native-coverage only works with toolchain type gcc])
 391     fi
 392   elif test "x$enable_native_coverage" = "xno"; then
 393     AC_MSG_CHECKING([if native coverage is enabled])
 394     AC_MSG_RESULT([no])
 395   elif test "x$enable_native_coverage" != "x"; then
 396     AC_MSG_ERROR([--enable-native-coverage can only be assigned "yes" or "no"])
 397   fi
 398 
 399   AC_SUBST(GCOV_ENABLED)
 400 ])
 401 
 402 ################################################################################
 403 #
 404 # Static build support.  When enabled will generate static
 405 # libraries instead of shared libraries for all JDK libs.
 406 #
 407 AC_DEFUN_ONCE([JDKOPT_SETUP_STATIC_BUILD],
 408 [
 409   AC_ARG_ENABLE([static-build], [AS_HELP_STRING([--enable-static-build],
 410     [enable static library build @<:@disabled@:>@])])
 411   STATIC_BUILD=false
 412   if test "x$enable_static_build" = "xyes"; then
 413     AC_MSG_CHECKING([if static build is enabled])
 414     AC_MSG_RESULT([yes])
 415     if test "x$OPENJDK_TARGET_OS" != "xmacosx"; then
 416       AC_MSG_ERROR([--enable-static-build is only supported for macosx builds])
 417     fi
 418     STATIC_BUILD_CFLAGS="-DSTATIC_BUILD=1"
 419     CFLAGS_JDKLIB_EXTRA="$CFLAGS_JDKLIB_EXTRA $STATIC_BUILD_CFLAGS"
 420     CXXFLAGS_JDKLIB_EXTRA="$CXXFLAGS_JDKLIB_EXTRA $STATIC_BUILD_CFLAGS"
 421     STATIC_BUILD=true
 422   elif test "x$enable_static_build" = "xno"; then
 423     AC_MSG_CHECKING([if static build is enabled])
 424     AC_MSG_RESULT([no])
 425   elif test "x$enable_static_build" != "x"; then
 426     AC_MSG_ERROR([--enable-static-build can only be assigned "yes" or "no"])
 427   fi
 428 
 429   AC_SUBST(STATIC_BUILD)
 430 ])
 431 
 432 ################################################################################
 433 #
 434 # jlink options.
 435 # We always keep packaged modules in JDK image.
 436 #
 437 AC_DEFUN_ONCE([JDKOPT_SETUP_JLINK_OPTIONS],
 438 [
 439   AC_ARG_ENABLE([keep-packaged-modules], [AS_HELP_STRING([--disable-keep-packaged-modules],
 440     [Do not keep packaged modules in jdk image @<:@enable@:>@])])
 441 
 442   AC_MSG_CHECKING([if packaged modules are kept])
 443   if test "x$enable_keep_packaged_modules" = "xyes"; then
 444     AC_MSG_RESULT([yes])
 445     JLINK_KEEP_PACKAGED_MODULES=true
 446   elif test "x$enable_keep_packaged_modules" = "xno"; then
 447     AC_MSG_RESULT([no])
 448     JLINK_KEEP_PACKAGED_MODULES=false
 449   elif test "x$enable_keep_packaged_modules" = "x"; then
 450     AC_MSG_RESULT([yes (default)])
 451     JLINK_KEEP_PACKAGED_MODULES=true
 452   else
 453     AC_MSG_RESULT([error])
 454     AC_MSG_ERROR([--enable-keep-packaged-modules accepts no argument])
 455   fi
 456 
 457   AC_SUBST(JLINK_KEEP_PACKAGED_MODULES)
 458 ])
 459 
 460 ################################################################################
 461 #
 462 # Check if building of the jtreg failure handler should be enabled.
 463 #
 464 AC_DEFUN_ONCE([JDKOPT_ENABLE_DISABLE_FAILURE_HANDLER],
 465 [
 466   AC_ARG_ENABLE([jtreg-failure-handler], [AS_HELP_STRING([--enable-jtreg-failure-handler],
 467     [forces build of the jtreg failure handler to be enabled, missing dependencies
 468      become fatal errors. Default is auto, where the failure handler is built if all
 469      dependencies are present and otherwise just disabled.])])
 470 
 471   AC_MSG_CHECKING([if jtreg failure handler should be built])
 472 
 473   if test "x$enable_jtreg_failure_handler" = "xyes"; then
 474     if test "x$JT_HOME" = "x"; then
 475       AC_MSG_ERROR([Cannot enable jtreg failure handler without jtreg.])
 476     else
 477       BUILD_FAILURE_HANDLER=true
 478       AC_MSG_RESULT([yes, forced])
 479     fi
 480   elif test "x$enable_jtreg_failure_handler" = "xno"; then
 481     BUILD_FAILURE_HANDLER=false
 482     AC_MSG_RESULT([no, forced])
 483   elif test "x$enable_jtreg_failure_handler" = "xauto" \
 484       || test "x$enable_jtreg_failure_handler" = "x"; then
 485     if test "x$JT_HOME" = "x"; then
 486       BUILD_FAILURE_HANDLER=false
 487       AC_MSG_RESULT([no, missing jtreg])
 488     else
 489       BUILD_FAILURE_HANDLER=true
 490       AC_MSG_RESULT([yes, jtreg present])
 491     fi
 492   else
 493     AC_MSG_ERROR([Invalid value for --enable-jtreg-failure-handler: $enable_jtreg_failure_handler])
 494   fi
 495 
 496   AC_SUBST(BUILD_FAILURE_HANDLER)
 497 ])
 498 
 499 ################################################################################
 500 #
 501 # Enable or disable generation of the classlist at build time
 502 #
 503 AC_DEFUN_ONCE([JDKOPT_ENABLE_DISABLE_GENERATE_CLASSLIST],
 504 [
 505   AC_ARG_ENABLE([generate-classlist], [AS_HELP_STRING([--disable-generate-classlist],
 506       [forces enabling or disabling of the generation of a CDS classlist at build time.
 507       Default is to generate it when either the server or client JVMs are built and
 508       enable-cds is true.])])
 509 
 510   # Check if it's likely that it's possible to generate the classlist. Depending
 511   # on exact jvm configuration it could be possible anyway.
 512   if test "x$ENABLE_CDS" = "xtrue" && (HOTSPOT_CHECK_JVM_VARIANT(server) || HOTSPOT_CHECK_JVM_VARIANT(client)); then
 513     ENABLE_GENERATE_CLASSLIST_POSSIBLE="true"
 514   else
 515     ENABLE_GENERATE_CLASSLIST_POSSIBLE="false"
 516   fi
 517 
 518   AC_MSG_CHECKING([if the CDS classlist generation should be enabled])
 519   if test "x$enable_generate_classlist" = "xyes"; then
 520     AC_MSG_RESULT([yes, forced])
 521     ENABLE_GENERATE_CLASSLIST="true"
 522     if test "x$ENABLE_GENERATE_CLASSLIST_POSSIBLE" = "xfalse"; then
 523       AC_MSG_WARN([Generation of classlist might not be possible with JVM Variants $JVM_VARIANTS and enable-cds=$ENABLE_CDS])
 524     fi
 525   elif test "x$enable_generate_classlist" = "xno"; then
 526     AC_MSG_RESULT([no, forced])
 527     ENABLE_GENERATE_CLASSLIST="false"
 528   elif test "x$enable_generate_classlist" = "x"; then
 529     if test "x$ENABLE_GENERATE_CLASSLIST_POSSIBLE" = "xtrue"; then
 530       AC_MSG_RESULT([yes])
 531       ENABLE_GENERATE_CLASSLIST="true"
 532     else
 533       AC_MSG_RESULT([no])
 534       ENABLE_GENERATE_CLASSLIST="false"
 535     fi
 536   else
 537     AC_MSG_ERROR([Invalid value for --enable-generate-classlist: $enable_generate_classlist])
 538   fi
 539 
 540   AC_SUBST(ENABLE_GENERATE_CLASSLIST)
 541 ])