2012-07-06 01:27:07 +00:00
|
|
|
#
|
2021-03-11 16:49:24 +00:00
|
|
|
# Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
|
2012-07-06 01:27:07 +00:00
|
|
|
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
|
|
#
|
|
|
|
# This code is free software; you can redistribute it and/or modify it
|
|
|
|
# under the terms of the GNU General Public License version 2 only, as
|
|
|
|
# published by the Free Software Foundation. Oracle designates this
|
|
|
|
# particular file as subject to the "Classpath" exception as provided
|
|
|
|
# by Oracle in the LICENSE file that accompanied this code.
|
|
|
|
#
|
|
|
|
# This code is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
# version 2 for more details (a copy is included in the LICENSE file that
|
|
|
|
# accompanied this code).
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License version
|
|
|
|
# 2 along with this work; if not, write to the Free Software Foundation,
|
|
|
|
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
#
|
|
|
|
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
|
|
# or visit www.oracle.com if you need additional information or have any
|
|
|
|
# questions.
|
|
|
|
#
|
|
|
|
|
2015-12-15 10:02:03 +00:00
|
|
|
###############################################################################
|
|
|
|
# Check which variant of the JDK that we want to build.
|
|
|
|
# Currently we have:
|
|
|
|
# normal: standard edition
|
|
|
|
# but the custom make system may add other variants
|
|
|
|
#
|
|
|
|
# Effectively the JDK variant gives a name to a specific set of
|
|
|
|
# modules to compile into the JDK.
|
2012-07-06 01:27:07 +00:00
|
|
|
AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_VARIANT],
|
|
|
|
[
|
2018-09-20 18:54:19 +00:00
|
|
|
# Deprecated in JDK 12
|
2020-02-21 17:37:10 +00:00
|
|
|
UTIL_DEPRECATED_ARG_WITH([jdk-variant])
|
2012-07-06 01:27:07 +00:00
|
|
|
])
|
|
|
|
|
2013-07-03 00:38:10 +00:00
|
|
|
###############################################################################
|
2015-12-15 10:02:03 +00:00
|
|
|
# Set the debug level
|
|
|
|
# release: no debug information, all optimizations, no asserts.
|
|
|
|
# optimized: no debug information, all optimizations, no asserts, HotSpot target is 'optimized'.
|
|
|
|
# fastdebug: debug information (-g), all optimizations, all asserts
|
|
|
|
# slowdebug: debug information (-g), no optimizations, all asserts
|
2012-07-06 01:27:07 +00:00
|
|
|
AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_LEVEL],
|
|
|
|
[
|
2013-10-10 12:58:19 +00:00
|
|
|
DEBUG_LEVEL="release"
|
2012-07-06 01:27:07 +00:00
|
|
|
|
2020-03-11 07:34:14 +00:00
|
|
|
UTIL_ARG_ENABLE(NAME: debug, DEFAULT: false, RESULT: ENABLE_DEBUG,
|
|
|
|
DESC: [enable debugging (shorthand for --with-debug-level=fastdebug)],
|
|
|
|
IF_ENABLED: [ DEBUG_LEVEL="fastdebug" ])
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([which debug level to use])
|
2013-10-10 12:58:19 +00:00
|
|
|
AC_ARG_WITH([debug-level], [AS_HELP_STRING([--with-debug-level],
|
2016-02-12 10:07:35 +00:00
|
|
|
[set the debug level (release, fastdebug, slowdebug, optimized) @<:@release@:>@])],
|
2013-10-10 12:58:19 +00:00
|
|
|
[
|
2012-07-06 01:27:07 +00:00
|
|
|
DEBUG_LEVEL="${withval}"
|
2020-03-11 07:34:14 +00:00
|
|
|
if test "x$ENABLE_DEBUG" = xtrue; then
|
2013-10-10 12:58:19 +00:00
|
|
|
AC_MSG_ERROR([You cannot use both --enable-debug and --with-debug-level at the same time.])
|
2012-07-06 01:27:07 +00:00
|
|
|
fi
|
2013-10-10 12:58:19 +00:00
|
|
|
])
|
|
|
|
AC_MSG_RESULT([$DEBUG_LEVEL])
|
2012-07-06 01:27:07 +00:00
|
|
|
|
2013-10-10 12:58:19 +00:00
|
|
|
if test "x$DEBUG_LEVEL" != xrelease && \
|
2014-03-24 09:15:52 +00:00
|
|
|
test "x$DEBUG_LEVEL" != xoptimized && \
|
2013-10-10 12:58:19 +00:00
|
|
|
test "x$DEBUG_LEVEL" != xfastdebug && \
|
|
|
|
test "x$DEBUG_LEVEL" != xslowdebug; then
|
2016-02-12 10:07:35 +00:00
|
|
|
AC_MSG_ERROR([Allowed debug levels are: release, fastdebug, slowdebug and optimized])
|
2013-10-10 12:58:19 +00:00
|
|
|
fi
|
2016-04-08 11:14:23 +00:00
|
|
|
|
|
|
|
# Translate DEBUG_LEVEL to debug level used by Hotspot
|
|
|
|
HOTSPOT_DEBUG_LEVEL="$DEBUG_LEVEL"
|
|
|
|
if test "x$DEBUG_LEVEL" = xrelease; then
|
|
|
|
HOTSPOT_DEBUG_LEVEL="product"
|
|
|
|
elif test "x$DEBUG_LEVEL" = xslowdebug; then
|
|
|
|
HOTSPOT_DEBUG_LEVEL="debug"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "x$DEBUG_LEVEL" = xoptimized; then
|
|
|
|
# The debug level 'optimized' is a little special because it is currently only
|
|
|
|
# applicable to the HotSpot build where it means to build a completely
|
|
|
|
# optimized version of the VM without any debugging code (like for the
|
|
|
|
# 'release' debug level which is called 'product' in the HotSpot build) but
|
|
|
|
# with the exception that it can contain additional code which is otherwise
|
|
|
|
# protected by '#ifndef PRODUCT' macros. These 'optimized' builds are used to
|
|
|
|
# test new and/or experimental features which are not intended for customer
|
|
|
|
# shipment. Because these new features need to be tested and benchmarked in
|
|
|
|
# real world scenarios, we want to build the containing JDK at the 'release'
|
|
|
|
# debug level.
|
|
|
|
DEBUG_LEVEL="release"
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_SUBST(HOTSPOT_DEBUG_LEVEL)
|
|
|
|
AC_SUBST(DEBUG_LEVEL)
|
2012-07-06 01:27:07 +00:00
|
|
|
])
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
#
|
|
|
|
# Should we build only OpenJDK even if closed sources are present?
|
|
|
|
#
|
2013-01-11 09:46:59 +00:00
|
|
|
AC_DEFUN_ONCE([JDKOPT_SETUP_OPEN_OR_CUSTOM],
|
|
|
|
[
|
2020-03-11 07:34:14 +00:00
|
|
|
UTIL_ARG_ENABLE(NAME: openjdk-only, DEFAULT: false,
|
|
|
|
RESULT: SUPPRESS_CUSTOM_EXTENSIONS,
|
|
|
|
DESC: [suppress building custom source even if present],
|
|
|
|
CHECKING_MSG: [if custom source is suppressed (openjdk-only)])
|
2013-01-11 09:46:59 +00:00
|
|
|
])
|
|
|
|
|
|
|
|
AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS],
|
|
|
|
[
|
2016-09-26 12:57:00 +00:00
|
|
|
# Should we build a JDK without a graphical UI?
|
2020-03-11 07:34:14 +00:00
|
|
|
UTIL_ARG_ENABLE(NAME: headless-only, DEFAULT: false,
|
|
|
|
RESULT: ENABLE_HEADLESS_ONLY,
|
|
|
|
DESC: [only build headless (no GUI) support],
|
|
|
|
CHECKING_MSG: [if we should build headless-only (no GUI)])
|
2016-09-26 12:57:00 +00:00
|
|
|
AC_SUBST(ENABLE_HEADLESS_ONLY)
|
2012-07-06 01:27:07 +00:00
|
|
|
|
2020-01-24 09:16:35 +00:00
|
|
|
# should we linktime gc unused code sections in the JDK build ?
|
2020-03-11 07:34:14 +00:00
|
|
|
if test "x$OPENJDK_TARGET_OS" = "xlinux" && test "x$OPENJDK_TARGET_CPU" = xs390x; then
|
|
|
|
LINKTIME_GC_DEFAULT=true
|
2020-01-24 09:16:35 +00:00
|
|
|
else
|
2020-03-11 07:34:14 +00:00
|
|
|
LINKTIME_GC_DEFAULT=false
|
2020-01-24 09:16:35 +00:00
|
|
|
fi
|
|
|
|
|
2020-03-11 07:34:14 +00:00
|
|
|
UTIL_ARG_ENABLE(NAME: linktime-gc, DEFAULT: $LINKTIME_GC_DEFAULT,
|
|
|
|
DEFAULT_DESC: [auto], RESULT: ENABLE_LINKTIME_GC,
|
|
|
|
DESC: [use link time gc on unused code sections in the JDK build],
|
|
|
|
CHECKING_MSG: [if linker should clean out unused code (linktime-gc)])
|
2020-01-24 09:16:35 +00:00
|
|
|
AC_SUBST(ENABLE_LINKTIME_GC)
|
|
|
|
|
2020-03-11 07:34:14 +00:00
|
|
|
# Check for full doc dependencies
|
|
|
|
FULL_DOCS_AVAILABLE=true
|
2017-04-19 08:58:18 +00:00
|
|
|
AC_MSG_CHECKING([for graphviz dot])
|
|
|
|
if test "x$DOT" != "x"; then
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([no, cannot generate full docs])
|
2020-03-11 07:34:14 +00:00
|
|
|
FULL_DOCS_AVAILABLE=false
|
2017-04-19 08:58:18 +00:00
|
|
|
fi
|
|
|
|
|
2017-04-23 19:34:02 +00:00
|
|
|
AC_MSG_CHECKING([for pandoc])
|
2020-04-22 14:06:23 +00:00
|
|
|
if test "x$ENABLE_PANDOC" = "xtrue"; then
|
2017-04-23 19:34:02 +00:00
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([no, cannot generate full docs])
|
2020-03-11 07:34:14 +00:00
|
|
|
FULL_DOCS_AVAILABLE=false
|
2017-04-19 08:58:18 +00:00
|
|
|
fi
|
|
|
|
|
2020-03-11 07:34:14 +00:00
|
|
|
# Should we build the complete docs, or just a lightweight version?
|
|
|
|
UTIL_ARG_ENABLE(NAME: full-docs, DEFAULT: auto, RESULT: ENABLE_FULL_DOCS,
|
|
|
|
AVAILABLE: $FULL_DOCS_AVAILABLE, DESC: [build complete documentation],
|
|
|
|
DEFAULT_DESC: [enabled if all tools found])
|
2017-04-19 08:58:18 +00:00
|
|
|
AC_SUBST(ENABLE_FULL_DOCS)
|
|
|
|
|
2013-10-10 12:58:19 +00:00
|
|
|
# Choose cacerts source file
|
|
|
|
AC_ARG_WITH(cacerts-file, [AS_HELP_STRING([--with-cacerts-file],
|
|
|
|
[specify alternative cacerts file])])
|
2017-09-25 08:47:28 +00:00
|
|
|
AC_MSG_CHECKING([for cacerts file])
|
|
|
|
if test "x$with_cacerts_file" == x; then
|
|
|
|
AC_MSG_RESULT([default])
|
|
|
|
else
|
2012-07-06 01:27:07 +00:00
|
|
|
CACERTS_FILE=$with_cacerts_file
|
2017-09-25 08:47:28 +00:00
|
|
|
if test ! -f "$CACERTS_FILE"; then
|
|
|
|
AC_MSG_RESULT([fail])
|
|
|
|
AC_MSG_ERROR([Specified cacerts file "$CACERTS_FILE" does not exist])
|
|
|
|
fi
|
|
|
|
AC_MSG_RESULT([$CACERTS_FILE])
|
2013-10-10 12:58:19 +00:00
|
|
|
fi
|
|
|
|
AC_SUBST(CACERTS_FILE)
|
|
|
|
|
|
|
|
# Enable or disable unlimited crypto
|
2020-03-11 07:34:14 +00:00
|
|
|
UTIL_ARG_ENABLE(NAME: unlimited-crypto, DEFAULT: true, RESULT: UNLIMITED_CRYPTO,
|
|
|
|
DESC: [enable unlimited crypto policy])
|
2013-10-10 12:58:19 +00:00
|
|
|
AC_SUBST(UNLIMITED_CRYPTO)
|
|
|
|
|
2016-02-12 10:07:35 +00:00
|
|
|
# Should we build the serviceability agent (SA)?
|
|
|
|
INCLUDE_SA=true
|
2017-10-15 20:54:03 +00:00
|
|
|
if HOTSPOT_CHECK_JVM_VARIANT(zero); then
|
2016-02-12 10:07:35 +00:00
|
|
|
INCLUDE_SA=false
|
|
|
|
fi
|
|
|
|
if test "x$OPENJDK_TARGET_OS" = xaix ; then
|
|
|
|
INCLUDE_SA=false
|
|
|
|
fi
|
2018-04-24 15:56:25 +00:00
|
|
|
if test "x$OPENJDK_TARGET_CPU" = xs390x ; then
|
|
|
|
INCLUDE_SA=false
|
|
|
|
fi
|
2016-02-12 10:07:35 +00:00
|
|
|
AC_SUBST(INCLUDE_SA)
|
|
|
|
|
2013-10-10 12:58:19 +00:00
|
|
|
# Compress jars
|
|
|
|
COMPRESS_JARS=false
|
2012-07-06 01:27:07 +00:00
|
|
|
|
2013-10-10 12:58:19 +00:00
|
|
|
AC_SUBST(COMPRESS_JARS)
|
|
|
|
|
2015-06-10 22:21:56 +00:00
|
|
|
# Setup default copyright year. Mostly overridden when building close to a new year.
|
2014-11-18 15:07:57 +00:00
|
|
|
AC_ARG_WITH(copyright-year, [AS_HELP_STRING([--with-copyright-year],
|
|
|
|
[Set copyright year value for build @<:@current year@:>@])])
|
|
|
|
if test "x$with_copyright_year" = xyes; then
|
|
|
|
AC_MSG_ERROR([Copyright year must have a value])
|
|
|
|
elif test "x$with_copyright_year" != x; then
|
|
|
|
COPYRIGHT_YEAR="$with_copyright_year"
|
2021-11-19 13:55:08 +00:00
|
|
|
elif test "x$SOURCE_DATE_EPOCH" != x; then
|
|
|
|
if test "x$IS_GNU_DATE" = xyes; then
|
|
|
|
COPYRIGHT_YEAR=`date --date=@$SOURCE_DATE_EPOCH +%Y`
|
|
|
|
else
|
|
|
|
COPYRIGHT_YEAR=`date -j -f %s $SOURCE_DATE_EPOCH +%Y`
|
|
|
|
fi
|
2014-11-18 15:07:57 +00:00
|
|
|
else
|
2016-06-07 13:42:20 +00:00
|
|
|
COPYRIGHT_YEAR=`$DATE +'%Y'`
|
2014-11-18 15:07:57 +00:00
|
|
|
fi
|
2013-10-10 12:58:19 +00:00
|
|
|
AC_SUBST(COPYRIGHT_YEAR)
|
2018-11-29 03:29:35 +00:00
|
|
|
|
|
|
|
# Override default library path
|
|
|
|
AC_ARG_WITH([jni-libpath], [AS_HELP_STRING([--with-jni-libpath],
|
|
|
|
[override default JNI library search path])])
|
|
|
|
AC_MSG_CHECKING([for jni library path])
|
|
|
|
if test "x${with_jni_libpath}" = "x" || test "x${with_jni_libpath}" = "xno"; then
|
|
|
|
AC_MSG_RESULT([default])
|
|
|
|
elif test "x${with_jni_libpath}" = "xyes"; then
|
|
|
|
AC_MSG_RESULT([invalid])
|
|
|
|
AC_MSG_ERROR([The --with-jni-libpath option requires an argument.])
|
|
|
|
else
|
|
|
|
HOTSPOT_OVERRIDE_LIBPATH=${with_jni_libpath}
|
|
|
|
if test "x$OPENJDK_TARGET_OS" != "xlinux" &&
|
|
|
|
test "x$OPENJDK_TARGET_OS" != "xbsd" &&
|
|
|
|
test "x$OPENJDK_TARGET_OS" != "xaix"; then
|
|
|
|
AC_MSG_RESULT([fail])
|
|
|
|
AC_MSG_ERROR([Overriding JNI library path is supported only on Linux, BSD and AIX.])
|
|
|
|
fi
|
|
|
|
AC_MSG_RESULT(${HOTSPOT_OVERRIDE_LIBPATH})
|
|
|
|
fi
|
|
|
|
AC_SUBST(HOTSPOT_OVERRIDE_LIBPATH)
|
|
|
|
|
2012-07-06 01:27:07 +00:00
|
|
|
])
|
|
|
|
|
2015-06-10 22:21:56 +00:00
|
|
|
###############################################################################
|
|
|
|
|
2012-07-06 01:27:07 +00:00
|
|
|
AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS],
|
|
|
|
[
|
2013-10-10 12:58:19 +00:00
|
|
|
#
|
2020-02-07 07:38:40 +00:00
|
|
|
# Native debug symbols.
|
2013-10-10 12:58:19 +00:00
|
|
|
# This must be done after the toolchain is setup, since we're looking at objcopy.
|
|
|
|
#
|
2015-12-11 12:58:28 +00:00
|
|
|
AC_MSG_CHECKING([what type of native debug symbols to use])
|
|
|
|
AC_ARG_WITH([native-debug-symbols],
|
|
|
|
[AS_HELP_STRING([--with-native-debug-symbols],
|
2016-02-12 10:07:35 +00:00
|
|
|
[set the native debug symbol configuration (none, internal, external, zipped) @<:@varying@:>@])],
|
2015-12-16 14:50:40 +00:00
|
|
|
[
|
2021-04-29 12:35:56 +00:00
|
|
|
if test "x$OPENJDK_TARGET_OS" = xwindows; then
|
2020-02-07 07:38:40 +00:00
|
|
|
if test "x$withval" = xinternal; then
|
|
|
|
AC_MSG_ERROR([Windows does not support the parameter 'internal' for --with-native-debug-symbols])
|
2020-01-10 14:38:25 +00:00
|
|
|
fi
|
2015-12-16 14:50:40 +00:00
|
|
|
fi
|
|
|
|
],
|
|
|
|
[
|
2020-01-10 14:38:25 +00:00
|
|
|
if test "x$STATIC_BUILD" = xtrue; then
|
|
|
|
with_native_debug_symbols="none"
|
2015-12-16 14:50:40 +00:00
|
|
|
else
|
2021-04-29 12:35:56 +00:00
|
|
|
with_native_debug_symbols="external"
|
2015-12-16 14:50:40 +00:00
|
|
|
fi
|
|
|
|
])
|
2020-02-07 07:38:40 +00:00
|
|
|
AC_MSG_RESULT([$with_native_debug_symbols])
|
2015-12-11 12:58:28 +00:00
|
|
|
|
2020-02-07 07:38:40 +00:00
|
|
|
if test "x$with_native_debug_symbols" = xnone; then
|
2020-01-10 14:38:25 +00:00
|
|
|
COMPILE_WITH_DEBUG_SYMBOLS=false
|
|
|
|
COPY_DEBUG_SYMBOLS=false
|
|
|
|
ZIP_EXTERNAL_DEBUG_SYMBOLS=false
|
2020-02-07 07:38:40 +00:00
|
|
|
elif test "x$with_native_debug_symbols" = xinternal; then
|
2020-01-10 14:38:25 +00:00
|
|
|
COMPILE_WITH_DEBUG_SYMBOLS=true
|
|
|
|
COPY_DEBUG_SYMBOLS=false
|
|
|
|
ZIP_EXTERNAL_DEBUG_SYMBOLS=false
|
2020-02-07 07:38:40 +00:00
|
|
|
elif test "x$with_native_debug_symbols" = xexternal; then
|
2015-12-11 12:58:28 +00:00
|
|
|
|
8244224: Implementation of JEP 381: Remove the Solaris and SPARC Ports
Reviewed-by: alanb, bchristi, dcubed, dfuchs, eosterlund, erikj, glaubitz, ihse, iignatyev, jjiang, kbarrett, ksrini, kvn, naoto, prr, rriggs, serb, sspitsyn, stefank, tschatzl, valeriep, weijun, weijun
2020-05-21 00:33:37 +00:00
|
|
|
if test "x$OPENJDK_TARGET_OS" = xlinux; then
|
2015-12-11 16:15:48 +00:00
|
|
|
if test "x$OBJCOPY" = x; then
|
|
|
|
# enabling of enable-debug-symbols and can't find objcopy
|
|
|
|
# this is an error
|
|
|
|
AC_MSG_ERROR([Unable to find objcopy, cannot enable native debug symbols])
|
|
|
|
fi
|
2015-12-11 12:58:28 +00:00
|
|
|
fi
|
2013-10-10 12:58:19 +00:00
|
|
|
|
2016-01-20 08:53:52 +00:00
|
|
|
COMPILE_WITH_DEBUG_SYMBOLS=true
|
|
|
|
COPY_DEBUG_SYMBOLS=true
|
|
|
|
ZIP_EXTERNAL_DEBUG_SYMBOLS=false
|
2020-02-07 07:38:40 +00:00
|
|
|
elif test "x$with_native_debug_symbols" = xzipped; then
|
2015-12-11 12:58:28 +00:00
|
|
|
|
8244224: Implementation of JEP 381: Remove the Solaris and SPARC Ports
Reviewed-by: alanb, bchristi, dcubed, dfuchs, eosterlund, erikj, glaubitz, ihse, iignatyev, jjiang, kbarrett, ksrini, kvn, naoto, prr, rriggs, serb, sspitsyn, stefank, tschatzl, valeriep, weijun, weijun
2020-05-21 00:33:37 +00:00
|
|
|
if test "x$OPENJDK_TARGET_OS" = xlinux; then
|
2015-12-11 16:15:48 +00:00
|
|
|
if test "x$OBJCOPY" = x; then
|
|
|
|
# enabling of enable-debug-symbols and can't find objcopy
|
|
|
|
# this is an error
|
|
|
|
AC_MSG_ERROR([Unable to find objcopy, cannot enable native debug symbols])
|
|
|
|
fi
|
2013-10-10 12:58:19 +00:00
|
|
|
fi
|
|
|
|
|
2016-01-20 08:53:52 +00:00
|
|
|
COMPILE_WITH_DEBUG_SYMBOLS=true
|
|
|
|
COPY_DEBUG_SYMBOLS=true
|
2020-01-10 14:38:25 +00:00
|
|
|
ZIP_EXTERNAL_DEBUG_SYMBOLS=true
|
2013-10-10 12:58:19 +00:00
|
|
|
else
|
2015-12-11 12:58:28 +00:00
|
|
|
AC_MSG_ERROR([Allowed native debug symbols are: none, internal, external, zipped])
|
2013-10-10 12:58:19 +00:00
|
|
|
fi
|
|
|
|
|
2016-01-20 08:53:52 +00:00
|
|
|
AC_SUBST(COMPILE_WITH_DEBUG_SYMBOLS)
|
|
|
|
AC_SUBST(COPY_DEBUG_SYMBOLS)
|
|
|
|
AC_SUBST(ZIP_EXTERNAL_DEBUG_SYMBOLS)
|
2020-02-07 07:38:40 +00:00
|
|
|
|
|
|
|
# Should we add external native debug symbols to the shipped bundles?
|
|
|
|
AC_MSG_CHECKING([if we should add external native debug symbols to the shipped bundles])
|
|
|
|
AC_ARG_WITH([external-symbols-in-bundles],
|
|
|
|
[AS_HELP_STRING([--with-external-symbols-in-bundles],
|
|
|
|
[which type of external native debug symbol information shall be shipped in product bundles (none, public, full)
|
|
|
|
(e.g. ship full/stripped pdbs on Windows) @<:@none@:>@])])
|
|
|
|
|
|
|
|
if test "x$with_external_symbols_in_bundles" = x || test "x$with_external_symbols_in_bundles" = xnone ; then
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
elif test "x$with_external_symbols_in_bundles" = xfull || test "x$with_external_symbols_in_bundles" = xpublic ; then
|
|
|
|
if test "x$OPENJDK_TARGET_OS" != xwindows ; then
|
|
|
|
AC_MSG_ERROR([--with-external-symbols-in-bundles currently only works on windows!])
|
|
|
|
elif test "x$COPY_DEBUG_SYMBOLS" != xtrue ; then
|
|
|
|
AC_MSG_ERROR([--with-external-symbols-in-bundles only works when --with-native-debug-symbols=external is used!])
|
|
|
|
elif test "x$with_external_symbols_in_bundles" = xfull ; then
|
|
|
|
AC_MSG_RESULT([full])
|
|
|
|
SHIP_DEBUG_SYMBOLS=full
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([public])
|
|
|
|
SHIP_DEBUG_SYMBOLS=public
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
AC_MSG_ERROR([$with_external_symbols_in_bundles is an unknown value for --with-external-symbols-in-bundles])
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_SUBST(SHIP_DEBUG_SYMBOLS)
|
2012-07-06 01:27:07 +00:00
|
|
|
])
|
2015-03-10 13:36:56 +00:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
#
|
2019-02-20 19:32:53 +00:00
|
|
|
# Native and Java code coverage
|
2015-03-10 13:36:56 +00:00
|
|
|
#
|
|
|
|
AC_DEFUN_ONCE([JDKOPT_SETUP_CODE_COVERAGE],
|
|
|
|
[
|
2020-03-11 07:34:14 +00:00
|
|
|
UTIL_ARG_ENABLE(NAME: native-coverage, DEFAULT: false, RESULT: GCOV_ENABLED,
|
|
|
|
DESC: [enable native compilation with code coverage data],
|
|
|
|
CHECK_AVAILABLE: [
|
|
|
|
AC_MSG_CHECKING([if native coverage is available])
|
|
|
|
if test "x$TOOLCHAIN_TYPE" = "xgcc" ||
|
|
|
|
test "x$TOOLCHAIN_TYPE" = "xclang"; then
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
AVAILABLE=false
|
|
|
|
fi
|
|
|
|
],
|
|
|
|
IF_ENABLED: [
|
2019-02-19 21:51:11 +00:00
|
|
|
GCOV_CFLAGS="-fprofile-arcs -ftest-coverage -fno-inline"
|
|
|
|
GCOV_LDFLAGS="-fprofile-arcs"
|
|
|
|
JVM_CFLAGS="$JVM_CFLAGS $GCOV_CFLAGS"
|
|
|
|
JVM_LDFLAGS="$JVM_LDFLAGS $GCOV_LDFLAGS"
|
|
|
|
CFLAGS_JDKLIB="$CFLAGS_JDKLIB $GCOV_CFLAGS"
|
|
|
|
CFLAGS_JDKEXE="$CFLAGS_JDKEXE $GCOV_CFLAGS"
|
|
|
|
CXXFLAGS_JDKLIB="$CXXFLAGS_JDKLIB $GCOV_CFLAGS"
|
|
|
|
CXXFLAGS_JDKEXE="$CXXFLAGS_JDKEXE $GCOV_CFLAGS"
|
|
|
|
LDFLAGS_JDKLIB="$LDFLAGS_JDKLIB $GCOV_LDFLAGS"
|
|
|
|
LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE $GCOV_LDFLAGS"
|
2020-03-11 07:34:14 +00:00
|
|
|
])
|
2015-03-10 13:36:56 +00:00
|
|
|
AC_SUBST(GCOV_ENABLED)
|
2018-11-29 14:34:46 +00:00
|
|
|
|
|
|
|
AC_ARG_WITH(jcov, [AS_HELP_STRING([--with-jcov],
|
|
|
|
[jcov library location])])
|
|
|
|
AC_ARG_WITH(jcov-input-jdk, [AS_HELP_STRING([--with-jcov-input-jdk],
|
|
|
|
[jdk image to instrument])])
|
2019-04-11 11:05:11 +00:00
|
|
|
AC_ARG_WITH(jcov-filters, [AS_HELP_STRING([--with-jcov-filters],
|
|
|
|
[filters to limit code for jcov instrumentation and report generation])])
|
2018-11-29 14:34:46 +00:00
|
|
|
JCOV_HOME=
|
|
|
|
JCOV_INPUT_JDK=
|
|
|
|
JCOV_ENABLED=
|
2019-04-11 11:05:11 +00:00
|
|
|
JCOV_FILTERS=
|
2018-11-29 14:34:46 +00:00
|
|
|
if test "x$with_jcov" = "x" ; then
|
|
|
|
JCOV_ENABLED="false"
|
|
|
|
else
|
|
|
|
JCOV_HOME="$with_jcov"
|
|
|
|
if test ! -f "$JCOV_HOME/lib/jcov.jar"; then
|
|
|
|
AC_MSG_RESULT([fail])
|
|
|
|
AC_MSG_ERROR([Invalid JCov bundle: "$JCOV_HOME/lib/jcov.jar" does not exist])
|
|
|
|
fi
|
|
|
|
JCOV_ENABLED="true"
|
2020-02-21 17:37:10 +00:00
|
|
|
UTIL_FIXUP_PATH(JCOV_HOME)
|
2018-11-29 14:34:46 +00:00
|
|
|
if test "x$with_jcov_input_jdk" != "x" ; then
|
|
|
|
JCOV_INPUT_JDK="$with_jcov_input_jdk"
|
2020-12-07 15:55:53 +00:00
|
|
|
if test ! -f "$JCOV_INPUT_JDK/bin/java" && test ! -f "$JCOV_INPUT_JDK/bin/java.exe"; then
|
2018-11-29 14:34:46 +00:00
|
|
|
AC_MSG_RESULT([fail])
|
2020-12-07 15:55:53 +00:00
|
|
|
AC_MSG_ERROR([Invalid JDK bundle: "$JCOV_INPUT_JDK/bin/java" does not exist])
|
2018-11-29 14:34:46 +00:00
|
|
|
fi
|
2020-02-21 17:37:10 +00:00
|
|
|
UTIL_FIXUP_PATH(JCOV_INPUT_JDK)
|
2018-11-29 14:34:46 +00:00
|
|
|
fi
|
2019-04-11 11:05:11 +00:00
|
|
|
if test "x$with_jcov_filters" != "x" ; then
|
|
|
|
JCOV_FILTERS="$with_jcov_filters"
|
|
|
|
fi
|
2018-11-29 14:34:46 +00:00
|
|
|
fi
|
|
|
|
AC_SUBST(JCOV_ENABLED)
|
|
|
|
AC_SUBST(JCOV_HOME)
|
|
|
|
AC_SUBST(JCOV_INPUT_JDK)
|
2019-04-11 11:05:11 +00:00
|
|
|
AC_SUBST(JCOV_FILTERS)
|
2015-03-10 13:36:56 +00:00
|
|
|
])
|
2015-10-19 17:21:27 +00:00
|
|
|
|
2017-10-31 14:03:02 +00:00
|
|
|
###############################################################################
|
|
|
|
#
|
|
|
|
# AddressSanitizer
|
|
|
|
#
|
|
|
|
AC_DEFUN_ONCE([JDKOPT_SETUP_ADDRESS_SANITIZER],
|
|
|
|
[
|
2020-03-11 07:34:14 +00:00
|
|
|
UTIL_ARG_ENABLE(NAME: asan, DEFAULT: false,
|
|
|
|
DESC: [enable AddressSanitizer],
|
|
|
|
CHECK_AVAILABLE: [
|
|
|
|
AC_MSG_CHECKING([if AddressSanitizer (asan) is available])
|
|
|
|
if test "x$TOOLCHAIN_TYPE" = "xgcc" ||
|
|
|
|
test "x$TOOLCHAIN_TYPE" = "xclang"; then
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
AVAILABLE=false
|
|
|
|
fi
|
|
|
|
],
|
|
|
|
IF_ENABLED: [
|
2020-10-13 03:38:41 +00:00
|
|
|
# ASan is simply incompatible with gcc -Wstringop-truncation. See
|
|
|
|
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85650
|
|
|
|
# It's harmless to be suppressed in clang as well.
|
|
|
|
ASAN_CFLAGS="-fsanitize=address -Wno-stringop-truncation -fno-omit-frame-pointer"
|
2017-10-31 14:03:02 +00:00
|
|
|
ASAN_LDFLAGS="-fsanitize=address"
|
|
|
|
JVM_CFLAGS="$JVM_CFLAGS $ASAN_CFLAGS"
|
|
|
|
JVM_LDFLAGS="$JVM_LDFLAGS $ASAN_LDFLAGS"
|
|
|
|
CFLAGS_JDKLIB="$CFLAGS_JDKLIB $ASAN_CFLAGS"
|
|
|
|
CFLAGS_JDKEXE="$CFLAGS_JDKEXE $ASAN_CFLAGS"
|
|
|
|
CXXFLAGS_JDKLIB="$CXXFLAGS_JDKLIB $ASAN_CFLAGS"
|
|
|
|
CXXFLAGS_JDKEXE="$CXXFLAGS_JDKEXE $ASAN_CFLAGS"
|
|
|
|
LDFLAGS_JDKLIB="$LDFLAGS_JDKLIB $ASAN_LDFLAGS"
|
|
|
|
LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE $ASAN_LDFLAGS"
|
|
|
|
ASAN_ENABLED="yes"
|
2020-03-11 07:34:14 +00:00
|
|
|
],
|
|
|
|
IF_DISABLED: [
|
|
|
|
ASAN_ENABLED="no"
|
|
|
|
])
|
2017-10-31 14:03:02 +00:00
|
|
|
|
|
|
|
AC_SUBST(ASAN_ENABLED)
|
|
|
|
])
|
|
|
|
|
2015-10-19 17:21:27 +00:00
|
|
|
################################################################################
|
|
|
|
#
|
2016-02-12 10:07:35 +00:00
|
|
|
# Static build support. When enabled will generate static
|
2015-10-19 17:21:27 +00:00
|
|
|
# libraries instead of shared libraries for all JDK libs.
|
|
|
|
#
|
|
|
|
AC_DEFUN_ONCE([JDKOPT_SETUP_STATIC_BUILD],
|
|
|
|
[
|
2020-03-11 07:34:14 +00:00
|
|
|
UTIL_ARG_ENABLE(NAME: static-build, DEFAULT: false, RESULT: STATIC_BUILD,
|
|
|
|
DESC: [enable static library build],
|
|
|
|
CHECKING_MSG: [if static build is enabled],
|
|
|
|
CHECK_AVAILABLE: [
|
|
|
|
AC_MSG_CHECKING([if static build is available])
|
|
|
|
if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
AVAILABLE=false
|
|
|
|
fi
|
|
|
|
],
|
|
|
|
IF_ENABLED: [
|
|
|
|
STATIC_BUILD_CFLAGS="-DSTATIC_BUILD=1"
|
|
|
|
CFLAGS_JDKLIB_EXTRA="$CFLAGS_JDKLIB_EXTRA $STATIC_BUILD_CFLAGS"
|
|
|
|
CXXFLAGS_JDKLIB_EXTRA="$CXXFLAGS_JDKLIB_EXTRA $STATIC_BUILD_CFLAGS"
|
|
|
|
])
|
2015-10-19 17:21:27 +00:00
|
|
|
AC_SUBST(STATIC_BUILD)
|
|
|
|
])
|
2016-03-17 19:03:53 +00:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
#
|
2016-04-15 16:07:34 +00:00
|
|
|
# jlink options.
|
2016-03-17 19:03:53 +00:00
|
|
|
# We always keep packaged modules in JDK image.
|
|
|
|
#
|
|
|
|
AC_DEFUN_ONCE([JDKOPT_SETUP_JLINK_OPTIONS],
|
|
|
|
[
|
2020-03-11 07:34:14 +00:00
|
|
|
UTIL_ARG_ENABLE(NAME: keep-packaged-modules, DEFAULT: true,
|
|
|
|
RESULT: JLINK_KEEP_PACKAGED_MODULES,
|
|
|
|
DESC: [enable keeping of packaged modules in jdk image],
|
|
|
|
CHECKING_MSG: [if packaged modules are kept])
|
2016-03-17 19:03:53 +00:00
|
|
|
AC_SUBST(JLINK_KEEP_PACKAGED_MODULES)
|
|
|
|
])
|
2016-04-15 16:07:34 +00:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# Check if building of the jtreg failure handler should be enabled.
|
|
|
|
#
|
|
|
|
AC_DEFUN_ONCE([JDKOPT_ENABLE_DISABLE_FAILURE_HANDLER],
|
|
|
|
[
|
2020-03-11 07:34:14 +00:00
|
|
|
UTIL_ARG_ENABLE(NAME: jtreg-failure-handler, DEFAULT: auto,
|
|
|
|
RESULT: BUILD_FAILURE_HANDLER,
|
|
|
|
DESC: [enable keeping of packaged modules in jdk image],
|
|
|
|
DEFAULT_DESC: [enabled if jtreg is present],
|
|
|
|
CHECKING_MSG: [if the jtreg failure handler should be built],
|
|
|
|
CHECK_AVAILABLE: [
|
|
|
|
AC_MSG_CHECKING([if the jtreg failure handler is available])
|
|
|
|
if test "x$JT_HOME" != "x"; then
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
else
|
|
|
|
AVAILABLE=false
|
|
|
|
AC_MSG_RESULT([no (jtreg not present)])
|
|
|
|
fi
|
|
|
|
])
|
2016-04-15 16:07:34 +00:00
|
|
|
AC_SUBST(BUILD_FAILURE_HANDLER)
|
|
|
|
])
|
2016-05-25 10:53:26 +00:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# Enable or disable generation of the classlist at build time
|
|
|
|
#
|
|
|
|
AC_DEFUN_ONCE([JDKOPT_ENABLE_DISABLE_GENERATE_CLASSLIST],
|
|
|
|
[
|
2020-03-11 07:34:14 +00:00
|
|
|
# In GenerateLinkOptData.gmk, DumpLoadedClassList is used to generate the
|
|
|
|
# classlist file. It never will work if CDS is disabled, since the VM will report
|
|
|
|
# an error for DumpLoadedClassList.
|
|
|
|
UTIL_ARG_ENABLE(NAME: generate-classlist, DEFAULT: auto,
|
|
|
|
RESULT: ENABLE_GENERATE_CLASSLIST, AVAILABLE: $ENABLE_CDS,
|
|
|
|
DESC: [enable generation of a CDS classlist at build time],
|
|
|
|
DEFAULT_DESC: [enabled if the JVM feature 'cds' is enabled for all JVM variants],
|
|
|
|
CHECKING_MSG: [if the CDS classlist generation should be enabled])
|
2017-02-02 11:05:51 +00:00
|
|
|
AC_SUBST(ENABLE_GENERATE_CLASSLIST)
|
2016-05-25 10:53:26 +00:00
|
|
|
])
|
2018-06-15 16:53:28 +00:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# Optionally filter resource translations
|
|
|
|
#
|
|
|
|
AC_DEFUN([JDKOPT_EXCLUDE_TRANSLATIONS],
|
|
|
|
[
|
|
|
|
AC_ARG_WITH([exclude-translations], [AS_HELP_STRING([--with-exclude-translations],
|
|
|
|
[a comma separated list of locales to exclude translations for. Default is
|
|
|
|
to include all translations present in the source.])])
|
|
|
|
|
|
|
|
EXCLUDE_TRANSLATIONS=""
|
|
|
|
AC_MSG_CHECKING([if any translations should be excluded])
|
|
|
|
if test "x$with_exclude_translations" != "x"; then
|
|
|
|
EXCLUDE_TRANSLATIONS="${with_exclude_translations//,/ }"
|
|
|
|
AC_MSG_RESULT([yes: $EXCLUDE_TRANSLATIONS])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_SUBST(EXCLUDE_TRANSLATIONS)
|
|
|
|
])
|
2018-07-20 16:07:37 +00:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# Optionally disable man pages
|
|
|
|
#
|
|
|
|
AC_DEFUN([JDKOPT_ENABLE_DISABLE_MANPAGES],
|
|
|
|
[
|
2020-03-11 07:34:14 +00:00
|
|
|
UTIL_ARG_ENABLE(NAME: manpages, DEFAULT: true, RESULT: BUILD_MANPAGES,
|
|
|
|
DESC: [enable copying of static man pages],
|
|
|
|
CHECKING_MSG: [if static man pages should be copied])
|
2018-07-20 16:07:37 +00:00
|
|
|
AC_SUBST(BUILD_MANPAGES)
|
|
|
|
])
|
2018-10-05 22:56:11 +00:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# Disable the default CDS archive generation
|
|
|
|
#
|
|
|
|
AC_DEFUN([JDKOPT_ENABLE_DISABLE_CDS_ARCHIVE],
|
|
|
|
[
|
2020-03-11 07:34:14 +00:00
|
|
|
UTIL_ARG_ENABLE(NAME: cds-archive, DEFAULT: auto, RESULT: BUILD_CDS_ARCHIVE,
|
|
|
|
DESC: [enable generation of a default CDS archive in the product image],
|
|
|
|
DEFAULT_DESC: [enabled if possible],
|
|
|
|
CHECKING_MSG: [if a default CDS archive should be generated],
|
|
|
|
CHECK_AVAILABLE: [
|
|
|
|
AC_MSG_CHECKING([if CDS archive is available])
|
|
|
|
if test "x$ENABLE_CDS" = "xfalse"; then
|
|
|
|
AC_MSG_RESULT([no (CDS is disabled)])
|
|
|
|
AVAILABLE=false
|
|
|
|
elif test "x$COMPILE_TYPE" = "xcross"; then
|
|
|
|
AC_MSG_RESULT([no (not possible with cross compilation)])
|
|
|
|
AVAILABLE=false
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
fi
|
|
|
|
])
|
2018-10-05 22:56:11 +00:00
|
|
|
AC_SUBST(BUILD_CDS_ARCHIVE)
|
|
|
|
])
|
2019-12-13 16:27:51 +00:00
|
|
|
|
2021-03-11 16:49:24 +00:00
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# Enable the alternative CDS core region alignment
|
|
|
|
#
|
|
|
|
AC_DEFUN([JDKOPT_ENABLE_DISABLE_COMPATIBLE_CDS_ALIGNMENT],
|
|
|
|
[
|
|
|
|
UTIL_ARG_ENABLE(NAME: compatible-cds-alignment, DEFAULT: false,
|
|
|
|
RESULT: ENABLE_COMPATIBLE_CDS_ALIGNMENT,
|
|
|
|
DESC: [enable use alternative compatible cds core region alignment],
|
|
|
|
DEFAULT_DESC: [disabled],
|
|
|
|
CHECKING_MSG: [if compatible cds region alignment enabled],
|
|
|
|
CHECK_AVAILABLE: [
|
|
|
|
AC_MSG_CHECKING([if CDS archive is available])
|
2021-03-11 18:54:45 +00:00
|
|
|
if test "x$ENABLE_CDS" = "xfalse"; then
|
2021-03-11 16:49:24 +00:00
|
|
|
AVAILABLE=false
|
|
|
|
AC_MSG_RESULT([no (CDS is disabled)])
|
|
|
|
else
|
|
|
|
AVAILABLE=true
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
fi
|
|
|
|
])
|
|
|
|
AC_SUBST(ENABLE_COMPATIBLE_CDS_ALIGNMENT)
|
|
|
|
])
|
|
|
|
|
2019-12-13 16:27:51 +00:00
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# Disallow any output from containing absolute paths from the build system.
|
|
|
|
# This setting defaults to allowed on debug builds and not allowed on release
|
|
|
|
# builds.
|
|
|
|
#
|
|
|
|
AC_DEFUN([JDKOPT_ALLOW_ABSOLUTE_PATHS_IN_OUTPUT],
|
|
|
|
[
|
|
|
|
AC_ARG_ENABLE([absolute-paths-in-output],
|
|
|
|
[AS_HELP_STRING([--disable-absolute-paths-in-output],
|
|
|
|
[Set to disable to prevent any absolute paths from the build to end up in
|
|
|
|
any of the build output. @<:@disabled in release builds, otherwise enabled@:>@])
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([if absolute paths should be allowed in the build output])
|
|
|
|
if test "x$enable_absolute_paths_in_output" = "xno"; then
|
|
|
|
AC_MSG_RESULT([no, forced])
|
|
|
|
ALLOW_ABSOLUTE_PATHS_IN_OUTPUT="false"
|
|
|
|
elif test "x$enable_absolute_paths_in_output" = "xyes"; then
|
|
|
|
AC_MSG_RESULT([yes, forced])
|
|
|
|
ALLOW_ABSOLUTE_PATHS_IN_OUTPUT="true"
|
|
|
|
elif test "x$DEBUG_LEVEL" = "xrelease"; then
|
|
|
|
AC_MSG_RESULT([no, release build])
|
|
|
|
ALLOW_ABSOLUTE_PATHS_IN_OUTPUT="false"
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([yes, debug build])
|
|
|
|
ALLOW_ABSOLUTE_PATHS_IN_OUTPUT="true"
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_SUBST(ALLOW_ABSOLUTE_PATHS_IN_OUTPUT)
|
|
|
|
])
|
2020-05-07 15:47:11 +00:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# Check and set options related to reproducible builds.
|
|
|
|
#
|
|
|
|
AC_DEFUN_ONCE([JDKOPT_SETUP_REPRODUCIBLE_BUILD],
|
|
|
|
[
|
|
|
|
AC_ARG_WITH([source-date], [AS_HELP_STRING([--with-source-date],
|
|
|
|
[how to set SOURCE_DATE_EPOCH ('updated', 'current', 'version' a timestamp or an ISO-8601 date) @<:@updated@:>@])],
|
|
|
|
[with_source_date_present=true], [with_source_date_present=false])
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([what source date to use])
|
|
|
|
|
|
|
|
if test "x$with_source_date" = xyes; then
|
|
|
|
AC_MSG_ERROR([--with-source-date must have a value])
|
|
|
|
elif test "x$with_source_date" = xupdated || test "x$with_source_date" = x; then
|
|
|
|
# Tell the makefiles to update at each build
|
|
|
|
SOURCE_DATE=updated
|
|
|
|
AC_MSG_RESULT([determined at build time, from 'updated'])
|
|
|
|
elif test "x$with_source_date" = xcurrent; then
|
|
|
|
# Set the current time
|
|
|
|
SOURCE_DATE=$($DATE +"%s")
|
|
|
|
AC_MSG_RESULT([$SOURCE_DATE, from 'current'])
|
|
|
|
elif test "x$with_source_date" = xversion; then
|
2021-01-11 18:22:58 +00:00
|
|
|
# Use the date from version-numbers.conf
|
2020-05-07 15:47:11 +00:00
|
|
|
UTIL_GET_EPOCH_TIMESTAMP(SOURCE_DATE, $DEFAULT_VERSION_DATE)
|
|
|
|
if test "x$SOURCE_DATE" = x; then
|
|
|
|
AC_MSG_RESULT([unavailable])
|
|
|
|
AC_MSG_ERROR([Cannot convert DEFAULT_VERSION_DATE to timestamp])
|
|
|
|
fi
|
|
|
|
AC_MSG_RESULT([$SOURCE_DATE, from 'version'])
|
|
|
|
else
|
|
|
|
# It's a timestamp, an ISO-8601 date, or an invalid string
|
|
|
|
# Additional [] needed to keep m4 from mangling shell constructs.
|
|
|
|
if [ [[ "$with_source_date" =~ ^[0-9][0-9]*$ ]] ] ; then
|
|
|
|
SOURCE_DATE=$with_source_date
|
|
|
|
AC_MSG_RESULT([$SOURCE_DATE, from timestamp on command line])
|
|
|
|
else
|
|
|
|
UTIL_GET_EPOCH_TIMESTAMP(SOURCE_DATE, $with_source_date)
|
|
|
|
if test "x$SOURCE_DATE" != x; then
|
|
|
|
AC_MSG_RESULT([$SOURCE_DATE, from ISO-8601 date on command line])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([unavailable])
|
|
|
|
AC_MSG_ERROR([Cannot parse date string "$with_source_date"])
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2020-12-07 15:55:53 +00:00
|
|
|
REPRODUCIBLE_BUILD_DEFAULT=$with_source_date_present
|
|
|
|
|
|
|
|
if test "x$OPENJDK_BUILD_OS" = xwindows && \
|
|
|
|
test "x$ALLOW_ABSOLUTE_PATHS_IN_OUTPUT" = xfalse; then
|
|
|
|
# To support banning absolute paths on Windows, we must use the -pathmap
|
|
|
|
# method, which requires reproducible builds.
|
|
|
|
REPRODUCIBLE_BUILD_DEFAULT=true
|
|
|
|
fi
|
|
|
|
|
|
|
|
UTIL_ARG_ENABLE(NAME: reproducible-build, DEFAULT: $REPRODUCIBLE_BUILD_DEFAULT,
|
2020-05-07 15:47:11 +00:00
|
|
|
RESULT: ENABLE_REPRODUCIBLE_BUILD,
|
|
|
|
DESC: [enable reproducible builds (not yet fully functional)],
|
2020-12-07 15:55:53 +00:00
|
|
|
DEFAULT_DESC: [enabled if --with-source-date is given or on Windows without absolute paths])
|
|
|
|
|
|
|
|
if test "x$OPENJDK_BUILD_OS" = xwindows && \
|
|
|
|
test "x$ALLOW_ABSOLUTE_PATHS_IN_OUTPUT" = xfalse && \
|
|
|
|
test "x$ENABLE_REPRODUCIBLE_BUILD" = xfalse; then
|
2021-11-30 13:01:17 +00:00
|
|
|
AC_MSG_NOTICE([On Windows it is not possible to combine --disable-reproducible-build])
|
2020-12-07 15:55:53 +00:00
|
|
|
AC_MSG_NOTICE([with --disable-absolute-paths-in-output.])
|
|
|
|
AC_MSG_ERROR([Cannot continue])
|
|
|
|
fi
|
2020-05-07 15:47:11 +00:00
|
|
|
|
|
|
|
AC_SUBST(SOURCE_DATE)
|
|
|
|
AC_SUBST(ENABLE_REPRODUCIBLE_BUILD)
|
|
|
|
])
|
2021-10-12 23:28:53 +00:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# Helper function to build binutils from source.
|
|
|
|
#
|
|
|
|
AC_DEFUN([JDKOPT_BUILD_BINUTILS],
|
|
|
|
[
|
|
|
|
BINUTILS_SRC="$with_binutils_src"
|
|
|
|
UTIL_FIXUP_PATH(BINUTILS_SRC)
|
|
|
|
|
|
|
|
if ! test -d $BINUTILS_SRC; then
|
|
|
|
AC_MSG_ERROR([--with-binutils-src is not pointing to a directory])
|
|
|
|
fi
|
|
|
|
if ! test -x $BINUTILS_SRC/configure; then
|
|
|
|
AC_MSG_ERROR([--with-binutils-src does not look like a binutils source directory])
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test -e $BINUTILS_SRC/bfd/libbfd.a && \
|
|
|
|
test -e $BINUTILS_SRC/opcodes/libopcodes.a && \
|
|
|
|
test -e $BINUTILS_SRC/libiberty/libiberty.a && \
|
|
|
|
test -e $BINUTILS_SRC/zlib/libz.a; then
|
|
|
|
AC_MSG_NOTICE([Found binutils binaries in binutils source directory -- not building])
|
|
|
|
else
|
|
|
|
# On Windows, we cannot build with the normal Microsoft CL, but must instead use
|
|
|
|
# a separate mingw toolchain.
|
|
|
|
if test "x$OPENJDK_BUILD_OS" = xwindows; then
|
|
|
|
if test "x$OPENJDK_TARGET_CPU" = "xx86"; then
|
|
|
|
target_base="i686-w64-mingw32"
|
|
|
|
else
|
|
|
|
target_base="$OPENJDK_TARGET_CPU-w64-mingw32"
|
|
|
|
fi
|
|
|
|
binutils_cc="$target_base-gcc"
|
|
|
|
binutils_target="--host=$target_base --target=$target_base"
|
|
|
|
# Somehow the uint typedef is not included when building with mingw
|
|
|
|
binutils_cflags="-Duint=unsigned"
|
|
|
|
compiler_version=`$binutils_cc --version 2>&1`
|
|
|
|
if ! [ [[ "$compiler_version" =~ GCC ]] ]; then
|
|
|
|
AC_MSG_NOTICE([Could not find correct mingw compiler $binutils_cc.])
|
|
|
|
HELP_MSG_MISSING_DEPENDENCY([$binutils_cc])
|
|
|
|
AC_MSG_ERROR([Cannot continue. $HELP_MSG])
|
|
|
|
else
|
|
|
|
AC_MSG_NOTICE([Using compiler $binutils_cc with version $compiler_version])
|
|
|
|
fi
|
|
|
|
elif test "x$OPENJDK_BUILD_OS" = xmacosx; then
|
|
|
|
if test "x$OPENJDK_TARGET_CPU" = "xaarch64"; then
|
|
|
|
binutils_target="--enable-targets=aarch64-darwin"
|
|
|
|
else
|
|
|
|
binutils_target=""
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
binutils_cc="$CC $SYSROOT_CFLAGS"
|
|
|
|
binutils_target=""
|
|
|
|
fi
|
|
|
|
binutils_cflags="$binutils_cflags $MACHINE_FLAG $JVM_PICFLAG $C_O_FLAG_NORM"
|
|
|
|
|
|
|
|
AC_MSG_NOTICE([Running binutils configure])
|
|
|
|
AC_MSG_NOTICE([configure command line: ./configure --disable-nls CFLAGS="$binutils_cflags" CC="$binutils_cc" $binutils_target])
|
|
|
|
saved_dir=`pwd`
|
|
|
|
cd "$BINUTILS_SRC"
|
|
|
|
./configure --disable-nls CFLAGS="$binutils_cflags" CC="$binutils_cc" $binutils_target
|
|
|
|
if test $? -ne 0 || ! test -e $BINUTILS_SRC/Makefile; then
|
|
|
|
AC_MSG_NOTICE([Automatic building of binutils failed on configure. Try building it manually])
|
|
|
|
AC_MSG_ERROR([Cannot continue])
|
|
|
|
fi
|
|
|
|
AC_MSG_NOTICE([Running binutils make])
|
|
|
|
$MAKE all-opcodes
|
|
|
|
if test $? -ne 0; then
|
|
|
|
AC_MSG_NOTICE([Automatic building of binutils failed on make. Try building it manually])
|
|
|
|
AC_MSG_ERROR([Cannot continue])
|
|
|
|
fi
|
|
|
|
cd $saved_dir
|
|
|
|
AC_MSG_NOTICE([Building of binutils done])
|
|
|
|
fi
|
|
|
|
|
|
|
|
BINUTILS_DIR="$BINUTILS_SRC"
|
|
|
|
])
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# Determine if hsdis should be built, and if so, with which backend.
|
|
|
|
#
|
|
|
|
AC_DEFUN_ONCE([JDKOPT_SETUP_HSDIS],
|
|
|
|
[
|
|
|
|
AC_ARG_WITH([hsdis], [AS_HELP_STRING([--with-hsdis],
|
|
|
|
[what hsdis backend to use ('none', 'binutils') @<:@none@:>@])])
|
|
|
|
|
|
|
|
AC_ARG_WITH([binutils], [AS_HELP_STRING([--with-binutils],
|
|
|
|
[where to find the binutils files needed for hsdis/binutils])])
|
|
|
|
|
|
|
|
AC_ARG_WITH([binutils-src], [AS_HELP_STRING([--with-binutils-src],
|
|
|
|
[where to find the binutils source for building])])
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([what hsdis backend to use])
|
|
|
|
|
|
|
|
if test "x$with_hsdis" = xyes; then
|
|
|
|
AC_MSG_ERROR([--with-hsdis must have a value])
|
|
|
|
elif test "x$with_hsdis" = xnone || test "x$with_hsdis" = xno || test "x$with_hsdis" = x; then
|
|
|
|
HSDIS_BACKEND=none
|
|
|
|
AC_MSG_RESULT(['none', hsdis will not be built])
|
|
|
|
elif test "x$with_hsdis" = xbinutils; then
|
|
|
|
HSDIS_BACKEND=binutils
|
|
|
|
AC_MSG_RESULT(['binutils'])
|
|
|
|
|
|
|
|
# We need the binutils static libs and includes.
|
|
|
|
if test "x$with_binutils_src" != x; then
|
|
|
|
# Try building the source first. If it succeeds, it sets $BINUTILS_DIR.
|
|
|
|
JDKOPT_BUILD_BINUTILS
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "x$with_binutils" != x; then
|
|
|
|
BINUTILS_DIR="$with_binutils"
|
|
|
|
fi
|
|
|
|
|
2021-11-16 14:47:42 +00:00
|
|
|
binutils_system_error=""
|
|
|
|
HSDIS_LIBS=""
|
|
|
|
if test "x$BINUTILS_DIR" = xsystem; then
|
|
|
|
AC_CHECK_LIB(bfd, bfd_openr, [ HSDIS_LIBS="-lbfd" ], [ binutils_system_error="libbfd not found" ])
|
|
|
|
AC_CHECK_LIB(opcodes, disassembler, [ HSDIS_LIBS="$HSDIS_LIBS -lopcodes" ], [ binutils_system_error="libopcodes not found" ])
|
|
|
|
AC_CHECK_LIB(iberty, xmalloc, [ HSDIS_LIBS="$HSDIS_LIBS -liberty" ], [ binutils_system_error="libiberty not found" ])
|
|
|
|
AC_CHECK_LIB(z, deflate, [ HSDIS_LIBS="$HSDIS_LIBS -lz" ], [ binutils_system_error="libz not found" ])
|
|
|
|
elif test "x$BINUTILS_DIR" != x; then
|
2021-10-12 23:28:53 +00:00
|
|
|
if test -e $BINUTILS_DIR/bfd/libbfd.a && \
|
|
|
|
test -e $BINUTILS_DIR/opcodes/libopcodes.a && \
|
|
|
|
test -e $BINUTILS_DIR/libiberty/libiberty.a; then
|
|
|
|
HSDIS_CFLAGS="-I$BINUTILS_DIR/include -I$BINUTILS_DIR/bfd -DLIBARCH_$OPENJDK_TARGET_CPU_LEGACY_LIB"
|
|
|
|
HSDIS_LIBS="$BINUTILS_DIR/bfd/libbfd.a $BINUTILS_DIR/opcodes/libopcodes.a $BINUTILS_DIR/libiberty/libiberty.a $BINUTILS_DIR/zlib/libz.a"
|
|
|
|
fi
|
|
|
|
fi
|
2021-11-16 14:47:42 +00:00
|
|
|
|
|
|
|
AC_MSG_CHECKING([for binutils to use with hsdis])
|
|
|
|
case "x$BINUTILS_DIR" in
|
|
|
|
xsystem)
|
|
|
|
if test "x$OPENJDK_TARGET_OS" != xlinux; then
|
|
|
|
AC_MSG_RESULT([invalid])
|
|
|
|
AC_MSG_ERROR([binutils on system is supported for Linux only])
|
|
|
|
elif test "x$binutils_system_error" = x; then
|
|
|
|
AC_MSG_RESULT([system])
|
|
|
|
HSDIS_CFLAGS="-DSYSTEM_BINUTILS"
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([invalid])
|
|
|
|
AC_MSG_ERROR([$binutils_system_error])
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
x)
|
|
|
|
AC_MSG_RESULT([missing])
|
|
|
|
AC_MSG_NOTICE([--with-hsdis=binutils requires specifying a binutils installation.])
|
|
|
|
AC_MSG_NOTICE([Download binutils from https://www.gnu.org/software/binutils and unpack it,])
|
|
|
|
AC_MSG_NOTICE([and point --with-binutils-src to the resulting directory, or use])
|
|
|
|
AC_MSG_NOTICE([--with-binutils to point to a pre-built binutils installation.])
|
|
|
|
AC_MSG_ERROR([Cannot continue])
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
if test "x$HSDIS_LIBS" != x; then
|
|
|
|
AC_MSG_RESULT([$BINUTILS_DIR])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([invalid])
|
|
|
|
AC_MSG_ERROR([$BINUTILS_DIR does not contain a proper binutils installation])
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
2021-10-12 23:28:53 +00:00
|
|
|
else
|
|
|
|
AC_MSG_RESULT([invalid])
|
|
|
|
AC_MSG_ERROR([Incorrect hsdis backend "$with_hsdis"])
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_SUBST(HSDIS_BACKEND)
|
|
|
|
AC_SUBST(HSDIS_CFLAGS)
|
|
|
|
AC_SUBST(HSDIS_LIBS)
|
|
|
|
])
|