hotspot.m4 revision 2711:d71bedc6660e
1254721Semaste#
2254721Semaste# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
3254721Semaste# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4254721Semaste#
5254721Semaste# This code is free software; you can redistribute it and/or modify it
6254721Semaste# under the terms of the GNU General Public License version 2 only, as
7254721Semaste# published by the Free Software Foundation.  Oracle designates this
8254721Semaste# particular file as subject to the "Classpath" exception as provided
9254721Semaste# by Oracle in the LICENSE file that accompanied this code.
10254721Semaste#
11254721Semaste# This code is distributed in the hope that it will be useful, but WITHOUT
12254721Semaste# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13254721Semaste# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14254721Semaste# version 2 for more details (a copy is included in the LICENSE file that
15254721Semaste# accompanied this code).
16254721Semaste#
17254721Semaste# You should have received a copy of the GNU General Public License version
18254721Semaste# 2 along with this work; if not, write to the Free Software Foundation,
19254721Semaste# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20254721Semaste#
21254721Semaste# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22254721Semaste# or visit www.oracle.com if you need additional information or have any
23254721Semaste# questions.
24254721Semaste#
25254721Semaste
26254721Semaste# All valid JVM features, regardless of platform
27254721SemasteVALID_JVM_FEATURES="compiler1 compiler2 zero shark minimal dtrace jvmti jvmci \
28254721Semaste    graal fprof vm-structs jni-check services management all-gcs nmt cds \
29254721Semaste    static-build link-time-opt aot"
30254721Semaste
31254721Semaste# All valid JVM variants
32254721SemasteVALID_JVM_VARIANTS="server client minimal core zero zeroshark custom"
33254721Semaste
34254721Semaste###############################################################################
35254721Semaste# Check if the specified JVM variant should be built. To be used in shell if
36254721Semaste# constructs, like this:
37254721Semaste# if HOTSPOT_CHECK_JVM_VARIANT(server); then
38269024Semaste#
39269024Semaste# Only valid to use after HOTSPOT_SETUP_JVM_VARIANTS has setup variants.
40269024Semaste
41269024Semaste# Definition kept in one line to allow inlining in if statements.
42269024Semaste# Additional [] needed to keep m4 from mangling shell constructs.
43269024SemasteAC_DEFUN([HOTSPOT_CHECK_JVM_VARIANT],
44269024Semaste[ [ [[ " $JVM_VARIANTS " =~ " $1 " ]] ] ])
45269024Semaste
46269024Semaste###############################################################################
47269024Semaste# Check if the specified JVM features are explicitly enabled. To be used in
48269024Semaste# shell if constructs, like this:
49269024Semaste# if HOTSPOT_CHECK_JVM_FEATURE(jvmti); then
50269024Semaste#
51254721Semaste# Only valid to use after HOTSPOT_SETUP_JVM_FEATURES has setup features.
52254721Semaste
53254721Semaste# Definition kept in one line to allow inlining in if statements.
54254721Semaste# Additional [] needed to keep m4 from mangling shell constructs.
55254721SemasteAC_DEFUN([HOTSPOT_CHECK_JVM_FEATURE],
56254721Semaste[ [ [[ " $JVM_FEATURES " =~ " $1 " ]] ] ])
57254721Semaste
58254721Semaste###############################################################################
59254721Semaste# Check which variants of the JVM that we want to build. Available variants are:
60254721Semaste#   server: normal interpreter, and a tiered C1/C2 compiler
61269024Semaste#   client: normal interpreter, and C1 (no C2 compiler)
62254721Semaste#   minimal: reduced form of client with optional features stripped out
63254721Semaste#   core: normal interpreter only, no compiler
64254721Semaste#   zero: C++ based interpreter only, no compiler
65254721Semaste#   zeroshark: C++ based interpreter, and a llvm-based compiler
66254721Semaste#   custom: baseline JVM with no default features
67254721Semaste#
68254721SemasteAC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_VARIANTS],
69254721Semaste[
70254721Semaste  AC_ARG_WITH([jvm-variants], [AS_HELP_STRING([--with-jvm-variants],
71254721Semaste      [JVM variants (separated by commas) to build (server,client,minimal,core,zero,zeroshark,custom) @<:@server@:>@])])
72254721Semaste
73254721Semaste  SETUP_HOTSPOT_TARGET_CPU_PORT
74254721Semaste
75254721Semaste  if test "x$with_jvm_variants" = x; then
76254721Semaste    with_jvm_variants="server"
77254721Semaste  fi
78254721Semaste  JVM_VARIANTS_OPT="$with_jvm_variants"
79254721Semaste
80254721Semaste  # Has the user listed more than one variant?
81254721Semaste  # Additional [] needed to keep m4 from mangling shell constructs.
82254721Semaste  if [ [[ "$JVM_VARIANTS_OPT" =~ "," ]] ]; then
83254721Semaste    BUILDING_MULTIPLE_JVM_VARIANTS=true
84254721Semaste  else
85254721Semaste    BUILDING_MULTIPLE_JVM_VARIANTS=false
86254721Semaste  fi
87254721Semaste  # Replace the commas with AND for use in the build directory name.
88254721Semaste  JVM_VARIANTS_WITH_AND=`$ECHO "$JVM_VARIANTS_OPT" | $SED -e 's/,/AND/g'`
89254721Semaste
90254721Semaste  AC_MSG_CHECKING([which variants of the JVM to build])
91254721Semaste  # JVM_VARIANTS is a space-separated list.
92254721Semaste  # Also use minimal, not minimal1 (which is kept for backwards compatibility).
93254721Semaste  JVM_VARIANTS=`$ECHO $JVM_VARIANTS_OPT | $SED -e 's/,/ /g' -e 's/minimal1/minimal/'`
94254721Semaste  AC_MSG_RESULT([$JVM_VARIANTS])
95254721Semaste
96254721Semaste  # Check that the selected variants are valid
97254721Semaste
98254721Semaste  # grep filter function inspired by a comment to http://stackoverflow.com/a/1617326
99254721Semaste  # Notice that the original variant failes on SLES 10 and 11
100254721Semaste  NEEDLE=${VALID_JVM_VARIANTS// /$'\n'}
101254721Semaste  STACK=${JVM_VARIANTS// /$'\n'}
102254721Semaste  INVALID_VARIANTS=`$GREP -Fvx "${NEEDLE}" <<< "${STACK}"`
103254721Semaste  if test "x$INVALID_VARIANTS" != x; then
104254721Semaste    AC_MSG_NOTICE([Unknown variant(s) specified: $INVALID_VARIANTS])
105254721Semaste    AC_MSG_ERROR([The available JVM variants are: $VALID_JVM_VARIANTS])
106254721Semaste  fi
107254721Semaste
108254721Semaste  # All "special" variants share the same output directory ("server")
109254721Semaste  VALID_MULTIPLE_JVM_VARIANTS="server client minimal"
110254721Semaste  NEEDLE=${VALID_MULTIPLE_JVM_VARIANTS// /$'\n'}
111254721Semaste  STACK=${JVM_VARIANTS// /$'\n'}
112254721Semaste  INVALID_MULTIPLE_VARIANTS=`$GREP -Fvx "${NEEDLE}" <<< "${STACK}"`
113254721Semaste  if  test "x$INVALID_MULTIPLE_VARIANTS" != x && test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = xtrue; then
114254721Semaste    AC_MSG_ERROR([You cannot build multiple variants with anything else than $VALID_MULTIPLE_JVM_VARIANTS.])
115254721Semaste  fi
116254721Semaste
117254721Semaste  # The "main" variant is the one used by other libs to link against during the
118254721Semaste  # build.
119254721Semaste  if test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = "xtrue"; then
120254721Semaste    MAIN_VARIANT_PRIO_ORDER="server client minimal"
121254721Semaste    for variant in $MAIN_VARIANT_PRIO_ORDER; do
122254721Semaste      if HOTSPOT_CHECK_JVM_VARIANT($variant); then
123254721Semaste        JVM_VARIANT_MAIN="$variant"
124254721Semaste        break
125269024Semaste      fi
126269024Semaste    done
127269024Semaste  else
128269024Semaste    JVM_VARIANT_MAIN="$JVM_VARIANTS"
129254721Semaste  fi
130254721Semaste
131254721Semaste  AC_SUBST(JVM_VARIANTS)
132254721Semaste  AC_SUBST(VALID_JVM_VARIANTS)
133254721Semaste  AC_SUBST(JVM_VARIANT_MAIN)
134254721Semaste
135254721Semaste  if HOTSPOT_CHECK_JVM_VARIANT(zero) || HOTSPOT_CHECK_JVM_VARIANT(zeroshark); then
136254721Semaste    # zero behaves as a platform and rewrites these values. This is really weird. :(
137254721Semaste    # We are guaranteed that we do not build any other variants when building zero.
138254721Semaste    HOTSPOT_TARGET_CPU=zero
139254721Semaste    HOTSPOT_TARGET_CPU_ARCH=zero
140254721Semaste  fi
141254721Semaste])
142254721Semaste
143254721Semaste###############################################################################
144254721Semaste# Check if dtrace should be enabled and has all prerequisites present.
145254721Semaste#
146254721SemasteAC_DEFUN_ONCE([HOTSPOT_SETUP_DTRACE],
147254721Semaste[
148254721Semaste  # Test for dtrace dependencies
149254721Semaste  AC_ARG_ENABLE([dtrace], [AS_HELP_STRING([--enable-dtrace@<:@=yes/no/auto@:>@],
150254721Semaste      [enable dtrace. Default is auto, where dtrace is enabled if all dependencies
151254721Semaste      are present.])])
152254721Semaste
153254721Semaste  DTRACE_DEP_MISSING=false
154254721Semaste
155254721Semaste  AC_MSG_CHECKING([for dtrace tool])
156254721Semaste  if test "x$DTRACE" != "x" && test -x "$DTRACE"; then
157254721Semaste    AC_MSG_RESULT([$DTRACE])
158254721Semaste  else
159254721Semaste    AC_MSG_RESULT([not found, cannot build dtrace])
160254721Semaste    DTRACE_DEP_MISSING=true
161254721Semaste  fi
162254721Semaste
163254721Semaste  AC_CHECK_HEADERS([sys/sdt.h], [DTRACE_HEADERS_OK=yes],[DTRACE_HEADERS_OK=no])
164254721Semaste  if test "x$DTRACE_HEADERS_OK" != "xyes"; then
165254721Semaste    DTRACE_DEP_MISSING=true
166254721Semaste  fi
167254721Semaste
168254721Semaste  AC_MSG_CHECKING([if dtrace should be built])
169254721Semaste  if test "x$enable_dtrace" = "xyes"; then
170254721Semaste    if test "x$DTRACE_DEP_MISSING" = "xtrue"; then
171254721Semaste      AC_MSG_RESULT([no, missing dependencies])
172254721Semaste      HELP_MSG_MISSING_DEPENDENCY([dtrace])
173254721Semaste      AC_MSG_ERROR([Cannot enable dtrace with missing dependencies. See above. $HELP_MSG])
174254721Semaste    else
175254721Semaste      INCLUDE_DTRACE=true
176254721Semaste      AC_MSG_RESULT([yes, forced])
177254721Semaste    fi
178254721Semaste  elif test "x$enable_dtrace" = "xno"; then
179254721Semaste    INCLUDE_DTRACE=false
180254721Semaste    AC_MSG_RESULT([no, forced])
181254721Semaste  elif test "x$enable_dtrace" = "xauto" || test "x$enable_dtrace" = "x"; then
182254721Semaste    if test "x$DTRACE_DEP_MISSING" = "xtrue"; then
183254721Semaste      INCLUDE_DTRACE=false
184254721Semaste      AC_MSG_RESULT([no, missing dependencies])
185254721Semaste    else
186254721Semaste      INCLUDE_DTRACE=true
187254721Semaste      AC_MSG_RESULT([yes, dependencies present])
188254721Semaste    fi
189254721Semaste  else
190254721Semaste    AC_MSG_ERROR([Invalid value for --enable-dtrace: $enable_dtrace])
191254721Semaste  fi
192254721Semaste  AC_SUBST(INCLUDE_DTRACE)
193254721Semaste])
194254721Semaste
195254721Semaste################################################################################
196254721Semaste# Check if AOT should be enabled
197254721Semaste#
198254721SemasteAC_DEFUN_ONCE([HOTSPOT_ENABLE_DISABLE_AOT],
199254721Semaste[
200254721Semaste  AC_ARG_ENABLE([aot], [AS_HELP_STRING([--enable-aot@<:@=yes/no/auto@:>@],
201254721Semaste      [enable ahead of time compilation feature. Default is auto, where aot is enabled if all dependencies are present.])])
202254721Semaste
203254721Semaste  if test "x$enable_aot" = "x" || test "x$enable_aot" = "xauto"; then
204254721Semaste    ENABLE_AOT="true"
205254721Semaste  elif test "x$enable_aot" = "xyes"; then
206254721Semaste    ENABLE_AOT="true"
207254721Semaste  elif test "x$enable_aot" = "xno"; then
208254721Semaste    ENABLE_AOT="false"
209254721Semaste    AC_MSG_CHECKING([if aot should be enabled])
210254721Semaste    AC_MSG_RESULT([no, forced])
211254721Semaste  else
212254721Semaste    AC_MSG_ERROR([Invalid value for --enable-aot: $enable_aot])
213254721Semaste  fi
214254721Semaste
215254721Semaste  if test "x$ENABLE_AOT" = "xtrue"; then
216254721Semaste    # Only enable AOT on X64 platforms.
217254721Semaste    if test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then
218254721Semaste      if test -e "$HOTSPOT_TOPDIR/src/jdk.aot"; then
219254721Semaste        if test -e "$HOTSPOT_TOPDIR/src/jdk.vm.compiler"; then
220254721Semaste          ENABLE_AOT="true"
221254721Semaste        else
222254721Semaste          ENABLE_AOT="false"
223254721Semaste          if test "x$enable_aot" = "xyes"; then
224254721Semaste            AC_MSG_ERROR([Cannot build AOT without hotspot/src/jdk.vm.compiler sources. Remove --enable-aot.])
225254721Semaste          fi
226254721Semaste        fi
227254721Semaste      else
228254721Semaste        ENABLE_AOT="false"
229254721Semaste        if test "x$enable_aot" = "xyes"; then
230254721Semaste          AC_MSG_ERROR([Cannot build AOT without hotspot/src/jdk.aot sources. Remove --enable-aot.])
231254721Semaste        fi
232254721Semaste      fi
233254721Semaste    else
234254721Semaste      ENABLE_AOT="false"
235254721Semaste      if test "x$enable_aot" = "xyes"; then
236254721Semaste        AC_MSG_ERROR([AOT is currently only supported on Linux-x86_64. Remove --enable-aot.])
237254721Semaste      fi
238254721Semaste    fi
239254721Semaste  fi
240269024Semaste
241254721Semaste  AC_SUBST(ENABLE_AOT)
242254721Semaste])
243254721Semaste
244269024Semaste###############################################################################
245254721Semaste# Set up all JVM features for each JVM variant.
246254721Semaste#
247254721SemasteAC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_FEATURES],
248269024Semaste[
249254721Semaste  # The user can in some cases supply additional jvm features. For the custom
250254721Semaste  # variant, this defines the entire variant.
251254721Semaste  AC_ARG_WITH([jvm-features], [AS_HELP_STRING([--with-jvm-features],
252254721Semaste      [additional JVM features to enable (separated by comma),  use '--help' to show possible values @<:@none@:>@])])
253254721Semaste  if test "x$with_jvm_features" != x; then
254254721Semaste    AC_MSG_CHECKING([additional JVM features])
255254721Semaste    JVM_FEATURES=`$ECHO $with_jvm_features | $SED -e 's/,/ /g'`
256254721Semaste    AC_MSG_RESULT([$JVM_FEATURES])
257254721Semaste  fi
258254721Semaste
259269024Semaste  # Override hotspot cpu definitions for ARM platforms
260254721Semaste  if test "x$OPENJDK_TARGET_CPU" = xarm; then
261254721Semaste    HOTSPOT_TARGET_CPU=arm_32
262254721Semaste    HOTSPOT_TARGET_CPU_DEFINE="ARM32"
263254721Semaste    JVM_LDFLAGS="$JVM_LDFLAGS -fsigned-char"
264254721Semaste    JVM_CFLAGS="$JVM_CFLAGS -DARM -fsigned-char"
265254721Semaste  elif test "x$OPENJDK_TARGET_CPU" = xaarch64 && test "x$HOTSPOT_TARGET_CPU_PORT" = xarm64; then
266254721Semaste    HOTSPOT_TARGET_CPU=arm_64
267254721Semaste    HOTSPOT_TARGET_CPU_ARCH=arm
268254721Semaste    JVM_LDFLAGS="$JVM_LDFLAGS -fsigned-char"
269254721Semaste    JVM_CFLAGS="$JVM_CFLAGS -DARM -fsigned-char"
270254721Semaste  fi
271254721Semaste
272254721Semaste  # Verify that dependencies are met for explicitly set features.
273269024Semaste  if HOTSPOT_CHECK_JVM_FEATURE(jvmti) && ! HOTSPOT_CHECK_JVM_FEATURE(services); then
274269024Semaste    AC_MSG_ERROR([Specified JVM feature 'jvmti' requires feature 'services'])
275269024Semaste  fi
276254721Semaste
277269024Semaste  if HOTSPOT_CHECK_JVM_FEATURE(management) && ! HOTSPOT_CHECK_JVM_FEATURE(nmt); then
278269024Semaste    AC_MSG_ERROR([Specified JVM feature 'management' requires feature 'nmt'])
279254721Semaste  fi
280269024Semaste
281269024Semaste  if HOTSPOT_CHECK_JVM_FEATURE(jvmci) && ! (HOTSPOT_CHECK_JVM_FEATURE(compiler1) || HOTSPOT_CHECK_JVM_FEATURE(compiler2)); then
282269024Semaste    AC_MSG_ERROR([Specified JVM feature 'jvmci' requires feature 'compiler2' or 'compiler1'])
283254721Semaste  fi
284269024Semaste
285269024Semaste  if HOTSPOT_CHECK_JVM_FEATURE(compiler2) && ! HOTSPOT_CHECK_JVM_FEATURE(all-gcs); then
286269024Semaste    AC_MSG_ERROR([Specified JVM feature 'compiler2' requires feature 'all-gcs'])
287269024Semaste  fi
288269024Semaste
289254721Semaste  if HOTSPOT_CHECK_JVM_FEATURE(vm-structs) && ! HOTSPOT_CHECK_JVM_FEATURE(all-gcs); then
290254721Semaste    AC_MSG_ERROR([Specified JVM feature 'vm-structs' requires feature 'all-gcs'])
291254721Semaste  fi
292254721Semaste
293254721Semaste  # Turn on additional features based on other parts of configure
294254721Semaste  if test "x$INCLUDE_DTRACE" = "xtrue"; then
295254721Semaste    JVM_FEATURES="$JVM_FEATURES dtrace"
296  else
297    if HOTSPOT_CHECK_JVM_FEATURE(dtrace); then
298      AC_MSG_ERROR([To enable dtrace, you must use --enable-dtrace])
299    fi
300  fi
301
302  if test "x$STATIC_BUILD" = "xtrue"; then
303    JVM_FEATURES="$JVM_FEATURES static-build"
304  else
305    if HOTSPOT_CHECK_JVM_FEATURE(static-build); then
306      AC_MSG_ERROR([To enable static-build, you must use --enable-static-build])
307    fi
308  fi
309
310  if ! HOTSPOT_CHECK_JVM_VARIANT(zero) && ! HOTSPOT_CHECK_JVM_VARIANT(zeroshark); then
311    if HOTSPOT_CHECK_JVM_FEATURE(zero); then
312      AC_MSG_ERROR([To enable zero/zeroshark, you must use --with-jvm-variants=zero/zeroshark])
313    fi
314  fi
315
316  if ! HOTSPOT_CHECK_JVM_VARIANT(zeroshark); then
317    if HOTSPOT_CHECK_JVM_FEATURE(shark); then
318      AC_MSG_ERROR([To enable shark, you must use --with-jvm-variants=zeroshark])
319    fi
320  fi
321
322  # Only enable jvmci on x86_64, sparcv9 and aarch64.
323  if test "x$OPENJDK_TARGET_CPU" = "xx86_64" || \
324     test "x$OPENJDK_TARGET_CPU" = "xsparcv9" || \
325     test "x$OPENJDK_TARGET_CPU" = "xaarch64" ; then
326    JVM_FEATURES_jvmci="jvmci"
327  else
328    JVM_FEATURES_jvmci=""
329  fi
330
331  AC_MSG_CHECKING([if jdk.vm.compiler should be built])
332  if HOTSPOT_CHECK_JVM_FEATURE(graal); then
333    AC_MSG_RESULT([yes, forced])
334    if test "x$JVM_FEATURES_jvmci" != "xjvmci" ; then
335      AC_MSG_ERROR([Specified JVM feature 'graal' requires feature 'jvmci'])
336    fi
337    INCLUDE_GRAAL="true"
338  else
339    # By default enable graal build where AOT is available
340    if test "x$ENABLE_AOT" = "xtrue"; then
341      AC_MSG_RESULT([yes])
342      JVM_FEATURES_graal="graal"
343      INCLUDE_GRAAL="true"
344    else
345      AC_MSG_RESULT([no])
346      JVM_FEATURES_graal=""
347      INCLUDE_GRAAL="false"
348    fi
349  fi
350
351  AC_SUBST(INCLUDE_GRAAL)
352
353  AC_MSG_CHECKING([if aot should be enabled])
354  if test "x$ENABLE_AOT" = "xtrue"; then
355    if test "x$enable_aot" = "xyes"; then
356      AC_MSG_RESULT([yes, forced])
357    else
358      AC_MSG_RESULT([yes])
359    fi
360    JVM_FEATURES_aot="aot"
361  else
362    if test "x$enable_aot" = "xno"; then
363      AC_MSG_RESULT([no, forced])
364    else
365      AC_MSG_RESULT([no])
366    fi
367    JVM_FEATURES_aot=""
368  fi
369
370  if test "x$OPENJDK_TARGET_CPU" = xarm ; then
371    # Default to use link time optimizations on minimal on arm
372    JVM_FEATURES_link_time_opt="link-time-opt"
373  else
374    JVM_FEATURES_link_time_opt=""
375  fi
376
377  # All variants but minimal (and custom) get these features
378  NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES jvmti fprof vm-structs jni-check services management all-gcs nmt cds"
379
380  # Enable features depending on variant.
381  JVM_FEATURES_server="compiler1 compiler2 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci $JVM_FEATURES_aot $JVM_FEATURES_graal"
382  JVM_FEATURES_client="compiler1 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci"
383  JVM_FEATURES_core="$NON_MINIMAL_FEATURES $JVM_FEATURES"
384  JVM_FEATURES_minimal="compiler1 minimal $JVM_FEATURES $JVM_FEATURES_link_time_opt"
385  JVM_FEATURES_zero="zero $NON_MINIMAL_FEATURES $JVM_FEATURES"
386  JVM_FEATURES_zeroshark="zero shark $NON_MINIMAL_FEATURES $JVM_FEATURES"
387  JVM_FEATURES_custom="$JVM_FEATURES"
388
389  AC_SUBST(JVM_FEATURES_server)
390  AC_SUBST(JVM_FEATURES_client)
391  AC_SUBST(JVM_FEATURES_core)
392  AC_SUBST(JVM_FEATURES_minimal)
393  AC_SUBST(JVM_FEATURES_zero)
394  AC_SUBST(JVM_FEATURES_zeroshark)
395  AC_SUBST(JVM_FEATURES_custom)
396
397  # Used for verification of Makefiles by check-jvm-feature
398  AC_SUBST(VALID_JVM_FEATURES)
399
400  # We don't support --with-jvm-interpreter anymore, use zero instead.
401  BASIC_DEPRECATED_ARG_WITH(jvm-interpreter)
402])
403
404###############################################################################
405# Validate JVM features once all setup is complete, including custom setup.
406#
407AC_DEFUN_ONCE([HOTSPOT_VALIDATE_JVM_FEATURES],
408[
409  # Keep feature lists sorted and free of duplicates
410  JVM_FEATURES_server="$($ECHO $($PRINTF '%s\n' $JVM_FEATURES_server | $SORT -u))"
411  JVM_FEATURES_client="$($ECHO $($PRINTF '%s\n' $JVM_FEATURES_client | $SORT -u))"
412  JVM_FEATURES_core="$($ECHO $($PRINTF '%s\n' $JVM_FEATURES_core | $SORT -u))"
413  JVM_FEATURES_minimal="$($ECHO $($PRINTF '%s\n' $JVM_FEATURES_minimal | $SORT -u))"
414  JVM_FEATURES_zero="$($ECHO $($PRINTF '%s\n' $JVM_FEATURES_zero | $SORT -u))"
415  JVM_FEATURES_zeroshark="$($ECHO $($PRINTF '%s\n' $JVM_FEATURES_zeroshark | $SORT -u))"
416  JVM_FEATURES_custom="$($ECHO $($PRINTF '%s\n' $JVM_FEATURES_custom | $SORT -u))"
417
418  # Validate features
419  for variant in $JVM_VARIANTS; do
420    AC_MSG_CHECKING([JVM features for JVM variant '$variant'])
421    features_var_name=JVM_FEATURES_$variant
422    JVM_FEATURES_TO_TEST=${!features_var_name}
423    AC_MSG_RESULT([$JVM_FEATURES_TO_TEST])
424    NEEDLE=${VALID_JVM_FEATURES// /$'\n'}
425    STACK=${JVM_FEATURES_TO_TEST// /$'\n'}
426    INVALID_FEATURES=`$GREP -Fvx "${NEEDLE}" <<< "${STACK}"`
427    if test "x$INVALID_FEATURES" != x; then
428      AC_MSG_ERROR([Invalid JVM feature(s): $INVALID_FEATURES])
429    fi
430  done
431])
432
433################################################################################
434#
435# Specify which sources will be used to build the 64-bit ARM port
436#
437# --with-cpu-port=arm64   will use hotspot/src/cpu/arm
438# --with-cpu-port=aarch64 will use hotspot/src/cpu/aarch64
439#
440AC_DEFUN([SETUP_HOTSPOT_TARGET_CPU_PORT],
441[
442  AC_ARG_WITH(cpu-port, [AS_HELP_STRING([--with-cpu-port],
443      [specify sources to use for Hotspot 64-bit ARM port (arm64,aarch64) @<:@aarch64@:>@ ])])
444
445  if test "x$with_cpu_port" != x; then
446    if test "x$OPENJDK_TARGET_CPU" != xaarch64; then
447      AC_MSG_ERROR([--with-cpu-port only available on aarch64])
448    fi
449    if test "x$with_cpu_port" != xarm64 && \
450        test "x$with_cpu_port" != xaarch64; then
451      AC_MSG_ERROR([--with-cpu-port must specify arm64 or aarch64])
452    fi
453    HOTSPOT_TARGET_CPU_PORT="$with_cpu_port"
454  fi
455])
456
457
458################################################################################
459# Check if gtest should be built
460#
461AC_DEFUN_ONCE([HOTSPOT_ENABLE_DISABLE_GTEST],
462[
463  AC_ARG_ENABLE([hotspot-gtest], [AS_HELP_STRING([--disable-hotspot-gtest],
464      [Disables building of the Hotspot unit tests])])
465
466  if test -e "$HOTSPOT_TOPDIR/test/native"; then
467    GTEST_DIR_EXISTS="true"
468  else
469    GTEST_DIR_EXISTS="false"
470  fi
471
472  AC_MSG_CHECKING([if Hotspot gtest unit tests should be built])
473  if test "x$enable_hotspot_gtest" = "xyes"; then
474    if test "x$GTEST_DIR_EXISTS" = "xtrue"; then
475      AC_MSG_RESULT([yes, forced])
476      BUILD_GTEST="true"
477    else
478      AC_MSG_ERROR([Cannot build gtest without the test source])
479    fi
480  elif test "x$enable_hotspot_gtest" = "xno"; then
481    AC_MSG_RESULT([no, forced])
482    BUILD_GTEST="false"
483  elif test "x$enable_hotspot_gtest" = "x"; then
484    if test "x$GTEST_DIR_EXISTS" = "xtrue"; then
485      AC_MSG_RESULT([yes])
486      BUILD_GTEST="true"
487    else
488      AC_MSG_RESULT([no])
489      BUILD_GTEST="false"
490    fi
491  else
492    AC_MSG_ERROR([--enable-gtest must be either yes or no])
493  fi
494
495  AC_SUBST(BUILD_GTEST)
496])
497