2
# Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved.
3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
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.
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).
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.
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
26
# All valid JVM variants
27
VALID_JVM_VARIANTS="server client minimal core zero custom"
29
###############################################################################
30
# Check if the specified JVM variant should be built. To be used in shell if
31
# constructs, like this:
32
# if HOTSPOT_CHECK_JVM_VARIANT(server); then
34
# Only valid to use after HOTSPOT_SETUP_JVM_VARIANTS has setup variants.
36
# Definition kept in one line to allow inlining in if statements.
37
# Additional [] needed to keep m4 from mangling shell constructs.
38
AC_DEFUN([HOTSPOT_CHECK_JVM_VARIANT],
39
[ [ [[ " $JVM_VARIANTS " =~ " $1 " ]] ] ])
41
###############################################################################
42
# Check which variants of the JVM that we want to build. Available variants are:
43
# server: normal interpreter, and a tiered C1/C2 compiler
44
# client: normal interpreter, and C1 (no C2 compiler)
45
# minimal: reduced form of client with optional features stripped out
46
# core: normal interpreter only, no compiler
47
# zero: C++ based interpreter only, no compiler
48
# custom: baseline JVM with no default features
50
AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_VARIANTS],
52
AC_ARG_WITH([jvm-variants], [AS_HELP_STRING([--with-jvm-variants],
53
[JVM variants to build, separated by commas (server client minimal core
54
zero custom) @<:@server@:>@])])
56
if test "x$with_jvm_variants" = x; then
57
with_jvm_variants="server"
59
JVM_VARIANTS_OPT="$with_jvm_variants"
61
# Has the user listed more than one variant?
62
# Additional [] needed to keep m4 from mangling shell constructs.
63
if [ [[ "$JVM_VARIANTS_OPT" =~ "," ]] ]; then
64
BUILDING_MULTIPLE_JVM_VARIANTS=true
66
BUILDING_MULTIPLE_JVM_VARIANTS=false
68
# Replace the commas with AND for use in the build directory name.
69
JVM_VARIANTS_WITH_AND=`$ECHO "$JVM_VARIANTS_OPT" | $SED -e 's/,/AND/g'`
71
AC_MSG_CHECKING([which variants of the JVM to build])
72
# JVM_VARIANTS is a space-separated list.
73
# Also use minimal, not minimal1 (which is kept for backwards compatibility).
74
JVM_VARIANTS=`$ECHO $JVM_VARIANTS_OPT | $SED -e 's/,/ /g' -e 's/minimal1/minimal/'`
75
AC_MSG_RESULT([$JVM_VARIANTS])
77
# Check that the selected variants are valid
78
UTIL_GET_NON_MATCHING_VALUES(INVALID_VARIANTS, $JVM_VARIANTS, \
80
if test "x$INVALID_VARIANTS" != x; then
81
AC_MSG_NOTICE([Unknown variant(s) specified: "$INVALID_VARIANTS"])
82
AC_MSG_NOTICE([The available JVM variants are: "$VALID_JVM_VARIANTS"])
83
AC_MSG_ERROR([Cannot continue])
86
# The "main" variant is the one used by other libs to link against during the
88
if test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = "xtrue"; then
89
MAIN_VARIANT_PRIO_ORDER="server client minimal zero"
90
for variant in $MAIN_VARIANT_PRIO_ORDER; do
91
if HOTSPOT_CHECK_JVM_VARIANT($variant); then
92
JVM_VARIANT_MAIN="$variant"
97
JVM_VARIANT_MAIN="$JVM_VARIANTS"
100
AC_SUBST(JVM_VARIANTS)
101
AC_SUBST(VALID_JVM_VARIANTS)
102
AC_SUBST(JVM_VARIANT_MAIN)
105
###############################################################################
106
# Misc hotspot setup that does not fit elsewhere.
108
AC_DEFUN_ONCE([HOTSPOT_SETUP_MISC],
110
if HOTSPOT_CHECK_JVM_VARIANT(zero); then
111
# zero behaves as a platform and rewrites these values. This is a bit weird.
112
# But when building zero, we never build any other variants so it works.
113
HOTSPOT_TARGET_CPU=zero
114
HOTSPOT_TARGET_CPU_ARCH=zero
118
AC_ARG_WITH([hotspot-build-time], [AS_HELP_STRING([--with-hotspot-build-time],
119
[timestamp to use in hotspot version string, empty means determined at build time @<:@source-date/empty@:>@])])
121
AC_MSG_CHECKING([what hotspot build time to use])
123
if test "x$with_hotspot_build_time" != x; then
124
HOTSPOT_BUILD_TIME="$with_hotspot_build_time"
125
AC_MSG_RESULT([$HOTSPOT_BUILD_TIME (from --with-hotspot-build-time)])
127
if test "x$SOURCE_DATE" = xupdated; then
128
HOTSPOT_BUILD_TIME=""
129
AC_MSG_RESULT([determined at build time (default)])
131
# If we have a fixed value for SOURCE_DATE, use it as default
132
HOTSPOT_BUILD_TIME="$SOURCE_DATE_ISO_8601"
133
AC_MSG_RESULT([$HOTSPOT_BUILD_TIME (from --with-source-date)])
137
AC_SUBST(HOTSPOT_BUILD_TIME)
140
# Override hotspot cpu definitions for ARM platforms
141
if test "x$OPENJDK_TARGET_CPU" = xarm; then
142
HOTSPOT_TARGET_CPU=arm_32
143
HOTSPOT_TARGET_CPU_DEFINE="ARM32"