common/autoconf/jdk-options.m4
changeset 13697 5262b00bc10c
parent 13133 701e61c32ece
child 14111 2a82ecb35fc7
equal deleted inserted replaced
13694:ffe6bce5a521 13697:5262b00bc10c
    28 ###############################################################################
    28 ###############################################################################
    29 #
    29 #
    30 # Check which variant of the JDK that we want to build.
    30 # Check which variant of the JDK that we want to build.
    31 # Currently we have:
    31 # Currently we have:
    32 #    normal:   standard edition   
    32 #    normal:   standard edition   
    33 #    embedded: cut down to a smaller footprint
    33 # but the custom make system may add other variants
    34 #
    34 #
    35 # Effectively the JDK variant gives a name to a specific set of
    35 # Effectively the JDK variant gives a name to a specific set of
    36 # modules to compile into the JDK. In the future, these modules
    36 # modules to compile into the JDK. In the future, these modules
    37 # might even be Jigsaw modules.
    37 # might even be Jigsaw modules.
    38 #
    38 #
    39 AC_MSG_CHECKING([which variant of the JDK to build])
    39 AC_MSG_CHECKING([which variant of the JDK to build])
    40 AC_ARG_WITH([jdk-variant], [AS_HELP_STRING([--with-jdk-variant],
    40 AC_ARG_WITH([jdk-variant], [AS_HELP_STRING([--with-jdk-variant],
    41 	[JDK variant to build (normal, embedded) @<:@normal@:>@])])
    41 	[JDK variant to build (normal) @<:@normal@:>@])])
    42 
    42 
    43 if test "x$with_jdk_variant" = xnormal || test "x$with_jdk_variant" = x; then
    43 if test "x$with_jdk_variant" = xnormal || test "x$with_jdk_variant" = x; then
    44     JAVASE_EMBEDDED=""
       
    45     MINIMIZE_RAM_USAGE=""
       
    46     JDK_VARIANT="normal"
    44     JDK_VARIANT="normal"
    47 elif test "x$with_jdk_variant" = xembedded; then
    45 else
    48     JAVASE_EMBEDDED="JAVASE_EMBEDDED:=true"
    46     AC_MSG_ERROR([The available JDK variants are: normal])
    49     MINIMIZE_RAM_USAGE="MINIMIZE_RAM_USAGE:=true"
    47 fi
    50     JDK_VARIANT="embedded"
    48 
    51 else
       
    52     AC_MSG_ERROR([The available JDK variants are: normal, embedded])
       
    53 fi
       
    54                               
       
    55 AC_SUBST(JAVASE_EMBEDDED)
       
    56 AC_SUBST(MINIMIZE_RAM_USAGE)
       
    57 AC_SUBST(JDK_VARIANT)
    49 AC_SUBST(JDK_VARIANT)
    58 
    50 
    59 AC_MSG_RESULT([$JDK_VARIANT])
    51 AC_MSG_RESULT([$JDK_VARIANT])
    60 ])
    52 ])
    61 
    53 
    75 AC_MSG_CHECKING([which variants of the JVM that should be built])
    67 AC_MSG_CHECKING([which variants of the JVM that should be built])
    76 AC_ARG_WITH([jvm-variants], [AS_HELP_STRING([--with-jvm-variants],
    68 AC_ARG_WITH([jvm-variants], [AS_HELP_STRING([--with-jvm-variants],
    77 	[JVM variants (separated by commas) to build (server, client, kernel, zero, zeroshark) @<:@server@:>@])])
    69 	[JVM variants (separated by commas) to build (server, client, kernel, zero, zeroshark) @<:@server@:>@])])
    78 
    70 
    79 if test "x$with_jvm_variants" = x; then
    71 if test "x$with_jvm_variants" = x; then
    80     if test "x$JDK_VARIANT" = xembedded; then
    72      with_jvm_variants="server"
    81         with_jvm_variants="client"
       
    82     else
       
    83         with_jvm_variants="server"
       
    84     fi
       
    85 fi
    73 fi
    86 
    74 
    87 JVM_VARIANTS=",$with_jvm_variants,"
    75 JVM_VARIANTS=",$with_jvm_variants,"
    88 TEST_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/server,//' -e 's/client,//' -e 's/kernel,//' -e 's/zero,//' -e 's/zeroshark,//'`
    76 TEST_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/server,//' -e 's/client,//' -e 's/kernel,//' -e 's/zero,//' -e 's/zeroshark,//'`
    89 
    77 
   123 AC_SUBST(JVM_VARIANT_CLIENT)
   111 AC_SUBST(JVM_VARIANT_CLIENT)
   124 AC_SUBST(JVM_VARIANT_KERNEL)
   112 AC_SUBST(JVM_VARIANT_KERNEL)
   125 AC_SUBST(JVM_VARIANT_ZERO)
   113 AC_SUBST(JVM_VARIANT_ZERO)
   126 AC_SUBST(JVM_VARIANT_ZEROSHARK)
   114 AC_SUBST(JVM_VARIANT_ZEROSHARK)
   127 
   115 
       
   116 if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
       
   117    MACOSX_UNIVERSAL="true"
       
   118 fi
       
   119 
       
   120 AC_SUBST(MACOSX_UNIVERSAL)
   128 
   121 
   129 ])
   122 ])
   130 
   123 
   131 AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_LEVEL],
   124 AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_LEVEL],
   132 [
   125 [
   221     HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}shark "
   214     HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}shark "
   222 fi
   215 fi
   223 
   216 
   224 HOTSPOT_TARGET="$HOTSPOT_TARGET docs export_$HOTSPOT_EXPORT"
   217 HOTSPOT_TARGET="$HOTSPOT_TARGET docs export_$HOTSPOT_EXPORT"
   225 
   218 
       
   219 # On Macosx universal binaries are produced, but they only contain
       
   220 # 64 bit intel. This invalidates control of which jvms are built
       
   221 # from configure, but only server is valid anyway. Fix this
       
   222 # when hotspot makefiles are rewritten.
       
   223 if test "x$MACOSX_UNIVERSAL" = xtrue; then
       
   224     HOTSPOT_TARGET=universal_product
       
   225 fi
       
   226 
   226 #####
   227 #####
   227 
   228 
   228 AC_SUBST(DEBUG_LEVEL)
   229 AC_SUBST(DEBUG_LEVEL)
   229 AC_SUBST(VARIANT)
   230 AC_SUBST(VARIANT)
   230 AC_SUBST(FASTDEBUG)
   231 AC_SUBST(FASTDEBUG)
   287 SUPPORT_HEADLESS=yes
   288 SUPPORT_HEADLESS=yes
   288 BUILD_HEADLESS="BUILD_HEADLESS:=true"
   289 BUILD_HEADLESS="BUILD_HEADLESS:=true"
   289 
   290 
   290 if test "x$SUPPORT_HEADFUL" = xyes; then
   291 if test "x$SUPPORT_HEADFUL" = xyes; then
   291     # We are building both headful and headless.
   292     # We are building both headful and headless.
   292     BUILD_HEADLESS_ONLY=""
       
   293     headful_msg="inlude support for both headful and headless"
   293     headful_msg="inlude support for both headful and headless"
   294 fi
   294 fi
   295 
   295 
   296 if test "x$SUPPORT_HEADFUL" = xno; then
   296 if test "x$SUPPORT_HEADFUL" = xno; then
   297     # Thus we are building headless only.
   297     # Thus we are building headless only.
   298     BUILD_HEADLESS="BUILD_HEADLESS:=true"
   298     BUILD_HEADLESS="BUILD_HEADLESS:=true"
   299     BUILD_HEADLESS_ONLY="BUILD_HEADLESS_ONLY:=true"
       
   300     headful_msg="headless only"
   299     headful_msg="headless only"
   301 fi
   300 fi
   302 
   301 
   303 AC_MSG_RESULT([$headful_msg])
   302 AC_MSG_RESULT([$headful_msg])
   304 
   303 
   305 AC_SUBST(SUPPORT_HEADLESS)
   304 AC_SUBST(SUPPORT_HEADLESS)
   306 AC_SUBST(SUPPORT_HEADFUL)
   305 AC_SUBST(SUPPORT_HEADFUL)
   307 AC_SUBST(BUILD_HEADLESS)
   306 AC_SUBST(BUILD_HEADLESS)
   308 AC_SUBST(BUILD_HEADLESS_ONLY)
       
   309 
       
   310 ###############################################################################
       
   311 #
       
   312 # Should we run the painfully slow javadoc tool?
       
   313 #
       
   314 AC_MSG_CHECKING([whether to build documentation])
       
   315 AC_ARG_ENABLE([docs], [AS_HELP_STRING([--enable-docs],
       
   316 	[enable generation of Javadoc documentation @<:@disabled@:>@])],
       
   317 	[ENABLE_DOCS="${enableval}"], [ENABLE_DOCS='no'])
       
   318 AC_MSG_RESULT([$ENABLE_DOCS])
       
   319 AC_SUBST(ENABLE_DOCS)
       
   320 GENERATE_DOCS=false
       
   321 if test "x$ENABLE_DOCS" = xyes; then
       
   322     GENERATE_DOCS=true
       
   323 fi
       
   324 AC_SUBST(GENERATE_DOCS)
       
   325 
   307 
   326 ###############################################################################
   308 ###############################################################################
   327 #
   309 #
   328 # Should we compile nimbus swing L&F? We can probably remove this option
   310 # Should we compile nimbus swing L&F? We can probably remove this option
   329 # since nimbus is officially part of javax now.
   311 # since nimbus is officially part of javax now.
   371 #
   353 #
   372 # Compress jars
   354 # Compress jars
   373 #
   355 #
   374 COMPRESS_JARS=false
   356 COMPRESS_JARS=false
   375 
   357 
   376 # default for embedded is yes...
       
   377 if test "x$JDK_VARIANT" = "xembedded"; then
       
   378    COMPRESS_JARS=true
       
   379 fi
       
   380 AC_SUBST(COMPRESS_JARS)
   358 AC_SUBST(COMPRESS_JARS)
   381 
   359 
   382 ###############################################################################
   360 ###############################################################################
   383 #
   361 #
   384 # Should we compile JFR
   362 # Should we compile JFR
   385 #   default no, except for on closed-jdk and !embedded
   363 #   default no, except for on closed-jdk
   386 #
   364 #
   387 ENABLE_JFR=no
   365 ENABLE_JFR=no
   388 
   366 
   389 # Is the JFR source present
   367 # Is the JFR source present
   390 
   368 
   391 #
   369 #
   392 # For closed && !embedded default is yes if the source is present
   370 # For closed default is yes
   393 #
   371 #
   394 if test "x${OPENJDK}" != "xtrue" && test "x$JDK_VARIANT" != "xembedded" && test -d "$SRC_ROOT/jdk/src/closed/share/native/oracle/jfr"; then
   372 if test "x${OPENJDK}" != "xtrue"; then
   395    ENABLE_JFR=yes
   373    ENABLE_JFR=yes
   396 fi
   374 fi
   397 
   375 
   398 AC_MSG_CHECKING([whether to build jfr])
   376 AC_MSG_CHECKING([whether to build jfr])
   399 AC_ARG_ENABLE([jfr], [AS_HELP_STRING([--enable-jfr],
   377 AC_ARG_ENABLE([jfr], [AS_HELP_STRING([--enable-jfr],
   467 AC_SUBST(COOKED_BUILD_NUMBER)
   445 AC_SUBST(COOKED_BUILD_NUMBER)
   468 ])
   446 ])
   469 
   447 
   470 AC_DEFUN_ONCE([JDKOPT_SETUP_BUILD_TWEAKS],
   448 AC_DEFUN_ONCE([JDKOPT_SETUP_BUILD_TWEAKS],
   471 [
   449 [
   472 HOTSPOT_MAKE_ARGS="ALT_OUTPUTDIR=$HOTSPOT_OUTPUTDIR ALT_EXPORT_PATH=$HOTSPOT_DIST $HOTSPOT_TARGET"
   450 HOTSPOT_MAKE_ARGS="$HOTSPOT_TARGET"
   473 AC_SUBST(HOTSPOT_MAKE_ARGS)
   451 AC_SUBST(HOTSPOT_MAKE_ARGS)
   474 
   452 
   475 # The name of the Service Agent jar.
   453 # The name of the Service Agent jar.
   476 SALIB_NAME="${LIBRARY_PREFIX}saproc${SHARED_LIBRARY_SUFFIX}"
   454 SALIB_NAME="${LIBRARY_PREFIX}saproc${SHARED_LIBRARY_SUFFIX}"
   477 if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
   455 if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
   489 #
   467 #
   490 ENABLE_DEBUG_SYMBOLS=default
   468 ENABLE_DEBUG_SYMBOLS=default
   491 
   469 
   492 # default on macosx is no...
   470 # default on macosx is no...
   493 if test "x$OPENJDK_TARGET_OS" = xmacosx; then
   471 if test "x$OPENJDK_TARGET_OS" = xmacosx; then
   494    ENABLE_DEBUG_SYMBOLS=no
       
   495 fi
       
   496 
       
   497 # default for embedded is no...
       
   498 if test "x$JDK_VARIANT" = "xembedded"; then
       
   499    ENABLE_DEBUG_SYMBOLS=no
   472    ENABLE_DEBUG_SYMBOLS=no
   500 fi
   473 fi
   501 
   474 
   502 AC_ARG_ENABLE([debug-symbols],
   475 AC_ARG_ENABLE([debug-symbols],
   503               [AS_HELP_STRING([--disable-debug-symbols],[disable generation of debug symbols (@<:@enabled@:>@)])],
   476               [AS_HELP_STRING([--disable-debug-symbols],[disable generation of debug symbols (@<:@enabled@:>@)])],
   547 AC_SUBST(ENABLE_DEBUG_SYMBOLS)
   520 AC_SUBST(ENABLE_DEBUG_SYMBOLS)
   548 AC_SUBST(ZIP_DEBUGINFO_FILES)
   521 AC_SUBST(ZIP_DEBUGINFO_FILES)
   549 AC_SUBST(CFLAGS_DEBUG_SYMBOLS)
   522 AC_SUBST(CFLAGS_DEBUG_SYMBOLS)
   550 AC_SUBST(CXXFLAGS_DEBUG_SYMBOLS)
   523 AC_SUBST(CXXFLAGS_DEBUG_SYMBOLS)
   551 ])
   524 ])
       
   525 
       
   526 # Support for customization of the build process. Some build files
       
   527 # will include counterparts from this location, if they exist. This allows
       
   528 # for a degree of customization of the build targets and the rules/recipes
       
   529 # to create them
       
   530 AC_ARG_WITH([custom-make-dir], [AS_HELP_STRING([--with-custom-make-dir],
       
   531     [directory containing custom build/make files])], [CUSTOM_MAKE_DIR=$with_custom_make_dir])
       
   532 AC_SUBST(CUSTOM_MAKE_DIR)