Skip to content
Permalink
Browse files

8239450: Overhaul JVM feature handling in configure

Reviewed-by: erikj
  • Loading branch information
magicus committed Feb 20, 2020
1 parent 1643bc3 commit c1f4ea5d68ce94a628fc68f0ca0b07b842ef2c54
@@ -473,7 +473,7 @@ <h4 id="configure-arguments-for-tailoring-the-build">Configure Arguments for Tai
<li><code>--with-version-string=&lt;string&gt;</code> - Specify the version string this build will be identified with.</li>
<li><code>--with-version-&lt;part&gt;=&lt;value&gt;</code> - A group of options, where <code>&lt;part&gt;</code> can be any of <code>pre</code>, <code>opt</code>, <code>build</code>, <code>major</code>, <code>minor</code>, <code>security</code> or <code>patch</code>. Use these options to modify just the corresponding part of the version string from the default, or the value provided by <code>--with-version-string</code>.</li>
<li><code>--with-jvm-variants=&lt;variant&gt;[,&lt;variant&gt;...]</code> - Build the specified variant (or variants) of Hotspot. Valid variants are: <code>server</code>, <code>client</code>, <code>minimal</code>, <code>core</code>, <code>zero</code>, <code>custom</code>. Note that not all variants are possible to combine in a single build.</li>
<li><code>--with-jvm-features=&lt;feature&gt;[,&lt;feature&gt;...]</code> - Use the specified JVM features when building Hotspot. The list of features will be enabled on top of the default list. For the <code>custom</code> JVM variant, this default list is empty. A complete list of available JVM features can be found using <code>bash configure --help</code>.</li>
<li><code>--enable-jvm-feature-&lt;feature&gt;</code> or <code>--disable-jvm-feature-&lt;feature&gt;</code> - Include (or exclude) <code>&lt;feature&gt;</code> as a JVM feature in Hotspot. You can also specify a list of features to be enabled, separated by space or comma, as <code>--with-jvm-features=&lt;feature&gt;[,&lt;feature&gt;...]</code>. If you prefix <code>&lt;feature&gt;</code> with a <code>-</code>, it will be disabled. These options will modify the default list of features for the JVM variant(s) you are building. For the <code>custom</code> JVM variant, the default list is empty. A complete list of valid JVM features can be found using <code>bash configure --help</code>.</li>
<li><code>--with-target-bits=&lt;bits&gt;</code> - Create a target binary suitable for running on a <code>&lt;bits&gt;</code> platform. Use this to create 32-bit output on a 64-bit build platform, instead of doing a full cross-compile. (This is known as a <em>reduced</em> build.)</li>
</ul>
<p>On Linux, BSD and AIX, it is possible to override where Java by default searches for runtime/JNI libraries. This can be useful in situations where there is a special shared directory for system JNI libraries. This setting can in turn be overriden at runtime by setting the <code>java.library.path</code> property.</p>
@@ -684,11 +684,14 @@ features, use `bash configure --help=short` instead.)
(or variants) of Hotspot. Valid variants are: `server`, `client`,
`minimal`, `core`, `zero`, `custom`. Note that not all
variants are possible to combine in a single build.
* `--with-jvm-features=<feature>[,<feature>...]` - Use the specified JVM
features when building Hotspot. The list of features will be enabled on top
of the default list. For the `custom` JVM variant, this default list is
empty. A complete list of available JVM features can be found using `bash
configure --help`.
* `--enable-jvm-feature-<feature>` or `--disable-jvm-feature-<feature>` -
Include (or exclude) `<feature>` as a JVM feature in Hotspot. You can also
specify a list of features to be enabled, separated by space or comma, as
`--with-jvm-features=<feature>[,<feature>...]`. If you prefix `<feature>`
with a `-`, it will be disabled. These options will modify the default list
of features for the JVM variant(s) you are building. For the `custom` JVM
variant, the default list is empty. A complete list of valid JVM features
can be found using `bash configure --help`.
* `--with-target-bits=<bits>` - Create a target binary suitable for running
on a `<bits>` platform. Use this to create 32-bit output on a 64-bit build
platform, instead of doing a full cross-compile. (This is known as a
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -417,6 +417,21 @@ AC_DEFUN([BASIC_DEPRECATED_ARG_ENABLE],
fi
])

###############################################################################
# Register an --enable-* argument as an alias for another argument.
# $1: The name of the enable argument for the new alias, not including --enable-
# $2: The full name of the argument of which to make this an alias, including
# --enable- or --with-.
AC_DEFUN([BASIC_ALIASED_ARG_ENABLE],
[
AC_ARG_ENABLE($1, [AS_HELP_STRING([--enable-$1], [alias for $2])], [
# Use m4 to strip initial -- from target ($2), convert - to _, prefix enable_
# to new alias name, and create a shell variable assignment,
# e.g.: enable_old_style="$enable_new_alias"
translit(patsubst($2, --), -, _)="$[enable_]translit($1, -, _)"
])
])

###############################################################################
AC_DEFUN_ONCE([BASIC_INIT],
[
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -36,6 +36,16 @@ AC_INIT(OpenJDK, openjdk, build-dev@openjdk.java.net,,http://openjdk.java.net)
AC_CONFIG_AUX_DIR([$TOPDIR/make/autoconf/build-aux])
m4_include([build-aux/pkg.m4])

AC_DEFUN_ONCE([CUSTOM_EARLY_HOOK])
AC_DEFUN_ONCE([CUSTOM_LATE_HOOK])
AC_DEFUN_ONCE([CUSTOM_CONFIG_OUTPUT_GENERATED_HOOK])
AC_DEFUN_ONCE([CUSTOM_SUMMARY_AND_WARNINGS_HOOK])

# This line needs to be here, verbatim, after the dummy hook definitions but
# before all includes. It is replaced with custom functionality when building
# custom sources.
#CUSTOM_AUTOCONF_INCLUDE

# Include these first...
m4_include([basics.m4])
m4_include([basics_windows.m4])
@@ -47,22 +57,13 @@ m4_include([help.m4])
m4_include([hotspot.m4])
m4_include([jdk-options.m4])
m4_include([jdk-version.m4])
m4_include([jvm-features.m4])
m4_include([libraries.m4])
m4_include([platform.m4])
m4_include([source-dirs.m4])
m4_include([toolchain.m4])
m4_include([toolchain_windows.m4])

AC_DEFUN_ONCE([CUSTOM_EARLY_HOOK])
AC_DEFUN_ONCE([CUSTOM_LATE_HOOK])
AC_DEFUN_ONCE([CUSTOM_CONFIG_OUTPUT_GENERATED_HOOK])
AC_DEFUN_ONCE([CUSTOM_SUMMARY_AND_WARNINGS_HOOK])

# This line needs to be here, verbatim, after all includes and the dummy hook
# definitions. It is replaced with custom functionality when building
# custom sources.
#CUSTOM_AUTOCONF_INCLUDE

###############################################################################
#
# Initialization / Boot-strapping
@@ -203,12 +204,6 @@ JDKOPT_SETUP_CODE_COVERAGE
# AddressSanitizer
JDKOPT_SETUP_ADDRESS_SANITIZER

# Need toolchain to setup dtrace
HOTSPOT_SETUP_DTRACE
HOTSPOT_ENABLE_DISABLE_AOT
HOTSPOT_ENABLE_DISABLE_CDS
HOTSPOT_ENABLE_DISABLE_GTEST

###############################################################################
#
# Check dependencies for external and internal libraries.
@@ -221,9 +216,17 @@ BASIC_COMPILE_FIXPATH
LIB_DETERMINE_DEPENDENCIES
LIB_SETUP_LIBRARIES

# Hotspot setup depends on lib checks.
###############################################################################
#
# Setup hotspot and JVM features (needs toolchain).
#
###############################################################################

JVM_FEATURES_PARSE_OPTIONS
JVM_FEATURES_SETUP

HOTSPOT_SETUP_JVM_FEATURES
HOTSPOT_ENABLE_DISABLE_GTEST
HOTSPOT_SETUP_MISC

###############################################################################
#
@@ -277,9 +280,6 @@ BASIC_TEST_USABILITY_ISSUES
# At the end, call the custom hook. (Dummy macro if no custom sources available)
CUSTOM_LATE_HOOK

# This needs to be done after CUSTOM_LATE_HOOK since we can setup custom features.
HOTSPOT_FINALIZE_JVM_FEATURES

# Did user specify any unknown variables?
BASIC_CHECK_LEFTOVER_OVERRIDDEN

@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -192,8 +192,8 @@ AC_DEFUN_ONCE([HELP_PRINT_ADDITIONAL_HELP_AND_EXIT],
# Print available jvm features
$PRINTF "The following JVM features are available as arguments to --with-jvm-features.\n"
$PRINTF "Which are valid to use depends on the target platform.\n "
$PRINTF "%s " $VALID_JVM_FEATURES
$PRINTF "Which are valid to use depends on the target platform and JVM variant.\n "
$PRINTF "%s " valid_jvm_features
$PRINTF "\n"
# And now exit directly

0 comments on commit c1f4ea5

Please sign in to comment.