1 #
   2 # Copyright (c) 2011, 2016, 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([for presence of closed sources])
 121   if test -d "$SRC_ROOT/jdk/src/closed"; then
 122     CLOSED_SOURCE_PRESENT=yes



 123   else
 124     CLOSED_SOURCE_PRESENT=no
 125   fi
 126   AC_MSG_RESULT([$CLOSED_SOURCE_PRESENT])
 127 
 128   AC_MSG_CHECKING([if closed source is suppressed (openjdk-only)])
 129   SUPPRESS_CLOSED_SOURCE="$enable_openjdk_only"
 130   AC_MSG_RESULT([$SUPPRESS_CLOSED_SOURCE])
 131 
 132   if test "x$CLOSED_SOURCE_PRESENT" = xno; then
 133     OPENJDK=true
 134     if test "x$SUPPRESS_CLOSED_SOURCE" = "xyes"; then
 135       AC_MSG_WARN([No closed source present, --enable-openjdk-only makes no sense])
 136     fi
 137   else
 138     if test "x$SUPPRESS_CLOSED_SOURCE" = "xyes"; then
 139       OPENJDK=true
 140     else
 141       OPENJDK=false
 142     fi
 143   fi
 144 
 145   if test "x$OPENJDK" = "xtrue"; then
 146     SET_OPENJDK="OPENJDK=true"
 147   fi
 148 
 149   AC_SUBST(SET_OPENJDK)
 150 
 151   # custom-make-dir is deprecated. Please use your custom-hook.m4 to override
 152   # the IncludeCustomExtension macro.
 153   BASIC_DEPRECATED_ARG_WITH(custom-make-dir)
 154 ])
 155 
 156 AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS],
 157 [
 158   # Should we build a JDK/JVM with headful support (ie a graphical ui)?
 159   # We always build headless support.
 160   AC_MSG_CHECKING([headful support])
 161   AC_ARG_ENABLE([headful], [AS_HELP_STRING([--disable-headful],
 162       [disable building headful support (graphical UI support) @<:@enabled@:>@])],
 163       [SUPPORT_HEADFUL=${enable_headful}], [SUPPORT_HEADFUL=yes])
 164 
 165   SUPPORT_HEADLESS=yes
 166   BUILD_HEADLESS="BUILD_HEADLESS:=true"
 167 
 168   if test "x$SUPPORT_HEADFUL" = xyes; then
 169     # We are building both headful and headless.
 170     headful_msg="include support for both headful and headless"
 171   fi
 172 
 173   if test "x$SUPPORT_HEADFUL" = xno; then
 174     # Thus we are building headless only.
 175     BUILD_HEADLESS="BUILD_HEADLESS:=true"
 176     headful_msg="headless only"
 177   fi
 178 
 179   AC_MSG_RESULT([$headful_msg])
 180 
 181   AC_SUBST(SUPPORT_HEADLESS)
 182   AC_SUBST(SUPPORT_HEADFUL)
 183   AC_SUBST(BUILD_HEADLESS)
 184 
 185   # Choose cacerts source file
 186   AC_ARG_WITH(cacerts-file, [AS_HELP_STRING([--with-cacerts-file],
 187       [specify alternative cacerts file])])
 188   if test "x$with_cacerts_file" != x; then
 189     CACERTS_FILE=$with_cacerts_file
 190   fi
 191   AC_SUBST(CACERTS_FILE)
 192 
 193   # Enable or disable unlimited crypto
 194   AC_ARG_ENABLE(unlimited-crypto, [AS_HELP_STRING([--enable-unlimited-crypto],
 195       [Enable unlimited crypto policy @<:@disabled@:>@])],,
 196       [enable_unlimited_crypto=no])
 197   if test "x$enable_unlimited_crypto" = "xyes"; then
 198     UNLIMITED_CRYPTO=true
 199   else
 200     UNLIMITED_CRYPTO=false
 201   fi
 202   AC_SUBST(UNLIMITED_CRYPTO)
 203 
 204   # Should we build the serviceability agent (SA)?
 205   INCLUDE_SA=true
 206   if HOTSPOT_CHECK_JVM_VARIANT(zero) || HOTSPOT_CHECK_JVM_VARIANT(zeroshark); then
 207     INCLUDE_SA=false
 208   fi
 209   if test "x$OPENJDK_TARGET_OS" = xaix ; then
 210     INCLUDE_SA=false
 211   fi
 212   AC_SUBST(INCLUDE_SA)
 213 
 214   # Compress jars
 215   COMPRESS_JARS=false
 216 
 217   AC_SUBST(COMPRESS_JARS)
 218 
 219   # Setup default copyright year. Mostly overridden when building close to a new year.
 220   AC_ARG_WITH(copyright-year, [AS_HELP_STRING([--with-copyright-year],
 221       [Set copyright year value for build @<:@current year@:>@])])
 222   if test "x$with_copyright_year" = xyes; then
 223     AC_MSG_ERROR([Copyright year must have a value])
 224   elif test "x$with_copyright_year" != x; then
 225     COPYRIGHT_YEAR="$with_copyright_year"
 226   else
 227     COPYRIGHT_YEAR=`$DATE +'%Y'`
 228   fi
 229   AC_SUBST(COPYRIGHT_YEAR)
 230 ])
 231 
 232 ###############################################################################
 233 #
 234 # Enable or disable the elliptic curve crypto implementation
 235 #
 236 AC_DEFUN_ONCE([JDKOPT_DETECT_INTREE_EC],
 237 [
 238   AC_MSG_CHECKING([if elliptic curve crypto implementation is present])
 239 
 240   if test -d "${SRC_ROOT}/jdk/src/jdk.crypto.ec/share/native/libsunec/impl"; then
 241     ENABLE_INTREE_EC=yes
 242     AC_MSG_RESULT([yes])
 243   else
 244     ENABLE_INTREE_EC=no
 245     AC_MSG_RESULT([no])
 246   fi
 247 
 248   AC_SUBST(ENABLE_INTREE_EC)
 249 ])
 250 
 251 AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS],
 252 [
 253   #
 254   # NATIVE_DEBUG_SYMBOLS
 255   # This must be done after the toolchain is setup, since we're looking at objcopy.
 256   #
 257   AC_MSG_CHECKING([what type of native debug symbols to use])
 258   AC_ARG_WITH([native-debug-symbols],
 259       [AS_HELP_STRING([--with-native-debug-symbols],
 260       [set the native debug symbol configuration (none, internal, external, zipped) @<:@varying@:>@])],
 261       [
 262         if test "x$OPENJDK_TARGET_OS" = xaix; then
 263           if test "x$withval" = xexternal || test "x$withval" = xzipped; then
 264             AC_MSG_ERROR([AIX only supports the parameters 'none' and 'internal' for --with-native-debug-symbols])
 265           fi
 266         fi
 267       ],
 268       [
 269         if test "x$OPENJDK_TARGET_OS" = xaix; then
 270           # AIX doesn't support 'zipped' so use 'internal' as default
 271           with_native_debug_symbols="internal"
 272         else
 273           if test "x$STATIC_BUILD" = xtrue; then
 274             with_native_debug_symbols="none"
 275           else
 276             with_native_debug_symbols="zipped"
 277           fi
 278         fi
 279       ])
 280   NATIVE_DEBUG_SYMBOLS=$with_native_debug_symbols
 281   AC_MSG_RESULT([$NATIVE_DEBUG_SYMBOLS])
 282 
 283   if test "x$NATIVE_DEBUG_SYMBOLS" = xzipped; then
 284 
 285     if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; then
 286       if test "x$OBJCOPY" = x; then
 287         # enabling of enable-debug-symbols and can't find objcopy
 288         # this is an error
 289         AC_MSG_ERROR([Unable to find objcopy, cannot enable native debug symbols])
 290       fi
 291     fi
 292 
 293     COMPILE_WITH_DEBUG_SYMBOLS=true
 294     COPY_DEBUG_SYMBOLS=true
 295     ZIP_EXTERNAL_DEBUG_SYMBOLS=true
 296 
 297     # Hotspot legacy support, not relevant with COPY_DEBUG_SYMBOLS=true
 298     DEBUG_BINARIES=false
 299     STRIP_POLICY=min_strip
 300 
 301   elif test "x$NATIVE_DEBUG_SYMBOLS" = xnone; then
 302     COMPILE_WITH_DEBUG_SYMBOLS=false
 303     COPY_DEBUG_SYMBOLS=false
 304     ZIP_EXTERNAL_DEBUG_SYMBOLS=false
 305 
 306     DEBUG_BINARIES=false
 307     STRIP_POLICY=no_strip
 308   elif test "x$NATIVE_DEBUG_SYMBOLS" = xinternal; then
 309     COMPILE_WITH_DEBUG_SYMBOLS=true
 310     COPY_DEBUG_SYMBOLS=false
 311     ZIP_EXTERNAL_DEBUG_SYMBOLS=false
 312 
 313     # Hotspot legacy support, will turn on -g when COPY_DEBUG_SYMBOLS=false
 314     DEBUG_BINARIES=true
 315     STRIP_POLICY=no_strip
 316     STRIP=""
 317 
 318   elif test "x$NATIVE_DEBUG_SYMBOLS" = xexternal; then
 319 
 320     if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; then
 321       if test "x$OBJCOPY" = x; then
 322         # enabling of enable-debug-symbols and can't find objcopy
 323         # this is an error
 324         AC_MSG_ERROR([Unable to find objcopy, cannot enable native debug symbols])
 325       fi
 326     fi
 327 
 328     COMPILE_WITH_DEBUG_SYMBOLS=true
 329     COPY_DEBUG_SYMBOLS=true
 330     ZIP_EXTERNAL_DEBUG_SYMBOLS=false
 331 
 332     # Hotspot legacy support, not relevant with COPY_DEBUG_SYMBOLS=true
 333     DEBUG_BINARIES=false
 334     STRIP_POLICY=min_strip
 335   else
 336     AC_MSG_ERROR([Allowed native debug symbols are: none, internal, external, zipped])
 337   fi
 338 
 339   # --enable-debug-symbols is deprecated.
 340   # Please use --with-native-debug-symbols=[internal,external,zipped] .
 341   BASIC_DEPRECATED_ARG_ENABLE(debug-symbols, debug_symbols,
 342         [Please use --with-native-debug-symbols=[[internal,external,zipped]] .])
 343 
 344   # --enable-zip-debug-info is deprecated.
 345   # Please use --with-native-debug-symbols=zipped .
 346   BASIC_DEPRECATED_ARG_ENABLE(zip-debug-info, zip_debug_info,
 347                               [Please use --with-native-debug-symbols=zipped .])
 348 
 349   AC_SUBST(COMPILE_WITH_DEBUG_SYMBOLS)
 350   AC_SUBST(COPY_DEBUG_SYMBOLS)
 351   AC_SUBST(ZIP_EXTERNAL_DEBUG_SYMBOLS)
 352 
 353   # Legacy values
 354   AC_SUBST(DEBUG_BINARIES)
 355   AC_SUBST(STRIP_POLICY)
 356 ])
 357 
 358 ################################################################################
 359 #
 360 # Gcov coverage data for hotspot
 361 #
 362 AC_DEFUN_ONCE([JDKOPT_SETUP_CODE_COVERAGE],
 363 [
 364   AC_ARG_ENABLE(native-coverage, [AS_HELP_STRING([--enable-native-coverage],
 365       [enable native compilation with code coverage data@<:@disabled@:>@])])
 366   GCOV_ENABLED="false"
 367   if test "x$enable_native_coverage" = "xyes"; then
 368     if test "x$TOOLCHAIN_TYPE" = "xgcc"; then
 369       AC_MSG_CHECKING([if native coverage is enabled])
 370       AC_MSG_RESULT([yes])
 371       GCOV_CFLAGS="-fprofile-arcs -ftest-coverage -fno-inline"
 372       GCOV_LDFLAGS="-fprofile-arcs"
 373       LEGACY_EXTRA_CFLAGS="$LEGACY_EXTRA_CFLAGS $GCOV_CFLAGS"
 374       LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS $GCOV_CFLAGS"
 375       LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS $GCOV_LDFLAGS"
 376       CFLAGS_JDKLIB="$CFLAGS_JDKLIB $GCOV_CFLAGS"
 377       CFLAGS_JDKEXE="$CFLAGS_JDKEXE $GCOV_CFLAGS"
 378       CXXFLAGS_JDKLIB="$CXXFLAGS_JDKLIB $GCOV_CFLAGS"
 379       CXXFLAGS_JDKEXE="$CXXFLAGS_JDKEXE $GCOV_CFLAGS"
 380       LDFLAGS_JDKLIB="$LDFLAGS_JDKLIB $GCOV_LDFLAGS"
 381       LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE $GCOV_LDFLAGS"
 382       GCOV_ENABLED="true"
 383     else
 384       AC_MSG_ERROR([--enable-native-coverage only works with toolchain type gcc])
 385     fi
 386   elif test "x$enable_native_coverage" = "xno"; then
 387     AC_MSG_CHECKING([if native coverage is enabled])
 388     AC_MSG_RESULT([no])
 389   elif test "x$enable_native_coverage" != "x"; then
 390     AC_MSG_ERROR([--enable-native-coverage can only be assigned "yes" or "no"])
 391   fi
 392 
 393   AC_SUBST(GCOV_ENABLED)
 394 ])
 395 
 396 ################################################################################
 397 #
 398 # Static build support.  When enabled will generate static
 399 # libraries instead of shared libraries for all JDK libs.
 400 #
 401 AC_DEFUN_ONCE([JDKOPT_SETUP_STATIC_BUILD],
 402 [
 403   AC_ARG_ENABLE([static-build], [AS_HELP_STRING([--enable-static-build],
 404     [enable static library build @<:@disabled@:>@])])
 405   STATIC_BUILD=false
 406   if test "x$enable_static_build" = "xyes"; then
 407     AC_MSG_CHECKING([if static build is enabled])
 408     AC_MSG_RESULT([yes])
 409     if test "x$OPENJDK_TARGET_OS" != "xmacosx"; then
 410       AC_MSG_ERROR([--enable-static-build is only supported for macosx builds])
 411     fi
 412     STATIC_BUILD_CFLAGS="-DSTATIC_BUILD=1"
 413     LEGACY_EXTRA_CFLAGS="$LEGACY_EXTRA_CFLAGS $STATIC_BUILD_CFLAGS"
 414     LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS $STATIC_BUILD_CFLAGS"
 415     CFLAGS_JDKLIB_EXTRA="$CFLAGS_JDKLIB_EXTRA $STATIC_BUILD_CFLAGS"
 416     CXXFLAGS_JDKLIB_EXTRA="$CXXFLAGS_JDKLIB_EXTRA $STATIC_BUILD_CFLAGS"
 417     STATIC_BUILD=true
 418   elif test "x$enable_static_build" = "xno"; then
 419     AC_MSG_CHECKING([if static build is enabled])
 420     AC_MSG_RESULT([no])
 421   elif test "x$enable_static_build" != "x"; then
 422     AC_MSG_ERROR([--enable-static-build can only be assigned "yes" or "no"])
 423   fi
 424 
 425   AC_SUBST(STATIC_BUILD)
 426 ])
 427 
 428 ################################################################################
 429 #
 430 # jlink options.
 431 # We always keep packaged modules in JDK image.
 432 #
 433 AC_DEFUN_ONCE([JDKOPT_SETUP_JLINK_OPTIONS],
 434 [
 435   AC_ARG_ENABLE([keep-packaged-modules], [AS_HELP_STRING([--disable-keep-packaged-modules],
 436     [Do not keep packaged modules in jdk image @<:@enable@:>@])])
 437 
 438   if test "x$enable_keep_packaged_modules" = "xyes"; then
 439     AC_MSG_CHECKING([if packaged modules are kept])
 440     AC_MSG_RESULT([yes])
 441     JLINK_KEEP_PACKAGED_MODULES=true
 442   elif test "x$enable_keep_packaged_modules" = "xno"; then
 443     AC_MSG_CHECKING([if packaged modules are kept])
 444     AC_MSG_RESULT([no])
 445     JLINK_KEEP_PACKAGED_MODULES=false
 446   elif test "x$enable_keep_packaged_modules" = "x"; then
 447     AC_MSG_RESULT([yes (default)])
 448     JLINK_KEEP_PACKAGED_MODULES=true
 449   else
 450     AC_MSG_ERROR([--enable-keep-packaged-modules accepts no argument])
 451   fi
 452 
 453   AC_SUBST(JLINK_KEEP_PACKAGED_MODULES)
 454 ])
 455 
 456 ################################################################################
 457 #
 458 # Check if building of the jtreg failure handler should be enabled.
 459 #
 460 AC_DEFUN_ONCE([JDKOPT_ENABLE_DISABLE_FAILURE_HANDLER],
 461 [
 462   AC_ARG_ENABLE([jtreg-failure-handler], [AS_HELP_STRING([--enable-jtreg-failure-handler],
 463     [forces build of the jtreg failure handler to be enabled, missing dependencies
 464      become fatal errors. Default is auto, where the failure handler is built if all
 465      dependencies are present and otherwise just disabled.])])
 466 
 467   AC_MSG_CHECKING([if jtreg failure handler should be built])
 468 
 469   if test "x$enable_jtreg_failure_handler" = "xyes"; then
 470     if test "x$JT_HOME" = "x"; then
 471       AC_MSG_ERROR([Cannot enable jtreg failure handler without jtreg.])
 472     else
 473       BUILD_FAILURE_HANDLER=true
 474       AC_MSG_RESULT([yes, forced])
 475     fi
 476   elif test "x$enable_jtreg_failure_handler" = "xno"; then
 477     BUILD_FAILURE_HANDLER=false
 478     AC_MSG_RESULT([no, forced])
 479   elif test "x$enable_jtreg_failure_handler" = "xauto" \
 480       || test "x$enable_jtreg_failure_handler" = "x"; then
 481     if test "x$JT_HOME" = "x"; then
 482       BUILD_FAILURE_HANDLER=false
 483       AC_MSG_RESULT([no, missing jtreg])
 484     else
 485       BUILD_FAILURE_HANDLER=true
 486       AC_MSG_RESULT([yes, jtreg present])
 487     fi
 488   else
 489     AC_MSG_ERROR([Invalid value for --enable-jtreg-failure-handler: $enable_jtreg_failure_handler])
 490   fi
 491 
 492   AC_SUBST(BUILD_FAILURE_HANDLER)
 493 ])
 494 
 495 ################################################################################
 496 #
 497 # Enable or disable generation of the classlist at build time
 498 #
 499 AC_DEFUN_ONCE([JDKOPT_ENABLE_DISABLE_GENERATE_CLASSLIST],
 500 [
 501   AC_ARG_ENABLE([generate-classlist], [AS_HELP_STRING([--disable-generate-classlist],
 502       [forces enabling or disabling of the generation of a CDS classlist at build time.
 503       Default is to generate it when either the server or client JVMs are built.])])
 504 
 505   # Check if it's likely that it's possible to generate the classlist. Depending
 506   # on exact jvm configuration it could be possible anyway.
 507   if HOTSPOT_CHECK_JVM_VARIANT(server) || HOTSPOT_CHECK_JVM_VARIANT(client); then
 508     ENABLE_GENERATE_CLASSLIST_POSSIBLE="true"
 509   else
 510     ENABLE_GENERATE_CLASSLIST_POSSIBLE="false"
 511   fi
 512 
 513   AC_MSG_CHECKING([if the CDS classlist generation should be enabled])
 514   if test "x$enable_generate_classlist" = "xyes"; then
 515     AC_MSG_RESULT([yes, forced])
 516     ENABLE_GENERATE_CLASSLIST="true"
 517     if test "x$ENABLE_GENERATE_CLASSLIST_POSSIBLE" = "xfalse"; then
 518       AC_MSG_WARN([Generation of classlist might not be possible with JVM Variants $JVM_VARIANTS])
 519     fi
 520   elif test "x$enable_generate_classlist" = "xno"; then
 521     AC_MSG_RESULT([no, forced])
 522     ENABLE_GENERATE_CLASSLIST="false"
 523   elif test "x$enable_generate_classlist" = "x"; then
 524     if test "x$ENABLE_GENERATE_CLASSLIST_POSSIBLE" = "xtrue"; then
 525       AC_MSG_RESULT([yes])
 526       ENABLE_GENERATE_CLASSLIST="true"
 527     else
 528       AC_MSG_RESULT([no])
 529       ENABLE_GENERATE_CLASSLIST="false"
 530     fi
 531   else
 532     AC_MSG_ERROR([Invalid value for --enable-generate-classlist: $enable_generate_classlist])
 533   fi
 534 
 535   AC_SUBST([ENABLE_GENERATE_CLASSLIST])
 536 ])
--- EOF ---