author | ihse |
Mon, 04 Nov 2019 11:15:45 +0100 | |
changeset 58909 | 66f7d2494d4e |
parent 53110 | 50677f43ac3d |
permissions | -rw-r--r-- |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1 |
# |
52804
28094715ae71
8214718: Update missing copyright year in build system
ihse
parents:
51822
diff
changeset
|
2 |
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
4 |
# |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
5 |
# This code is free software; you can redistribute it and/or modify it |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
6 |
# under the terms of the GNU General Public License version 2 only, as |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
7 |
# published by the Free Software Foundation. Oracle designates this |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
8 |
# particular file as subject to the "Classpath" exception as provided |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
9 |
# by Oracle in the LICENSE file that accompanied this code. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
10 |
# |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
15 |
# accompanied this code). |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
16 |
# |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
17 |
# You should have received a copy of the GNU General Public License version |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation, |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
20 |
# |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
21 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
22 |
# or visit www.oracle.com if you need additional information or have any |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
23 |
# questions. |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
24 |
# |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
25 |
|
22477 | 26 |
######################################################################## |
27595
cff167b3bfa2
8065914: Various improvements and cleanup of build system
ihse
parents:
26131
diff
changeset
|
27 |
# This file handles detection of the Boot JDK. The Boot JDK detection |
cff167b3bfa2
8065914: Various improvements and cleanup of build system
ihse
parents:
26131
diff
changeset
|
28 |
# process has been developed as a response to solve a complex real-world |
cff167b3bfa2
8065914: Various improvements and cleanup of build system
ihse
parents:
26131
diff
changeset
|
29 |
# problem. Initially, it was simple, but it has grown as platform after |
22477 | 30 |
# platform, idiosyncracy after idiosyncracy has been supported. |
31 |
# |
|
32 |
# The basic idea is this: |
|
33 |
# 1) You need an acceptable *) JDK to use as a Boot JDK |
|
27595
cff167b3bfa2
8065914: Various improvements and cleanup of build system
ihse
parents:
26131
diff
changeset
|
34 |
# 2) There are several ways to locate a JDK, that are mostly platform |
22477 | 35 |
# dependent **) |
36 |
# 3) You can have multiple JDKs installed |
|
27595
cff167b3bfa2
8065914: Various improvements and cleanup of build system
ihse
parents:
26131
diff
changeset
|
37 |
# 4) If possible, configure should try to dig out an acceptable JDK |
22477 | 38 |
# automatically, without having to resort to command-line options |
39 |
# |
|
27595
cff167b3bfa2
8065914: Various improvements and cleanup of build system
ihse
parents:
26131
diff
changeset
|
40 |
# *) acceptable means e.g. JDK7 for building JDK8, a complete JDK (with |
cff167b3bfa2
8065914: Various improvements and cleanup of build system
ihse
parents:
26131
diff
changeset
|
41 |
# javac) and not a JRE, etc. |
22477 | 42 |
# |
27595
cff167b3bfa2
8065914: Various improvements and cleanup of build system
ihse
parents:
26131
diff
changeset
|
43 |
# **) On Windows we typically use a well-known path. |
22477 | 44 |
# On MacOSX we typically use the tool java_home. |
27595
cff167b3bfa2
8065914: Various improvements and cleanup of build system
ihse
parents:
26131
diff
changeset
|
45 |
# On Linux we typically find javac in the $PATH, and then follow a |
cff167b3bfa2
8065914: Various improvements and cleanup of build system
ihse
parents:
26131
diff
changeset
|
46 |
# chain of symlinks that often ends up in a real JDK. |
22477 | 47 |
# |
27595
cff167b3bfa2
8065914: Various improvements and cleanup of build system
ihse
parents:
26131
diff
changeset
|
48 |
# This leads to the code where we check in different ways to locate a |
cff167b3bfa2
8065914: Various improvements and cleanup of build system
ihse
parents:
26131
diff
changeset
|
49 |
# JDK, and if one is found, check if it is acceptable. If not, we print |
cff167b3bfa2
8065914: Various improvements and cleanup of build system
ihse
parents:
26131
diff
changeset
|
50 |
# our reasons for rejecting it (useful when debugging non-working |
cff167b3bfa2
8065914: Various improvements and cleanup of build system
ihse
parents:
26131
diff
changeset
|
51 |
# configure situations) and continue checking the next one. |
22477 | 52 |
######################################################################## |
53 |
||
13697 | 54 |
# Execute the check given as argument, and verify the result |
55 |
# If the Boot JDK was previously found, do nothing |
|
56 |
# $1 A command line (typically autoconf macro) to execute |
|
57 |
AC_DEFUN([BOOTJDK_DO_CHECK], |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
58 |
[ |
13697 | 59 |
if test "x$BOOT_JDK_FOUND" = xno; then |
60 |
# Now execute the test |
|
61 |
$1 |
|
62 |
||
63 |
# If previous step claimed to have found a JDK, check it to see if it seems to be valid. |
|
64 |
if test "x$BOOT_JDK_FOUND" = xmaybe; then |
|
65 |
# Do we have a bin/java? |
|
53110 | 66 |
if test ! -x "$BOOT_JDK/bin/java$EXE_SUFFIX"; then |
13697 | 67 |
AC_MSG_NOTICE([Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring]) |
68 |
BOOT_JDK_FOUND=no |
|
69 |
else |
|
70 |
# Do we have a bin/javac? |
|
53110 | 71 |
if test ! -x "$BOOT_JDK/bin/javac$EXE_SUFFIX"; then |
13697 | 72 |
AC_MSG_NOTICE([Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring]) |
73 |
AC_MSG_NOTICE([(This might be an JRE instead of an JDK)]) |
|
74 |
BOOT_JDK_FOUND=no |
|
20363 | 75 |
else |
27865
6c830e3b9caf
8066828: configure fails if it's set --with-boot-jdk to use JDK 9 modular image
erikj
parents:
27602
diff
changeset
|
76 |
# Oh, this is looking good! We probably have found a proper JDK. Is it the correct version? |
53110 | 77 |
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java$EXE_SUFFIX" $USER_BOOT_JDK_OPTIONS -version 2>&1 | $HEAD -n 1` |
51822
f3c1945fa8aa
8210960: Allow --with-boot-jdk-jvmargs to work during configure
ihse
parents:
49706
diff
changeset
|
78 |
if [ [[ "$BOOT_JDK_VERSION" =~ "Picked up" ]] ]; then |
f3c1945fa8aa
8210960: Allow --with-boot-jdk-jvmargs to work during configure
ihse
parents:
49706
diff
changeset
|
79 |
AC_MSG_NOTICE([You have _JAVA_OPTIONS or JAVA_TOOL_OPTIONS set. This can mess up the build. Please use --with-boot-jdk-jvmargs instead.]) |
f3c1945fa8aa
8210960: Allow --with-boot-jdk-jvmargs to work during configure
ihse
parents:
49706
diff
changeset
|
80 |
AC_MSG_NOTICE([Java reports: "$BOOT_JDK_VERSION".]) |
f3c1945fa8aa
8210960: Allow --with-boot-jdk-jvmargs to work during configure
ihse
parents:
49706
diff
changeset
|
81 |
AC_MSG_ERROR([Cannot continue]) |
f3c1945fa8aa
8210960: Allow --with-boot-jdk-jvmargs to work during configure
ihse
parents:
49706
diff
changeset
|
82 |
fi |
f3c1945fa8aa
8210960: Allow --with-boot-jdk-jvmargs to work during configure
ihse
parents:
49706
diff
changeset
|
83 |
if [ [[ "$BOOT_JDK_VERSION" =~ "Unrecognized option" ]] ]; then |
f3c1945fa8aa
8210960: Allow --with-boot-jdk-jvmargs to work during configure
ihse
parents:
49706
diff
changeset
|
84 |
AC_MSG_NOTICE([The specified --with-boot-jdk-jvmargs is invalid for the tested java]) |
f3c1945fa8aa
8210960: Allow --with-boot-jdk-jvmargs to work during configure
ihse
parents:
49706
diff
changeset
|
85 |
AC_MSG_NOTICE([Error message: "$BOOT_JDK_VERSION".]) |
f3c1945fa8aa
8210960: Allow --with-boot-jdk-jvmargs to work during configure
ihse
parents:
49706
diff
changeset
|
86 |
AC_MSG_NOTICE([Please fix arguments, or point to an explicit boot JDK which accept these arguments]) |
f3c1945fa8aa
8210960: Allow --with-boot-jdk-jvmargs to work during configure
ihse
parents:
49706
diff
changeset
|
87 |
AC_MSG_ERROR([Cannot continue]) |
f3c1945fa8aa
8210960: Allow --with-boot-jdk-jvmargs to work during configure
ihse
parents:
49706
diff
changeset
|
88 |
fi |
27865
6c830e3b9caf
8066828: configure fails if it's set --with-boot-jdk to use JDK 9 modular image
erikj
parents:
27602
diff
changeset
|
89 |
|
6c830e3b9caf
8066828: configure fails if it's set --with-boot-jdk to use JDK 9 modular image
erikj
parents:
27602
diff
changeset
|
90 |
# Extra M4 quote needed to protect [] in grep expression. |
49159
436f1e03fd04
8199266: Update boot and build jdk requirements in configure
erikj
parents:
48845
diff
changeset
|
91 |
[FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION \ |
436f1e03fd04
8199266: Update boot and build jdk requirements in configure
erikj
parents:
48845
diff
changeset
|
92 |
| $EGREP "\"(${DEFAULT_ACCEPTABLE_BOOT_VERSIONS// /|})([\.+-].*)?\""`] |
27865
6c830e3b9caf
8066828: configure fails if it's set --with-boot-jdk to use JDK 9 modular image
erikj
parents:
27602
diff
changeset
|
93 |
if test "x$FOUND_CORRECT_VERSION" = x; then |
6c830e3b9caf
8066828: configure fails if it's set --with-boot-jdk to use JDK 9 modular image
erikj
parents:
27602
diff
changeset
|
94 |
AC_MSG_NOTICE([Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring]) |
49159
436f1e03fd04
8199266: Update boot and build jdk requirements in configure
erikj
parents:
48845
diff
changeset
|
95 |
AC_MSG_NOTICE([(Your Boot JDK version must be one of: $DEFAULT_ACCEPTABLE_BOOT_VERSIONS)]) |
13697 | 96 |
BOOT_JDK_FOUND=no |
97 |
else |
|
27865
6c830e3b9caf
8066828: configure fails if it's set --with-boot-jdk to use JDK 9 modular image
erikj
parents:
27602
diff
changeset
|
98 |
# We're done! :-) |
6c830e3b9caf
8066828: configure fails if it's set --with-boot-jdk to use JDK 9 modular image
erikj
parents:
27602
diff
changeset
|
99 |
BOOT_JDK_FOUND=yes |
6c830e3b9caf
8066828: configure fails if it's set --with-boot-jdk to use JDK 9 modular image
erikj
parents:
27602
diff
changeset
|
100 |
BASIC_FIXUP_PATH(BOOT_JDK) |
6c830e3b9caf
8066828: configure fails if it's set --with-boot-jdk to use JDK 9 modular image
erikj
parents:
27602
diff
changeset
|
101 |
AC_MSG_CHECKING([for Boot JDK]) |
6c830e3b9caf
8066828: configure fails if it's set --with-boot-jdk to use JDK 9 modular image
erikj
parents:
27602
diff
changeset
|
102 |
AC_MSG_RESULT([$BOOT_JDK]) |
6c830e3b9caf
8066828: configure fails if it's set --with-boot-jdk to use JDK 9 modular image
erikj
parents:
27602
diff
changeset
|
103 |
AC_MSG_CHECKING([Boot JDK version]) |
53110 | 104 |
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java$EXE_SUFFIX" $USER_BOOT_JDK_OPTIONS -version 2>&1 | $TR '\n\r' ' '` |
27865
6c830e3b9caf
8066828: configure fails if it's set --with-boot-jdk to use JDK 9 modular image
erikj
parents:
27602
diff
changeset
|
105 |
AC_MSG_RESULT([$BOOT_JDK_VERSION]) |
6c830e3b9caf
8066828: configure fails if it's set --with-boot-jdk to use JDK 9 modular image
erikj
parents:
27602
diff
changeset
|
106 |
fi # end check jdk version |
13697 | 107 |
fi # end check javac |
108 |
fi # end check java |
|
109 |
fi # end check boot jdk found |
|
110 |
fi |
|
111 |
]) |
|
112 |
||
42300
218374d35efd
8039103: "explicitly" is misspelled as "explicitely" in configure scripts
ihse
parents:
41458
diff
changeset
|
113 |
# Test: Is bootjdk explicitly set by command line arguments? |
13697 | 114 |
AC_DEFUN([BOOTJDK_CHECK_ARGUMENTS], |
115 |
[ |
|
20363 | 116 |
if test "x$with_boot_jdk" != x; then |
48845
b3a833c9c6e9
8193189: Allow --boot-jdk to accept a .tar.gz compressed JDK image
ehelin
parents:
48406
diff
changeset
|
117 |
if test -d "$with_boot_jdk"; then |
b3a833c9c6e9
8193189: Allow --boot-jdk to accept a .tar.gz compressed JDK image
ehelin
parents:
48406
diff
changeset
|
118 |
BOOT_JDK=$with_boot_jdk |
b3a833c9c6e9
8193189: Allow --boot-jdk to accept a .tar.gz compressed JDK image
ehelin
parents:
48406
diff
changeset
|
119 |
BOOT_JDK_FOUND=maybe |
b3a833c9c6e9
8193189: Allow --boot-jdk to accept a .tar.gz compressed JDK image
ehelin
parents:
48406
diff
changeset
|
120 |
elif test -f "$with_boot_jdk"; then |
b3a833c9c6e9
8193189: Allow --boot-jdk to accept a .tar.gz compressed JDK image
ehelin
parents:
48406
diff
changeset
|
121 |
case "$with_boot_jdk" in |
b3a833c9c6e9
8193189: Allow --boot-jdk to accept a .tar.gz compressed JDK image
ehelin
parents:
48406
diff
changeset
|
122 |
*.tar.gz ) |
b3a833c9c6e9
8193189: Allow --boot-jdk to accept a .tar.gz compressed JDK image
ehelin
parents:
48406
diff
changeset
|
123 |
BOOT_JDK_SUPPORT_DIR=$CONFIGURESUPPORT_OUTPUTDIR/boot-jdk |
b3a833c9c6e9
8193189: Allow --boot-jdk to accept a .tar.gz compressed JDK image
ehelin
parents:
48406
diff
changeset
|
124 |
$RM -rf $BOOT_JDK_SUPPORT_DIR |
b3a833c9c6e9
8193189: Allow --boot-jdk to accept a .tar.gz compressed JDK image
ehelin
parents:
48406
diff
changeset
|
125 |
$MKDIR -p $BOOT_JDK_SUPPORT_DIR |
b3a833c9c6e9
8193189: Allow --boot-jdk to accept a .tar.gz compressed JDK image
ehelin
parents:
48406
diff
changeset
|
126 |
$GUNZIP -c $with_boot_jdk | $TAR xf - -C $BOOT_JDK_SUPPORT_DIR |
b3a833c9c6e9
8193189: Allow --boot-jdk to accept a .tar.gz compressed JDK image
ehelin
parents:
48406
diff
changeset
|
127 |
|
b3a833c9c6e9
8193189: Allow --boot-jdk to accept a .tar.gz compressed JDK image
ehelin
parents:
48406
diff
changeset
|
128 |
# Try to find javac to determine BOOT_JDK path |
b3a833c9c6e9
8193189: Allow --boot-jdk to accept a .tar.gz compressed JDK image
ehelin
parents:
48406
diff
changeset
|
129 |
BOOT_JDK_JAVAC_PATH=`$FIND $BOOT_JDK_SUPPORT_DIR | $GREP "/bin/javac"` |
b3a833c9c6e9
8193189: Allow --boot-jdk to accept a .tar.gz compressed JDK image
ehelin
parents:
48406
diff
changeset
|
130 |
if test "x$BOOT_JDK_JAVAC_PATH" != x; then |
b3a833c9c6e9
8193189: Allow --boot-jdk to accept a .tar.gz compressed JDK image
ehelin
parents:
48406
diff
changeset
|
131 |
BOOT_JDK_FOUND=maybe |
b3a833c9c6e9
8193189: Allow --boot-jdk to accept a .tar.gz compressed JDK image
ehelin
parents:
48406
diff
changeset
|
132 |
BOOT_JDK=$($DIRNAME $($DIRNAME $BOOT_JDK_JAVAC_PATH)) |
b3a833c9c6e9
8193189: Allow --boot-jdk to accept a .tar.gz compressed JDK image
ehelin
parents:
48406
diff
changeset
|
133 |
else |
b3a833c9c6e9
8193189: Allow --boot-jdk to accept a .tar.gz compressed JDK image
ehelin
parents:
48406
diff
changeset
|
134 |
BOOT_JDK_FOUND=no |
b3a833c9c6e9
8193189: Allow --boot-jdk to accept a .tar.gz compressed JDK image
ehelin
parents:
48406
diff
changeset
|
135 |
fi |
b3a833c9c6e9
8193189: Allow --boot-jdk to accept a .tar.gz compressed JDK image
ehelin
parents:
48406
diff
changeset
|
136 |
;; |
b3a833c9c6e9
8193189: Allow --boot-jdk to accept a .tar.gz compressed JDK image
ehelin
parents:
48406
diff
changeset
|
137 |
* ) |
b3a833c9c6e9
8193189: Allow --boot-jdk to accept a .tar.gz compressed JDK image
ehelin
parents:
48406
diff
changeset
|
138 |
BOOT_JDK_FOUND=no |
b3a833c9c6e9
8193189: Allow --boot-jdk to accept a .tar.gz compressed JDK image
ehelin
parents:
48406
diff
changeset
|
139 |
;; |
b3a833c9c6e9
8193189: Allow --boot-jdk to accept a .tar.gz compressed JDK image
ehelin
parents:
48406
diff
changeset
|
140 |
esac |
b3a833c9c6e9
8193189: Allow --boot-jdk to accept a .tar.gz compressed JDK image
ehelin
parents:
48406
diff
changeset
|
141 |
else |
b3a833c9c6e9
8193189: Allow --boot-jdk to accept a .tar.gz compressed JDK image
ehelin
parents:
48406
diff
changeset
|
142 |
BOOT_JDK_FOUND=no |
b3a833c9c6e9
8193189: Allow --boot-jdk to accept a .tar.gz compressed JDK image
ehelin
parents:
48406
diff
changeset
|
143 |
fi |
13697 | 144 |
AC_MSG_NOTICE([Found potential Boot JDK using configure arguments]) |
20363 | 145 |
fi |
13697 | 146 |
]) |
147 |
||
148 |
# Test: Is $JAVA_HOME set? |
|
149 |
AC_DEFUN([BOOTJDK_CHECK_JAVA_HOME], |
|
150 |
[ |
|
20363 | 151 |
if test "x$JAVA_HOME" != x; then |
152 |
JAVA_HOME_PROCESSED="$JAVA_HOME" |
|
153 |
BASIC_FIXUP_PATH(JAVA_HOME_PROCESSED) |
|
154 |
if test ! -d "$JAVA_HOME_PROCESSED"; then |
|
155 |
AC_MSG_NOTICE([Your JAVA_HOME points to a non-existing directory!]) |
|
156 |
else |
|
157 |
# Aha, the user has set a JAVA_HOME |
|
158 |
# let us use that as the Boot JDK. |
|
159 |
BOOT_JDK="$JAVA_HOME_PROCESSED" |
|
160 |
BOOT_JDK_FOUND=maybe |
|
161 |
AC_MSG_NOTICE([Found potential Boot JDK using JAVA_HOME]) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
162 |
fi |
20363 | 163 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
164 |
]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
165 |
|
13697 | 166 |
# Test: Is there a java or javac in the PATH, which is a symlink to the JDK? |
167 |
AC_DEFUN([BOOTJDK_CHECK_JAVA_IN_PATH_IS_SYMLINK], |
|
168 |
[ |
|
20363 | 169 |
AC_PATH_PROG(JAVAC_CHECK, javac) |
170 |
AC_PATH_PROG(JAVA_CHECK, java) |
|
171 |
BINARY="$JAVAC_CHECK" |
|
172 |
if test "x$JAVAC_CHECK" = x; then |
|
173 |
BINARY="$JAVA_CHECK" |
|
174 |
fi |
|
175 |
if test "x$BINARY" != x; then |
|
176 |
# So there is a java(c) binary, it might be part of a JDK. |
|
177 |
# Lets find the JDK/JRE directory by following symbolic links. |
|
178 |
# Linux/GNU systems often have links from /usr/bin/java to |
|
179 |
# /etc/alternatives/java to the real JDK binary. |
|
180 |
BASIC_REMOVE_SYMBOLIC_LINKS(BINARY) |
|
181 |
BOOT_JDK=`dirname "$BINARY"` |
|
182 |
BOOT_JDK=`cd "$BOOT_JDK/.."; pwd` |
|
183 |
if test -x "$BOOT_JDK/bin/javac" && test -x "$BOOT_JDK/bin/java"; then |
|
184 |
# Looks like we found ourselves an JDK |
|
185 |
BOOT_JDK_FOUND=maybe |
|
186 |
AC_MSG_NOTICE([Found potential Boot JDK using java(c) in PATH]) |
|
13697 | 187 |
fi |
20363 | 188 |
fi |
13697 | 189 |
]) |
190 |
||
191 |
# Test: Is there a /usr/libexec/java_home? (Typically on MacOSX) |
|
22477 | 192 |
# $1: Argument to the java_home binary (optional) |
13697 | 193 |
AC_DEFUN([BOOTJDK_CHECK_LIBEXEC_JAVA_HOME], |
194 |
[ |
|
20363 | 195 |
if test -x /usr/libexec/java_home; then |
22477 | 196 |
BOOT_JDK=`/usr/libexec/java_home $1` |
20363 | 197 |
BOOT_JDK_FOUND=maybe |
22477 | 198 |
AC_MSG_NOTICE([Found potential Boot JDK using /usr/libexec/java_home $1]) |
199 |
fi |
|
200 |
]) |
|
201 |
||
202 |
# Test: On MacOS X, can we find a boot jdk using /usr/libexec/java_home? |
|
203 |
AC_DEFUN([BOOTJDK_CHECK_MACOSX_JAVA_LOCATOR], |
|
204 |
[ |
|
205 |
if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
|
206 |
# First check at user selected default |
|
207 |
BOOTJDK_DO_CHECK([BOOTJDK_CHECK_LIBEXEC_JAVA_HOME()]) |
|
208 |
# If that did not work out (e.g. too old), try explicit versions instead |
|
209 |
BOOTJDK_DO_CHECK([BOOTJDK_CHECK_LIBEXEC_JAVA_HOME([-v 1.9])]) |
|
210 |
BOOTJDK_DO_CHECK([BOOTJDK_CHECK_LIBEXEC_JAVA_HOME([-v 1.8])]) |
|
211 |
BOOTJDK_DO_CHECK([BOOTJDK_CHECK_LIBEXEC_JAVA_HOME([-v 1.7])]) |
|
20363 | 212 |
fi |
13697 | 213 |
]) |
214 |
||
215 |
# Look for a jdk in the given path. If there are multiple, try to select the newest. |
|
216 |
# If found, set BOOT_JDK and BOOT_JDK_FOUND. |
|
217 |
# $1 = Path to directory containing jdk installations. |
|
218 |
# $2 = String to append to the found JDK directory to get the proper JDK home |
|
219 |
AC_DEFUN([BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY], |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
220 |
[ |
13697 | 221 |
BOOT_JDK_PREFIX="$1" |
222 |
BOOT_JDK_SUFFIX="$2" |
|
14111 | 223 |
ALL_JDKS_FOUND=`$LS "$BOOT_JDK_PREFIX" 2> /dev/null | $SORT -r` |
224 |
if test "x$ALL_JDKS_FOUND" != x; then |
|
225 |
for JDK_TO_TRY in $ALL_JDKS_FOUND ; do |
|
226 |
BOOTJDK_DO_CHECK([ |
|
227 |
BOOT_JDK="${BOOT_JDK_PREFIX}/${JDK_TO_TRY}${BOOT_JDK_SUFFIX}" |
|
228 |
if test -d "$BOOT_JDK"; then |
|
229 |
BOOT_JDK_FOUND=maybe |
|
230 |
AC_MSG_NOTICE([Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)]) |
|
231 |
fi |
|
232 |
]) |
|
233 |
done |
|
13697 | 234 |
fi |
235 |
]) |
|
236 |
||
237 |
# Call BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY, but use the given |
|
238 |
# environmental variable as base for where to look. |
|
239 |
# $1 Name of an environmal variable, assumed to point to the Program Files directory. |
|
240 |
AC_DEFUN([BOOTJDK_FIND_BEST_JDK_IN_WINDOWS_VIRTUAL_DIRECTORY], |
|
241 |
[ |
|
242 |
if test "x[$]$1" != x; then |
|
14111 | 243 |
VIRTUAL_DIR="[$]$1/Java" |
244 |
BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(VIRTUAL_DIR) |
|
245 |
BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY($VIRTUAL_DIR) |
|
13697 | 246 |
fi |
247 |
]) |
|
248 |
||
249 |
# Test: Is there a JDK installed in default, well-known locations? |
|
250 |
AC_DEFUN([BOOTJDK_CHECK_WELL_KNOWN_LOCATIONS], |
|
251 |
[ |
|
252 |
if test "x$OPENJDK_TARGET_OS" = xwindows; then |
|
253 |
BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_WINDOWS_VIRTUAL_DIRECTORY([ProgramW6432])]) |
|
254 |
BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_WINDOWS_VIRTUAL_DIRECTORY([PROGRAMW6432])]) |
|
255 |
BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_WINDOWS_VIRTUAL_DIRECTORY([PROGRAMFILES])]) |
|
256 |
BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_WINDOWS_VIRTUAL_DIRECTORY([ProgramFiles])]) |
|
257 |
BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY([/cygdrive/c/Program Files/Java])]) |
|
258 |
elif test "x$OPENJDK_TARGET_OS" = xmacosx; then |
|
259 |
BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY([/Library/Java/JavaVirtualMachines],[/Contents/Home])]) |
|
260 |
BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY([/System/Library/Java/JavaVirtualMachines],[/Contents/Home])]) |
|
14111 | 261 |
elif test "x$OPENJDK_TARGET_OS" = xlinux; then |
262 |
BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY([/usr/lib/jvm])]) |
|
13697 | 263 |
fi |
264 |
]) |
|
265 |
||
266 |
# Check that a command-line tool in the Boot JDK is correct |
|
267 |
# $1 = name of variable to assign |
|
268 |
# $2 = name of binary |
|
269 |
AC_DEFUN([BOOTJDK_CHECK_TOOL_IN_BOOTJDK], |
|
270 |
[ |
|
22477 | 271 |
# Use user overridden value if available, otherwise locate tool in the Boot JDK. |
27595
cff167b3bfa2
8065914: Various improvements and cleanup of build system
ihse
parents:
26131
diff
changeset
|
272 |
BASIC_SETUP_TOOL($1, |
22477 | 273 |
[ |
274 |
AC_MSG_CHECKING([for $2 in Boot JDK]) |
|
275 |
$1=$BOOT_JDK/bin/$2 |
|
276 |
if test ! -x [$]$1; then |
|
277 |
AC_MSG_RESULT(not found) |
|
42300
218374d35efd
8039103: "explicitly" is misspelled as "explicitely" in configure scripts
ihse
parents:
41458
diff
changeset
|
278 |
AC_MSG_NOTICE([Your Boot JDK seems broken. This might be fixed by explicitly setting --with-boot-jdk]) |
22477 | 279 |
AC_MSG_ERROR([Could not find $2 in the Boot JDK]) |
280 |
fi |
|
281 |
AC_MSG_RESULT(ok) |
|
282 |
AC_SUBST($1) |
|
283 |
]) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
284 |
]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
285 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
286 |
############################################################################### |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
287 |
# |
20363 | 288 |
# We need a Boot JDK to bootstrap the build. |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
289 |
# |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
290 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
291 |
AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK], |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
292 |
[ |
20363 | 293 |
BOOT_JDK_FOUND=no |
294 |
AC_ARG_WITH(boot-jdk, [AS_HELP_STRING([--with-boot-jdk], |
|
295 |
[path to Boot JDK (used to bootstrap build) @<:@probed@:>@])]) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
296 |
|
51822
f3c1945fa8aa
8210960: Allow --with-boot-jdk-jvmargs to work during configure
ihse
parents:
49706
diff
changeset
|
297 |
AC_ARG_WITH(boot-jdk-jvmargs, [AS_HELP_STRING([--with-boot-jdk-jvmargs], |
f3c1945fa8aa
8210960: Allow --with-boot-jdk-jvmargs to work during configure
ihse
parents:
49706
diff
changeset
|
298 |
[specify additional arguments to be passed to Boot JDK tools @<:@none@:>@])]) |
f3c1945fa8aa
8210960: Allow --with-boot-jdk-jvmargs to work during configure
ihse
parents:
49706
diff
changeset
|
299 |
|
f3c1945fa8aa
8210960: Allow --with-boot-jdk-jvmargs to work during configure
ihse
parents:
49706
diff
changeset
|
300 |
USER_BOOT_JDK_OPTIONS="$with_boot_jdk_jvmargs" |
f3c1945fa8aa
8210960: Allow --with-boot-jdk-jvmargs to work during configure
ihse
parents:
49706
diff
changeset
|
301 |
|
20363 | 302 |
# We look for the Boot JDK through various means, going from more certain to |
303 |
# more of a guess-work. After each test, BOOT_JDK_FOUND is set to "yes" if |
|
304 |
# we detected something (if so, the path to the jdk is in BOOT_JDK). But we |
|
305 |
# must check if this is indeed valid; otherwise we'll continue looking. |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
306 |
|
42300
218374d35efd
8039103: "explicitly" is misspelled as "explicitely" in configure scripts
ihse
parents:
41458
diff
changeset
|
307 |
# Test: Is bootjdk explicitly set by command line arguments? |
20363 | 308 |
BOOTJDK_DO_CHECK([BOOTJDK_CHECK_ARGUMENTS]) |
309 |
if test "x$with_boot_jdk" != x && test "x$BOOT_JDK_FOUND" = xno; then |
|
310 |
# Having specified an argument which is incorrect will produce an instant failure; |
|
311 |
# we should not go on looking |
|
312 |
AC_MSG_ERROR([The path given by --with-boot-jdk does not contain a valid Boot JDK]) |
|
313 |
fi |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
314 |
|
22477 | 315 |
# Test: On MacOS X, can we find a boot jdk using /usr/libexec/java_home? |
316 |
BOOTJDK_DO_CHECK([BOOTJDK_CHECK_MACOSX_JAVA_LOCATOR]) |
|
317 |
||
20363 | 318 |
# Test: Is $JAVA_HOME set? |
319 |
BOOTJDK_DO_CHECK([BOOTJDK_CHECK_JAVA_HOME]) |
|
13697 | 320 |
|
20363 | 321 |
# Test: Is there a java or javac in the PATH, which is a symlink to the JDK? |
322 |
BOOTJDK_DO_CHECK([BOOTJDK_CHECK_JAVA_IN_PATH_IS_SYMLINK]) |
|
13697 | 323 |
|
20363 | 324 |
# Test: Is there a JDK installed in default, well-known locations? |
325 |
BOOTJDK_DO_CHECK([BOOTJDK_CHECK_WELL_KNOWN_LOCATIONS]) |
|
13697 | 326 |
|
20363 | 327 |
# If we haven't found anything yet, we've truly lost. Give up. |
328 |
if test "x$BOOT_JDK_FOUND" = xno; then |
|
329 |
HELP_MSG_MISSING_DEPENDENCY([openjdk]) |
|
330 |
AC_MSG_NOTICE([Could not find a valid Boot JDK. $HELP_MSG]) |
|
42300
218374d35efd
8039103: "explicitly" is misspelled as "explicitely" in configure scripts
ihse
parents:
41458
diff
changeset
|
331 |
AC_MSG_NOTICE([This might be fixed by explicitly setting --with-boot-jdk]) |
20363 | 332 |
AC_MSG_ERROR([Cannot continue]) |
333 |
fi |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
334 |
|
20363 | 335 |
AC_SUBST(BOOT_JDK) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
336 |
|
20363 | 337 |
# Setup tools from the Boot JDK. |
53110 | 338 |
BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVA, java$EXE_SUFFIX) |
339 |
BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVAC, javac$EXE_SUFFIX) |
|
340 |
BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVADOC, javadoc$EXE_SUFFIX) |
|
341 |
BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAR, jar$EXE_SUFFIX) |
|
342 |
BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JARSIGNER, jarsigner$EXE_SUFFIX) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
343 |
|
20363 | 344 |
# Finally, set some other options... |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
345 |
|
47364 | 346 |
# When compiling code to be executed by the Boot JDK, force compatibility with the |
347 |
# oldest supported bootjdk. |
|
348 |
BOOT_JDK_SOURCETARGET="-source 9 -target 9" |
|
20363 | 349 |
AC_SUBST(BOOT_JDK_SOURCETARGET) |
36506 | 350 |
|
20363 | 351 |
AC_SUBST(JAVAC_FLAGS) |
33032
19ae7cdc0cd0
8139813: Base heap size on type of boot jdk, not architecture of build machine
erikj
parents:
32921
diff
changeset
|
352 |
|
19ae7cdc0cd0
8139813: Base heap size on type of boot jdk, not architecture of build machine
erikj
parents:
32921
diff
changeset
|
353 |
# Check if the boot jdk is 32 or 64 bit |
45051
676afd13dea5
8180198: make bootcycle-images fail with uses of -d64 flags
erikj
parents:
43383
diff
changeset
|
354 |
if "$JAVA" -version 2>&1 | $GREP -q "64-Bit"; then |
33032
19ae7cdc0cd0
8139813: Base heap size on type of boot jdk, not architecture of build machine
erikj
parents:
32921
diff
changeset
|
355 |
BOOT_JDK_BITS="64" |
19ae7cdc0cd0
8139813: Base heap size on type of boot jdk, not architecture of build machine
erikj
parents:
32921
diff
changeset
|
356 |
else |
19ae7cdc0cd0
8139813: Base heap size on type of boot jdk, not architecture of build machine
erikj
parents:
32921
diff
changeset
|
357 |
BOOT_JDK_BITS="32" |
19ae7cdc0cd0
8139813: Base heap size on type of boot jdk, not architecture of build machine
erikj
parents:
32921
diff
changeset
|
358 |
fi |
19ae7cdc0cd0
8139813: Base heap size on type of boot jdk, not architecture of build machine
erikj
parents:
32921
diff
changeset
|
359 |
AC_MSG_CHECKING([if Boot JDK is 32 or 64 bits]) |
19ae7cdc0cd0
8139813: Base heap size on type of boot jdk, not architecture of build machine
erikj
parents:
32921
diff
changeset
|
360 |
AC_MSG_RESULT([$BOOT_JDK_BITS]) |
47324
51b0b8d8fe56
8188312: Use CDS if present when running the Boot JDK during build
ihse
parents:
47254
diff
changeset
|
361 |
|
51b0b8d8fe56
8188312: Use CDS if present when running the Boot JDK during build
ihse
parents:
47254
diff
changeset
|
362 |
# Try to enable CDS |
51b0b8d8fe56
8188312: Use CDS if present when running the Boot JDK during build
ihse
parents:
47254
diff
changeset
|
363 |
AC_MSG_CHECKING([for local Boot JDK Class Data Sharing (CDS)]) |
51b0b8d8fe56
8188312: Use CDS if present when running the Boot JDK during build
ihse
parents:
47254
diff
changeset
|
364 |
BOOT_JDK_CDS_ARCHIVE=$CONFIGURESUPPORT_OUTPUTDIR/classes.jsa |
51b0b8d8fe56
8188312: Use CDS if present when running the Boot JDK during build
ihse
parents:
47254
diff
changeset
|
365 |
ADD_JVM_ARG_IF_OK([-XX:+UnlockDiagnosticVMOptions -XX:-VerifySharedSpaces -XX:SharedArchiveFile=$BOOT_JDK_CDS_ARCHIVE],boot_jdk_cds_args,[$JAVA]) |
51b0b8d8fe56
8188312: Use CDS if present when running the Boot JDK during build
ihse
parents:
47254
diff
changeset
|
366 |
|
51b0b8d8fe56
8188312: Use CDS if present when running the Boot JDK during build
ihse
parents:
47254
diff
changeset
|
367 |
if test "x$boot_jdk_cds_args" != x; then |
51b0b8d8fe56
8188312: Use CDS if present when running the Boot JDK during build
ihse
parents:
47254
diff
changeset
|
368 |
# Try creating a CDS archive |
51b0b8d8fe56
8188312: Use CDS if present when running the Boot JDK during build
ihse
parents:
47254
diff
changeset
|
369 |
"$JAVA" $boot_jdk_cds_args -Xshare:dump > /dev/null 2>&1 |
51b0b8d8fe56
8188312: Use CDS if present when running the Boot JDK during build
ihse
parents:
47254
diff
changeset
|
370 |
if test $? -eq 0; then |
51b0b8d8fe56
8188312: Use CDS if present when running the Boot JDK during build
ihse
parents:
47254
diff
changeset
|
371 |
BOOTJDK_USE_LOCAL_CDS=true |
51b0b8d8fe56
8188312: Use CDS if present when running the Boot JDK during build
ihse
parents:
47254
diff
changeset
|
372 |
AC_MSG_RESULT([yes, created]) |
51b0b8d8fe56
8188312: Use CDS if present when running the Boot JDK during build
ihse
parents:
47254
diff
changeset
|
373 |
else |
51b0b8d8fe56
8188312: Use CDS if present when running the Boot JDK during build
ihse
parents:
47254
diff
changeset
|
374 |
# Generation failed, don't use CDS. |
51b0b8d8fe56
8188312: Use CDS if present when running the Boot JDK during build
ihse
parents:
47254
diff
changeset
|
375 |
BOOTJDK_USE_LOCAL_CDS=false |
51b0b8d8fe56
8188312: Use CDS if present when running the Boot JDK during build
ihse
parents:
47254
diff
changeset
|
376 |
AC_MSG_RESULT([no, creation failed]) |
51b0b8d8fe56
8188312: Use CDS if present when running the Boot JDK during build
ihse
parents:
47254
diff
changeset
|
377 |
fi |
51b0b8d8fe56
8188312: Use CDS if present when running the Boot JDK during build
ihse
parents:
47254
diff
changeset
|
378 |
else |
51b0b8d8fe56
8188312: Use CDS if present when running the Boot JDK during build
ihse
parents:
47254
diff
changeset
|
379 |
BOOTJDK_USE_LOCAL_CDS=false |
51b0b8d8fe56
8188312: Use CDS if present when running the Boot JDK during build
ihse
parents:
47254
diff
changeset
|
380 |
AC_MSG_RESULT([no, -XX:SharedArchiveFile not supported]) |
51b0b8d8fe56
8188312: Use CDS if present when running the Boot JDK during build
ihse
parents:
47254
diff
changeset
|
381 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
382 |
]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
383 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
384 |
AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS], |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
385 |
[ |
20363 | 386 |
############################################################################## |
387 |
# |
|
22728
0a9d96bf2023
8036079: --with-boot-jdk-jvmargs configure options are ignored
mduigou
parents:
22477
diff
changeset
|
388 |
# Specify jvm options for anything that is run with the Boot JDK. |
0a9d96bf2023
8036079: --with-boot-jdk-jvmargs configure options are ignored
mduigou
parents:
22477
diff
changeset
|
389 |
# Not all JVM:s accept the same arguments on the command line. |
20363 | 390 |
# |
22728
0a9d96bf2023
8036079: --with-boot-jdk-jvmargs configure options are ignored
mduigou
parents:
22477
diff
changeset
|
391 |
AC_MSG_CHECKING([flags for boot jdk java command] ) |
0a9d96bf2023
8036079: --with-boot-jdk-jvmargs configure options are ignored
mduigou
parents:
22477
diff
changeset
|
392 |
|
39684 | 393 |
# Force en-US environment |
394 |
ADD_JVM_ARG_IF_OK([-Duser.language=en -Duser.country=US],boot_jdk_jvmargs,[$JAVA]) |
|
395 |
||
47324
51b0b8d8fe56
8188312: Use CDS if present when running the Boot JDK during build
ihse
parents:
47254
diff
changeset
|
396 |
if test "x$BOOTJDK_USE_LOCAL_CDS" = xtrue; then |
51b0b8d8fe56
8188312: Use CDS if present when running the Boot JDK during build
ihse
parents:
47254
diff
changeset
|
397 |
# Use our own CDS archive |
51b0b8d8fe56
8188312: Use CDS if present when running the Boot JDK during build
ihse
parents:
47254
diff
changeset
|
398 |
ADD_JVM_ARG_IF_OK([$boot_jdk_cds_args -Xshare:auto],boot_jdk_jvmargs,[$JAVA]) |
51b0b8d8fe56
8188312: Use CDS if present when running the Boot JDK during build
ihse
parents:
47254
diff
changeset
|
399 |
else |
51b0b8d8fe56
8188312: Use CDS if present when running the Boot JDK during build
ihse
parents:
47254
diff
changeset
|
400 |
# Otherwise optimistically use the system-wide one, if one is present |
51b0b8d8fe56
8188312: Use CDS if present when running the Boot JDK during build
ihse
parents:
47254
diff
changeset
|
401 |
ADD_JVM_ARG_IF_OK([-Xshare:auto],boot_jdk_jvmargs,[$JAVA]) |
51b0b8d8fe56
8188312: Use CDS if present when running the Boot JDK during build
ihse
parents:
47254
diff
changeset
|
402 |
fi |
51b0b8d8fe56
8188312: Use CDS if present when running the Boot JDK during build
ihse
parents:
47254
diff
changeset
|
403 |
|
51822
f3c1945fa8aa
8210960: Allow --with-boot-jdk-jvmargs to work during configure
ihse
parents:
49706
diff
changeset
|
404 |
# Finally append user provided options to allow them to override. |
f3c1945fa8aa
8210960: Allow --with-boot-jdk-jvmargs to work during configure
ihse
parents:
49706
diff
changeset
|
405 |
ADD_JVM_ARG_IF_OK([$USER_BOOT_JDK_OPTIONS],boot_jdk_jvmargs,[$JAVA]) |
23171 | 406 |
|
407 |
AC_MSG_RESULT([$boot_jdk_jvmargs]) |
|
408 |
||
409 |
# For now, general JAVA_FLAGS are the same as the boot jdk jvmargs |
|
410 |
JAVA_FLAGS=$boot_jdk_jvmargs |
|
411 |
AC_SUBST(JAVA_FLAGS) |
|
412 |
||
413 |
AC_MSG_CHECKING([flags for boot jdk java command for big workloads]) |
|
414 |
||
22728
0a9d96bf2023
8036079: --with-boot-jdk-jvmargs configure options are ignored
mduigou
parents:
22477
diff
changeset
|
415 |
# Starting amount of heap memory. |
23171 | 416 |
ADD_JVM_ARG_IF_OK([-Xms64M],boot_jdk_jvmargs_big,[$JAVA]) |
39187
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
417 |
BOOTCYCLE_JVM_ARGS_BIG=-Xms64M |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
418 |
|
39187
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
419 |
# Maximum amount of heap memory and stack size. |
49706
dd26184768b0
8201495: [Zero] Reduce limits of max heap size for boot JDK on s390
sgehwolf
parents:
49159
diff
changeset
|
420 |
JVM_HEAP_LIMIT_32="768" |
39187
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
421 |
# Running a 64 bit JVM allows for and requires a bigger heap |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
422 |
JVM_HEAP_LIMIT_64="1600" |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
423 |
STACK_SIZE_32=768 |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
424 |
STACK_SIZE_64=1536 |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
425 |
JVM_HEAP_LIMIT_GLOBAL=`expr $MEMORY_SIZE / 2` |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
426 |
if test "$JVM_HEAP_LIMIT_GLOBAL" -lt "$JVM_HEAP_LIMIT_32"; then |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
427 |
JVM_HEAP_LIMIT_32=$JVM_HEAP_LIMIT_GLOBAL |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
428 |
fi |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
429 |
if test "$JVM_HEAP_LIMIT_GLOBAL" -lt "$JVM_HEAP_LIMIT_64"; then |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
430 |
JVM_HEAP_LIMIT_64=$JVM_HEAP_LIMIT_GLOBAL |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
431 |
fi |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
432 |
if test "$JVM_HEAP_LIMIT_GLOBAL" -lt "512"; then |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
433 |
JVM_HEAP_LIMIT_32=512 |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
434 |
JVM_HEAP_LIMIT_64=512 |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
435 |
fi |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
436 |
|
33032
19ae7cdc0cd0
8139813: Base heap size on type of boot jdk, not architecture of build machine
erikj
parents:
32921
diff
changeset
|
437 |
if test "x$BOOT_JDK_BITS" = "x32"; then |
39187
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
438 |
STACK_SIZE=$STACK_SIZE_32 |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
439 |
JVM_MAX_HEAP=$JVM_HEAP_LIMIT_32 |
22728
0a9d96bf2023
8036079: --with-boot-jdk-jvmargs configure options are ignored
mduigou
parents:
22477
diff
changeset
|
440 |
else |
39187
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
441 |
STACK_SIZE=$STACK_SIZE_64 |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
442 |
JVM_MAX_HEAP=$JVM_HEAP_LIMIT_64 |
20363 | 443 |
fi |
26131 | 444 |
ADD_JVM_ARG_IF_OK([-Xmx${JVM_MAX_HEAP}M],boot_jdk_jvmargs_big,[$JAVA]) |
23171 | 445 |
ADD_JVM_ARG_IF_OK([-XX:ThreadStackSize=$STACK_SIZE],boot_jdk_jvmargs_big,[$JAVA]) |
446 |
||
447 |
AC_MSG_RESULT([$boot_jdk_jvmargs_big]) |
|
22728
0a9d96bf2023
8036079: --with-boot-jdk-jvmargs configure options are ignored
mduigou
parents:
22477
diff
changeset
|
448 |
|
23171 | 449 |
JAVA_FLAGS_BIG=$boot_jdk_jvmargs_big |
450 |
AC_SUBST(JAVA_FLAGS_BIG) |
|
22728
0a9d96bf2023
8036079: --with-boot-jdk-jvmargs configure options are ignored
mduigou
parents:
22477
diff
changeset
|
451 |
|
39187
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
452 |
if test "x$OPENJDK_TARGET_CPU_BITS" = "x32"; then |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
453 |
BOOTCYCLE_MAX_HEAP=$JVM_HEAP_LIMIT_32 |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
454 |
BOOTCYCLE_STACK_SIZE=$STACK_SIZE_32 |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
455 |
else |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
456 |
BOOTCYCLE_MAX_HEAP=$JVM_HEAP_LIMIT_64 |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
457 |
BOOTCYCLE_STACK_SIZE=$STACK_SIZE_64 |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
458 |
fi |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
459 |
BOOTCYCLE_JVM_ARGS_BIG="$BOOTCYCLE_JVM_ARGS_BIG -Xmx${BOOTCYCLE_MAX_HEAP}M" |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
460 |
BOOTCYCLE_JVM_ARGS_BIG="$BOOTCYCLE_JVM_ARGS_BIG -XX:ThreadStackSize=$BOOTCYCLE_STACK_SIZE" |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
461 |
AC_MSG_CHECKING([flags for bootcycle boot jdk java command for big workloads]) |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
462 |
AC_MSG_RESULT([$BOOTCYCLE_JVM_ARGS_BIG]) |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
463 |
AC_SUBST(BOOTCYCLE_JVM_ARGS_BIG) |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
464 |
|
34101
a1db3b482137
8143296: javac-server/sjavac not compatible with LogFailures on Windows
erikj
parents:
33032
diff
changeset
|
465 |
# By default, the main javac compilations use big |
a1db3b482137
8143296: javac-server/sjavac not compatible with LogFailures on Windows
erikj
parents:
33032
diff
changeset
|
466 |
JAVA_FLAGS_JAVAC="$JAVA_FLAGS_BIG" |
a1db3b482137
8143296: javac-server/sjavac not compatible with LogFailures on Windows
erikj
parents:
33032
diff
changeset
|
467 |
AC_SUBST(JAVA_FLAGS_JAVAC) |
23171 | 468 |
|
469 |
AC_MSG_CHECKING([flags for boot jdk java command for small workloads]) |
|
22728
0a9d96bf2023
8036079: --with-boot-jdk-jvmargs configure options are ignored
mduigou
parents:
22477
diff
changeset
|
470 |
|
23171 | 471 |
# Use serial gc for small short lived tools if possible |
472 |
ADD_JVM_ARG_IF_OK([-XX:+UseSerialGC],boot_jdk_jvmargs_small,[$JAVA]) |
|
473 |
ADD_JVM_ARG_IF_OK([-Xms32M],boot_jdk_jvmargs_small,[$JAVA]) |
|
474 |
ADD_JVM_ARG_IF_OK([-Xmx512M],boot_jdk_jvmargs_small,[$JAVA]) |
|
37659
3715a97ba87b
8155824: JDK build should tune down small apps more aggressively
redestad
parents:
37014
diff
changeset
|
475 |
ADD_JVM_ARG_IF_OK([-XX:TieredStopAtLevel=1],boot_jdk_jvmargs_small,[$JAVA]) |
22728
0a9d96bf2023
8036079: --with-boot-jdk-jvmargs configure options are ignored
mduigou
parents:
22477
diff
changeset
|
476 |
|
23171 | 477 |
AC_MSG_RESULT([$boot_jdk_jvmargs_small]) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
478 |
|
23171 | 479 |
JAVA_FLAGS_SMALL=$boot_jdk_jvmargs_small |
480 |
AC_SUBST(JAVA_FLAGS_SMALL) |
|
25854 | 481 |
|
482 |
JAVA_TOOL_FLAGS_SMALL="" |
|
483 |
for f in $JAVA_FLAGS_SMALL; do |
|
484 |
JAVA_TOOL_FLAGS_SMALL="$JAVA_TOOL_FLAGS_SMALL -J$f" |
|
485 |
done |
|
486 |
AC_SUBST(JAVA_TOOL_FLAGS_SMALL) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
487 |
]) |
36506 | 488 |
|
489 |
# BUILD_JDK: the location of the latest JDK that can run |
|
490 |
# on the host system and supports the target class file version |
|
491 |
# generated in this JDK build. This variable should only be |
|
492 |
# used after the launchers are built. |
|
493 |
# |
|
494 |
||
495 |
# Execute the check given as argument, and verify the result. |
|
496 |
# If the JDK was previously found, do nothing. |
|
497 |
# $1 A command line (typically autoconf macro) to execute |
|
498 |
AC_DEFUN([BOOTJDK_CHECK_BUILD_JDK], |
|
499 |
[ |
|
500 |
if test "x$BUILD_JDK_FOUND" = xno; then |
|
501 |
# Execute the test |
|
502 |
$1 |
|
503 |
||
504 |
# If previous step claimed to have found a JDK, check it to see if it seems to be valid. |
|
505 |
if test "x$BUILD_JDK_FOUND" = xmaybe; then |
|
506 |
# Do we have a bin/java? |
|
507 |
if test ! -x "$BUILD_JDK/bin/java"; then |
|
508 |
AC_MSG_NOTICE([Potential Build JDK found at $BUILD_JDK did not contain bin/java; ignoring]) |
|
509 |
BUILD_JDK_FOUND=no |
|
510 |
elif test ! -x "$BUILD_JDK/bin/jlink"; then |
|
511 |
AC_MSG_NOTICE([Potential Build JDK found at $BUILD_JDK did not contain bin/jlink; ignoring]) |
|
512 |
BUILD_JDK_FOUND=no |
|
37771
30f2faf0e7a6
8153685: Parfait integration missing in the new tools (jmod and jlink)
erikj
parents:
37770
diff
changeset
|
513 |
elif test ! -x "$BUILD_JDK/bin/jmod"; then |
30f2faf0e7a6
8153685: Parfait integration missing in the new tools (jmod and jlink)
erikj
parents:
37770
diff
changeset
|
514 |
AC_MSG_NOTICE([Potential Build JDK found at $BUILD_JDK did not contain bin/jmod; ignoring]) |
30f2faf0e7a6
8153685: Parfait integration missing in the new tools (jmod and jlink)
erikj
parents:
37770
diff
changeset
|
515 |
BUILD_JDK_FOUND=no |
36506 | 516 |
elif test ! -x "$BUILD_JDK/bin/javac"; then |
517 |
# Do we have a bin/javac? |
|
518 |
AC_MSG_NOTICE([Potential Build JDK found at $BUILD_JDK did not contain bin/javac; ignoring]) |
|
519 |
AC_MSG_NOTICE([(This might be a JRE instead of an JDK)]) |
|
520 |
BUILD_JDK_FOUND=no |
|
521 |
else |
|
522 |
# Oh, this is looking good! We probably have found a proper JDK. Is it the correct version? |
|
38843
2b141e8e916f
8158535: Configure script uses basic tools directly in many places
erikj
parents:
37771
diff
changeset
|
523 |
BUILD_JDK_VERSION=`"$BUILD_JDK/bin/java" -version 2>&1 | $HEAD -n 1` |
36506 | 524 |
|
525 |
# Extra M4 quote needed to protect [] in grep expression. |
|
49159
436f1e03fd04
8199266: Update boot and build jdk requirements in configure
erikj
parents:
48845
diff
changeset
|
526 |
[FOUND_CORRECT_VERSION=`echo $BUILD_JDK_VERSION | $EGREP "\"$VERSION_FEATURE([\.+-].*)?\""`] |
36506 | 527 |
if test "x$FOUND_CORRECT_VERSION" = x; then |
37014
da8d0d4aa7ea
8154070: Configuration script unable to detect boot JDK's modules support
erikj
parents:
36506
diff
changeset
|
528 |
AC_MSG_NOTICE([Potential Build JDK found at $BUILD_JDK is incorrect JDK version ($BUILD_JDK_VERSION); ignoring]) |
49159
436f1e03fd04
8199266: Update boot and build jdk requirements in configure
erikj
parents:
48845
diff
changeset
|
529 |
AC_MSG_NOTICE([(Your Build JDK must be version $VERSION_FEATURE)]) |
36506 | 530 |
BUILD_JDK_FOUND=no |
531 |
else |
|
532 |
# We're done! |
|
533 |
BUILD_JDK_FOUND=yes |
|
534 |
BASIC_FIXUP_PATH(BUILD_JDK) |
|
535 |
AC_MSG_CHECKING([for Build JDK]) |
|
536 |
AC_MSG_RESULT([$BUILD_JDK]) |
|
537 |
AC_MSG_CHECKING([Build JDK version]) |
|
538 |
BUILD_JDK_VERSION=`"$BUILD_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` |
|
539 |
AC_MSG_RESULT([$BUILD_JDK_VERSION]) |
|
540 |
fi # end check jdk version |
|
541 |
fi # end check java |
|
542 |
fi # end check build jdk found |
|
543 |
fi |
|
544 |
]) |
|
545 |
||
546 |
# By default the BUILD_JDK is the JDK_OUTPUTDIR. If the target architecture |
|
547 |
# is different than the host system doing the build (e.g. cross-compilation), |
|
548 |
# a special BUILD_JDK is built as part of the build process. An external |
|
549 |
# prebuilt BUILD_JDK can also be supplied. |
|
550 |
AC_DEFUN([BOOTJDK_SETUP_BUILD_JDK], |
|
551 |
[ |
|
552 |
AC_ARG_WITH(build-jdk, [AS_HELP_STRING([--with-build-jdk], |
|
553 |
[path to JDK of same version as is being built@<:@the newly built JDK@:>@])]) |
|
554 |
||
37770 | 555 |
CREATE_BUILDJDK=false |
556 |
EXTERNAL_BUILDJDK=false |
|
36506 | 557 |
BUILD_JDK_FOUND="no" |
558 |
if test "x$with_build_jdk" != "x"; then |
|
559 |
BOOTJDK_CHECK_BUILD_JDK([ |
|
560 |
if test "x$with_build_jdk" != x; then |
|
561 |
BUILD_JDK=$with_build_jdk |
|
562 |
BUILD_JDK_FOUND=maybe |
|
563 |
AC_MSG_NOTICE([Found potential Build JDK using configure arguments]) |
|
564 |
fi]) |
|
37770 | 565 |
EXTERNAL_BUILDJDK=true |
36506 | 566 |
else |
567 |
if test "x$COMPILE_TYPE" = "xcross"; then |
|
568 |
BUILD_JDK="\$(BUILDJDK_OUTPUTDIR)/jdk" |
|
569 |
BUILD_JDK_FOUND=yes |
|
570 |
CREATE_BUILDJDK=true |
|
571 |
AC_MSG_CHECKING([for Build JDK]) |
|
572 |
AC_MSG_RESULT([yes, will build it for the host platform]) |
|
573 |
else |
|
574 |
BUILD_JDK="\$(JDK_OUTPUTDIR)" |
|
575 |
BUILD_JDK_FOUND=yes |
|
576 |
AC_MSG_CHECKING([for Build JDK]) |
|
577 |
AC_MSG_RESULT([yes, will use output dir]) |
|
578 |
fi |
|
579 |
fi |
|
580 |
||
37771
30f2faf0e7a6
8153685: Parfait integration missing in the new tools (jmod and jlink)
erikj
parents:
37770
diff
changeset
|
581 |
JMOD="$BUILD_JDK/bin/jmod" |
30f2faf0e7a6
8153685: Parfait integration missing in the new tools (jmod and jlink)
erikj
parents:
37770
diff
changeset
|
582 |
JLINK="$BUILD_JDK/bin/jlink" |
30f2faf0e7a6
8153685: Parfait integration missing in the new tools (jmod and jlink)
erikj
parents:
37770
diff
changeset
|
583 |
AC_SUBST(JMOD) |
30f2faf0e7a6
8153685: Parfait integration missing in the new tools (jmod and jlink)
erikj
parents:
37770
diff
changeset
|
584 |
AC_SUBST(JLINK) |
30f2faf0e7a6
8153685: Parfait integration missing in the new tools (jmod and jlink)
erikj
parents:
37770
diff
changeset
|
585 |
|
36506 | 586 |
if test "x$BUILD_JDK_FOUND" != "xyes"; then |
587 |
AC_MSG_CHECKING([for Build JDK]) |
|
588 |
AC_MSG_RESULT([no]) |
|
589 |
AC_MSG_ERROR([Could not find a suitable Build JDK]) |
|
590 |
fi |
|
591 |
||
592 |
AC_SUBST(CREATE_BUILDJDK) |
|
593 |
AC_SUBST(BUILD_JDK) |
|
37770 | 594 |
AC_SUBST(EXTERNAL_BUILDJDK) |
36506 | 595 |
]) |