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
AC_DEFUN_ONCE([HELP_SETUP_DEPENDENCY_HELP],
28
UTIL_LOOKUP_PROGS(PKGHANDLER, zypper apt-get yum brew port pkgutil pkgadd pacman apk)
31
AC_DEFUN([HELP_MSG_MISSING_DEPENDENCY],
33
# Print a helpful message on how to acquire the necessary build dependency.
34
# $1 is the help tag: cups, alsa etc
37
if test "x$MISSING_DEPENDENCY" = "xopenjdk"; then
38
HELP_MSG="OpenJDK distributions are available at http://jdk.java.net/."
39
elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
40
cygwin_help $MISSING_DEPENDENCY
46
apt_help $MISSING_DEPENDENCY ;;
48
yum_help $MISSING_DEPENDENCY ;;
50
brew_help $MISSING_DEPENDENCY ;;
52
port_help $MISSING_DEPENDENCY ;;
54
pkgutil_help $MISSING_DEPENDENCY ;;
56
pkgadd_help $MISSING_DEPENDENCY ;;
58
zypper_help $MISSING_DEPENDENCY ;;
60
pacman_help $MISSING_DEPENDENCY ;;
62
apk_help $MISSING_DEPENDENCY ;;
65
if test "x$PKGHANDLER_COMMAND" != x; then
66
HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
74
PKGHANDLER_COMMAND="( cd <location of cygwin setup.exe> && cmd /c setup -q -P unzip )"
75
HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
78
PKGHANDLER_COMMAND="( cd <location of cygwin setup.exe> && cmd /c setup -q -P zip )"
79
HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
82
PKGHANDLER_COMMAND="( cd <location of cygwin setup.exe> && cmd /c setup -q -P make )"
83
HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
86
PKGHANDLER_COMMAND="( cd <location of cygwin setup.exe> && cmd /c setup -q -P gcc-core i686-w64-mingw32-gcc-core mingw64-i686-glib2.0 )"
87
HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
89
x86_64-w64-mingw32-gcc)
90
PKGHANDLER_COMMAND="( cd <location of cygwin setup.exe> && cmd /c setup -q -P gcc-core x86_64-w64-mingw32-gcc-core mingw64-x86_64-glib2.0 )"
91
HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
99
PKGHANDLER_COMMAND="sudo apt-get install gcc-multilib g++-multilib" ;;
101
PKGHANDLER_COMMAND="sudo apt-get install build-essential" ;;
103
PKGHANDLER_COMMAND="sudo apt-get install libasound2-dev" ;;
105
PKGHANDLER_COMMAND="sudo apt-get install libcups2-dev" ;;
107
PKGHANDLER_COMMAND="sudo apt-get install libfontconfig1-dev" ;;
109
PKGHANDLER_COMMAND="sudo apt-get install libfreetype6-dev" ;;
111
PKGHANDLER_COMMAND="sudo apt-get install libharfbuzz-dev" ;;
113
PKGHANDLER_COMMAND="sudo apt-get install libffi-dev" ;;
115
PKGHANDLER_COMMAND="sudo apt-get install libx11-dev libxext-dev libxrender-dev libxrandr-dev libxtst-dev libxt-dev" ;;
117
PKGHANDLER_COMMAND="sudo apt-get install ccache" ;;
119
PKGHANDLER_COMMAND="sudo apt-get install systemtap-sdt-dev" ;;
121
PKGHANDLER_COMMAND="sudo apt-get install libcapstone-dev" ;;
128
PKGHANDLER_COMMAND="sudo zypper install gcc gcc-c++" ;;
130
PKGHANDLER_COMMAND="sudo zypper install alsa-devel" ;;
132
PKGHANDLER_COMMAND="sudo zypper install cups-devel" ;;
134
PKGHANDLER_COMMAND="sudo zypper install fontconfig-devel" ;;
136
PKGHANDLER_COMMAND="sudo zypper install freetype-devel" ;;
138
PKGHANDLER_COMMAND="sudo zypper install harfbuzz-devel" ;;
140
PKGHANDLER_COMMAND="sudo zypper install libX11-devel libXext-devel libXrender-devel libXrandr-devel libXtst-devel libXt-devel libXi-devel" ;;
142
PKGHANDLER_COMMAND="sudo zypper install ccache" ;;
149
PKGHANDLER_COMMAND="sudo yum groupinstall \"Development Tools\"" ;;
151
PKGHANDLER_COMMAND="sudo yum install alsa-lib-devel" ;;
153
PKGHANDLER_COMMAND="sudo yum install cups-devel" ;;
155
PKGHANDLER_COMMAND="sudo yum install fontconfig-devel" ;;
157
PKGHANDLER_COMMAND="sudo yum install freetype-devel" ;;
159
PKGHANDLER_COMMAND="sudo yum install harfbuzz-devel" ;;
161
PKGHANDLER_COMMAND="sudo yum install libXtst-devel libXt-devel libXrender-devel libXrandr-devel libXi-devel" ;;
163
PKGHANDLER_COMMAND="sudo yum install ccache" ;;
170
PKGHANDLER_COMMAND="brew install freetype" ;;
172
PKGHANDLER_COMMAND="brew install ccache" ;;
174
PKGHANDLER_COMMAND="brew install capstone" ;;
181
PKGHANDLER_COMMAND="sudo pacman -S unzip" ;;
183
PKGHANDLER_COMMAND="sudo pacman -S zip" ;;
185
PKGHANDLER_COMMAND="sudo pacman -S make" ;;
190
PKGHANDLER_COMMAND=""
194
PKGHANDLER_COMMAND=""
198
PKGHANDLER_COMMAND=""
204
PKGHANDLER_COMMAND="sudo apk add alpine-sdk linux-headers" ;;
206
PKGHANDLER_COMMAND="sudo apk add alsa-lib-dev" ;;
208
PKGHANDLER_COMMAND="sudo apk add cups-dev" ;;
210
PKGHANDLER_COMMAND="sudo apk add fontconfig-dev" ;;
212
PKGHANDLER_COMMAND="sudo apk add freetype-dev" ;;
214
PKGHANDLER_COMMAND="sudo apk add harfbuzz-dev" ;;
216
PKGHANDLER_COMMAND="sudo apk add libxtst-dev libxt-dev libxrender-dev libxrandr-dev" ;;
218
PKGHANDLER_COMMAND="sudo apk add ccache" ;;
222
# This function will check if we're called from the "configure" wrapper while
223
# printing --help. If so, we will print out additional information that can
224
# only be extracted within the autoconf script, and then exit. This must be
225
# called at the very beginning in configure.ac.
226
AC_DEFUN_ONCE([HELP_PRINT_ADDITIONAL_HELP_AND_EXIT],
228
if test "x$CONFIGURE_PRINT_ADDITIONAL_HELP" != x; then
230
# Print available toolchains
231
$PRINTF "The following toolchains are valid as arguments to --with-toolchain-type.\n"
232
$PRINTF "Which are available to use depends on the build platform.\n"
233
for toolchain in $VALID_TOOLCHAINS_all; do
234
# Use indirect variable referencing
235
toolchain_var_name=TOOLCHAIN_DESCRIPTION_$toolchain
236
TOOLCHAIN_DESCRIPTION=${!toolchain_var_name}
237
$PRINTF " %-22s %s\n" $toolchain "$TOOLCHAIN_DESCRIPTION"
241
# Print available JVM features
242
$PRINTF "The following JVM features are valid as arguments to --with-jvm-features.\n"
243
$PRINTF "Which are available to use depends on the environment and JVM variant.\n"
244
m4_foreach(FEATURE, m4_split(jvm_features_valid), [
245
# Create an m4 variable containing the description for FEATURE.
246
m4_define(FEATURE_DESCRIPTION, [jvm_feature_desc_]m4_translit(FEATURE, -, _))
247
$PRINTF " %-22s %s\n" FEATURE "FEATURE_DESCRIPTION"
248
m4_undefine([FEATURE_DESCRIPTION])
251
# And now exit directly
256
AC_DEFUN_ONCE([HELP_PRINT_SUMMARY_AND_WARNINGS],
258
# Finally output some useful information to the user
261
printf "====================================================\n"
262
if test "x$no_create" != "xyes"; then
263
if test "x$IS_RECONFIGURE" != "xyes"; then
264
printf "A new configuration has been successfully created in\n%s\n" "$OUTPUTDIR"
266
printf "The existing configuration has been successfully updated in\n%s\n" "$OUTPUTDIR"
269
if test "x$IS_RECONFIGURE" != "xyes"; then
270
printf "A configuration has been successfully checked but not created\n"
272
printf "The existing configuration has been successfully checked in\n%s\n" "$OUTPUTDIR"
275
if test "x$CONFIGURE_COMMAND_LINE" != x; then
276
printf "using configure arguments '$CONFIGURE_COMMAND_LINE'.\n"
278
printf "using default settings.\n"
281
if test "x$REAL_CONFIGURE_COMMAND_EXEC_FULL" != x; then
283
printf "The original configure invocation was '$REAL_CONFIGURE_COMMAND_EXEC_SHORT $REAL_CONFIGURE_COMMAND_LINE'.\n"
287
printf "Configuration summary:\n"
288
printf "* Name: $CONF_NAME\n"
289
printf "* Debug level: $DEBUG_LEVEL\n"
290
printf "* HS debug level: $HOTSPOT_DEBUG_LEVEL\n"
291
printf "* JVM variants: $JVM_VARIANTS\n"
292
printf "* JVM features: "
294
for variant in $JVM_VARIANTS; do
295
features_var_name=JVM_FEATURES_$variant
296
JVM_FEATURES_FOR_VARIANT=${!features_var_name}
297
printf "$variant: \'$JVM_FEATURES_FOR_VARIANT\' "
301
printf "* OpenJDK target: OS: $OPENJDK_TARGET_OS, CPU architecture: $OPENJDK_TARGET_CPU_ARCH, address length: $OPENJDK_TARGET_CPU_BITS\n"
302
printf "* Version string: $VERSION_STRING ($VERSION_SHORT)\n"
304
if test "x$SOURCE_DATE" != xupdated; then
305
source_date_info="$SOURCE_DATE ($SOURCE_DATE_ISO_8601)"
307
source_date_info="Determined at build time"
309
printf "* Source date: $source_date_info\n"
312
printf "Tools summary:\n"
313
if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
314
printf "* Environment: %s version %s; windows version %s; prefix \"%s\"; root \"%s\"\n" \
315
"$WINENV_VENDOR" "$WINENV_VERSION" "$WINDOWS_VERSION" "$WINENV_PREFIX" "$WINENV_ROOT"
317
printf "* Boot JDK: $BOOT_JDK_VERSION (at $BOOT_JDK)\n"
318
printf "* Toolchain: $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION)\n"
319
if test "x$DEVKIT_NAME" != x; then
320
printf "* Devkit: $DEVKIT_NAME ($DEVKIT_ROOT)\n"
321
elif test "x$DEVKIT_ROOT" != x; then
322
printf "* Devkit: $DEVKIT_ROOT\n"
323
elif test "x$SYSROOT" != x; then
324
printf "* Sysroot: $SYSROOT\n"
326
printf "* C Compiler: Version $CC_VERSION_NUMBER (at ${CC#"$FIXPATH "})\n"
327
printf "* C++ Compiler: Version $CXX_VERSION_NUMBER (at ${CXX#"$FIXPATH "})\n"
330
printf "Build performance summary:\n"
331
printf "* Build jobs: $JOBS\n"
332
printf "* Memory limit: $MEMORY_SIZE MB\n"
333
if test "x$CCACHE_STATUS" != "x"; then
334
printf "* ccache status: $CCACHE_STATUS\n"
338
if test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = "xtrue"; then
339
printf "NOTE: You have requested to build more than one version of the JVM, which\n"
340
printf "will result in longer build times.\n"
344
if test "x$FOUND_ALT_VARIABLES" != "x"; then
345
printf "WARNING: You have old-style ALT_ environment variables set.\n"
346
printf "These are not respected, and will be ignored. It is recommended\n"
347
printf "that you clean your environment. The following variables are set:\n"
348
printf "$FOUND_ALT_VARIABLES\n"
352
if test "x$OUTPUT_DIR_IS_LOCAL" != "xyes"; then
353
printf "WARNING: Your build output directory is not on a local disk.\n"
354
printf "This will severely degrade build performance!\n"
355
printf "It is recommended that you create an output directory on a local disk,\n"
356
printf "and run the configure script again from that directory.\n"
360
if test "x$IS_RECONFIGURE" = "xyes" && test "x$no_create" != "xyes"; then
361
printf "WARNING: The result of this configuration has overridden an older\n"
362
printf "configuration. You *should* run 'make clean' to make sure you get a\n"
363
printf "proper build. Failure to do so might result in strange build problems.\n"
367
if test "x$IS_RECONFIGURE" != "xyes" && test "x$no_create" = "xyes"; then
368
printf "WARNING: The result of this configuration was not saved.\n"
369
printf "You should run without '--no-create | -n' to create the configuration.\n"
373
if test "x$UNSUPPORTED_TOOLCHAIN_VERSION" = "xyes"; then
374
printf "WARNING: The toolchain version used is known to have issues. Please\n"
375
printf "consider using a supported version unless you know what you are doing.\n"
380
AC_DEFUN_ONCE([HELP_REPEAT_WARNINGS],
383
if test -e "$CONFIGURESUPPORT_OUTPUTDIR/config.log"; then
384
CONFIG_LOG_PATH="$CONFIGURESUPPORT_OUTPUTDIR"
385
elif test -e "./config.log"; then
389
if test -e "$CONFIG_LOG_PATH/config.log"; then
390
$GREP '^configure:.*: WARNING:' "$CONFIG_LOG_PATH/config.log" > /dev/null 2>&1
391
if test $? -eq 0; then
392
printf "The following warnings were produced. Repeated here for convenience:\n"
393
# We must quote sed expression (using []) to stop m4 from eating the [].
394
$GREP '^configure:.*: WARNING:' "$CONFIG_LOG_PATH/config.log" | $SED -e [ 's/^configure:[0-9]*: //' ]