author | sadayapalam |
Wed, 21 Sep 2016 05:26:26 +0530 | |
changeset 41156 | 251471aec877 |
parent 40241 | 59abac94e4f2 |
child 41458 | f285e333e8db |
permissions | -rw-r--r-- |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
1 |
# |
30093
c8c926543552
8077992: Eliminate JDK build dependency of native2ascii and update Japanese nroff man pages to UTF-8 encoding
ihse
parents:
27865
diff
changeset
|
2 |
# Copyright (c) 2011, 2015, 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? |
|
66 |
if test ! -x "$BOOT_JDK/bin/java"; then |
|
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? |
|
71 |
if test ! -x "$BOOT_JDK/bin/javac"; then |
|
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? |
38843
2b141e8e916f
8158535: Configure script uses basic tools directly in many places
erikj
parents:
37771
diff
changeset
|
77 |
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1` |
27865
6c830e3b9caf
8066828: configure fails if it's set --with-boot-jdk to use JDK 9 modular image
erikj
parents:
27602
diff
changeset
|
78 |
|
6c830e3b9caf
8066828: configure fails if it's set --with-boot-jdk to use JDK 9 modular image
erikj
parents:
27602
diff
changeset
|
79 |
# Extra M4 quote needed to protect [] in grep expression. |
33945
221ef2f7c09f
8137259: configure needs to parse Verona-style version strings for bootjdk
ihse
parents:
30093
diff
changeset
|
80 |
[FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"9([\.+-].*)?\"|(1\.[89]\.)'`] |
27865
6c830e3b9caf
8066828: configure fails if it's set --with-boot-jdk to use JDK 9 modular image
erikj
parents:
27602
diff
changeset
|
81 |
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
|
82 |
AC_MSG_NOTICE([Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring]) |
6c830e3b9caf
8066828: configure fails if it's set --with-boot-jdk to use JDK 9 modular image
erikj
parents:
27602
diff
changeset
|
83 |
AC_MSG_NOTICE([(Your Boot JDK must be version 8 or 9)]) |
13697 | 84 |
BOOT_JDK_FOUND=no |
85 |
else |
|
27865
6c830e3b9caf
8066828: configure fails if it's set --with-boot-jdk to use JDK 9 modular image
erikj
parents:
27602
diff
changeset
|
86 |
# 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
|
87 |
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
|
88 |
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
|
89 |
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
|
90 |
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
|
91 |
AC_MSG_CHECKING([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
|
92 |
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` |
6c830e3b9caf
8066828: configure fails if it's set --with-boot-jdk to use JDK 9 modular image
erikj
parents:
27602
diff
changeset
|
93 |
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
|
94 |
fi # end check jdk version |
13697 | 95 |
fi # end check javac |
96 |
fi # end check java |
|
97 |
fi # end check boot jdk found |
|
98 |
fi |
|
99 |
]) |
|
100 |
||
101 |
# Test: Is bootjdk explicitely set by command line arguments? |
|
102 |
AC_DEFUN([BOOTJDK_CHECK_ARGUMENTS], |
|
103 |
[ |
|
20363 | 104 |
if test "x$with_boot_jdk" != x; then |
13697 | 105 |
BOOT_JDK=$with_boot_jdk |
106 |
BOOT_JDK_FOUND=maybe |
|
107 |
AC_MSG_NOTICE([Found potential Boot JDK using configure arguments]) |
|
20363 | 108 |
fi |
13697 | 109 |
]) |
110 |
||
111 |
# Test: Is $JAVA_HOME set? |
|
112 |
AC_DEFUN([BOOTJDK_CHECK_JAVA_HOME], |
|
113 |
[ |
|
20363 | 114 |
if test "x$JAVA_HOME" != x; then |
115 |
JAVA_HOME_PROCESSED="$JAVA_HOME" |
|
116 |
BASIC_FIXUP_PATH(JAVA_HOME_PROCESSED) |
|
117 |
if test ! -d "$JAVA_HOME_PROCESSED"; then |
|
118 |
AC_MSG_NOTICE([Your JAVA_HOME points to a non-existing directory!]) |
|
119 |
else |
|
120 |
# Aha, the user has set a JAVA_HOME |
|
121 |
# let us use that as the Boot JDK. |
|
122 |
BOOT_JDK="$JAVA_HOME_PROCESSED" |
|
123 |
BOOT_JDK_FOUND=maybe |
|
124 |
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
|
125 |
fi |
20363 | 126 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
127 |
]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
128 |
|
13697 | 129 |
# Test: Is there a java or javac in the PATH, which is a symlink to the JDK? |
130 |
AC_DEFUN([BOOTJDK_CHECK_JAVA_IN_PATH_IS_SYMLINK], |
|
131 |
[ |
|
20363 | 132 |
AC_PATH_PROG(JAVAC_CHECK, javac) |
133 |
AC_PATH_PROG(JAVA_CHECK, java) |
|
134 |
BINARY="$JAVAC_CHECK" |
|
135 |
if test "x$JAVAC_CHECK" = x; then |
|
136 |
BINARY="$JAVA_CHECK" |
|
137 |
fi |
|
138 |
if test "x$BINARY" != x; then |
|
139 |
# So there is a java(c) binary, it might be part of a JDK. |
|
140 |
# Lets find the JDK/JRE directory by following symbolic links. |
|
141 |
# Linux/GNU systems often have links from /usr/bin/java to |
|
142 |
# /etc/alternatives/java to the real JDK binary. |
|
143 |
BASIC_REMOVE_SYMBOLIC_LINKS(BINARY) |
|
144 |
BOOT_JDK=`dirname "$BINARY"` |
|
145 |
BOOT_JDK=`cd "$BOOT_JDK/.."; pwd` |
|
146 |
if test -x "$BOOT_JDK/bin/javac" && test -x "$BOOT_JDK/bin/java"; then |
|
147 |
# Looks like we found ourselves an JDK |
|
148 |
BOOT_JDK_FOUND=maybe |
|
149 |
AC_MSG_NOTICE([Found potential Boot JDK using java(c) in PATH]) |
|
13697 | 150 |
fi |
20363 | 151 |
fi |
13697 | 152 |
]) |
153 |
||
154 |
# Test: Is there a /usr/libexec/java_home? (Typically on MacOSX) |
|
22477 | 155 |
# $1: Argument to the java_home binary (optional) |
13697 | 156 |
AC_DEFUN([BOOTJDK_CHECK_LIBEXEC_JAVA_HOME], |
157 |
[ |
|
20363 | 158 |
if test -x /usr/libexec/java_home; then |
22477 | 159 |
BOOT_JDK=`/usr/libexec/java_home $1` |
20363 | 160 |
BOOT_JDK_FOUND=maybe |
22477 | 161 |
AC_MSG_NOTICE([Found potential Boot JDK using /usr/libexec/java_home $1]) |
162 |
fi |
|
163 |
]) |
|
164 |
||
165 |
# Test: On MacOS X, can we find a boot jdk using /usr/libexec/java_home? |
|
166 |
AC_DEFUN([BOOTJDK_CHECK_MACOSX_JAVA_LOCATOR], |
|
167 |
[ |
|
168 |
if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
|
169 |
# First check at user selected default |
|
170 |
BOOTJDK_DO_CHECK([BOOTJDK_CHECK_LIBEXEC_JAVA_HOME()]) |
|
171 |
# If that did not work out (e.g. too old), try explicit versions instead |
|
172 |
BOOTJDK_DO_CHECK([BOOTJDK_CHECK_LIBEXEC_JAVA_HOME([-v 1.9])]) |
|
173 |
BOOTJDK_DO_CHECK([BOOTJDK_CHECK_LIBEXEC_JAVA_HOME([-v 1.8])]) |
|
174 |
BOOTJDK_DO_CHECK([BOOTJDK_CHECK_LIBEXEC_JAVA_HOME([-v 1.7])]) |
|
20363 | 175 |
fi |
13697 | 176 |
]) |
177 |
||
178 |
# Look for a jdk in the given path. If there are multiple, try to select the newest. |
|
179 |
# If found, set BOOT_JDK and BOOT_JDK_FOUND. |
|
180 |
# $1 = Path to directory containing jdk installations. |
|
181 |
# $2 = String to append to the found JDK directory to get the proper JDK home |
|
182 |
AC_DEFUN([BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY], |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
183 |
[ |
13697 | 184 |
BOOT_JDK_PREFIX="$1" |
185 |
BOOT_JDK_SUFFIX="$2" |
|
14111 | 186 |
ALL_JDKS_FOUND=`$LS "$BOOT_JDK_PREFIX" 2> /dev/null | $SORT -r` |
187 |
if test "x$ALL_JDKS_FOUND" != x; then |
|
188 |
for JDK_TO_TRY in $ALL_JDKS_FOUND ; do |
|
189 |
BOOTJDK_DO_CHECK([ |
|
190 |
BOOT_JDK="${BOOT_JDK_PREFIX}/${JDK_TO_TRY}${BOOT_JDK_SUFFIX}" |
|
191 |
if test -d "$BOOT_JDK"; then |
|
192 |
BOOT_JDK_FOUND=maybe |
|
193 |
AC_MSG_NOTICE([Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)]) |
|
194 |
fi |
|
195 |
]) |
|
196 |
done |
|
13697 | 197 |
fi |
198 |
]) |
|
199 |
||
200 |
# Call BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY, but use the given |
|
201 |
# environmental variable as base for where to look. |
|
202 |
# $1 Name of an environmal variable, assumed to point to the Program Files directory. |
|
203 |
AC_DEFUN([BOOTJDK_FIND_BEST_JDK_IN_WINDOWS_VIRTUAL_DIRECTORY], |
|
204 |
[ |
|
205 |
if test "x[$]$1" != x; then |
|
14111 | 206 |
VIRTUAL_DIR="[$]$1/Java" |
207 |
BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(VIRTUAL_DIR) |
|
208 |
BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY($VIRTUAL_DIR) |
|
13697 | 209 |
fi |
210 |
]) |
|
211 |
||
212 |
# Test: Is there a JDK installed in default, well-known locations? |
|
213 |
AC_DEFUN([BOOTJDK_CHECK_WELL_KNOWN_LOCATIONS], |
|
214 |
[ |
|
215 |
if test "x$OPENJDK_TARGET_OS" = xwindows; then |
|
216 |
BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_WINDOWS_VIRTUAL_DIRECTORY([ProgramW6432])]) |
|
217 |
BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_WINDOWS_VIRTUAL_DIRECTORY([PROGRAMW6432])]) |
|
218 |
BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_WINDOWS_VIRTUAL_DIRECTORY([PROGRAMFILES])]) |
|
219 |
BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_WINDOWS_VIRTUAL_DIRECTORY([ProgramFiles])]) |
|
220 |
BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY([/cygdrive/c/Program Files/Java])]) |
|
221 |
elif test "x$OPENJDK_TARGET_OS" = xmacosx; then |
|
222 |
BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY([/Library/Java/JavaVirtualMachines],[/Contents/Home])]) |
|
223 |
BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY([/System/Library/Java/JavaVirtualMachines],[/Contents/Home])]) |
|
14111 | 224 |
elif test "x$OPENJDK_TARGET_OS" = xlinux; then |
225 |
BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY([/usr/lib/jvm])]) |
|
13697 | 226 |
fi |
227 |
]) |
|
228 |
||
229 |
# Check that a command-line tool in the Boot JDK is correct |
|
230 |
# $1 = name of variable to assign |
|
231 |
# $2 = name of binary |
|
232 |
AC_DEFUN([BOOTJDK_CHECK_TOOL_IN_BOOTJDK], |
|
233 |
[ |
|
22477 | 234 |
# 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
|
235 |
BASIC_SETUP_TOOL($1, |
22477 | 236 |
[ |
237 |
AC_MSG_CHECKING([for $2 in Boot JDK]) |
|
238 |
$1=$BOOT_JDK/bin/$2 |
|
239 |
if test ! -x [$]$1; then |
|
240 |
AC_MSG_RESULT(not found) |
|
241 |
AC_MSG_NOTICE([Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk]) |
|
242 |
AC_MSG_ERROR([Could not find $2 in the Boot JDK]) |
|
243 |
fi |
|
244 |
AC_MSG_RESULT(ok) |
|
245 |
AC_SUBST($1) |
|
246 |
]) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
247 |
]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
248 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
249 |
############################################################################### |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
250 |
# |
20363 | 251 |
# We need a Boot JDK to bootstrap the build. |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
252 |
# |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
253 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
254 |
AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK], |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
255 |
[ |
20363 | 256 |
BOOT_JDK_FOUND=no |
257 |
AC_ARG_WITH(boot-jdk, [AS_HELP_STRING([--with-boot-jdk], |
|
258 |
[path to Boot JDK (used to bootstrap build) @<:@probed@:>@])]) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
259 |
|
20363 | 260 |
# We look for the Boot JDK through various means, going from more certain to |
261 |
# more of a guess-work. After each test, BOOT_JDK_FOUND is set to "yes" if |
|
262 |
# we detected something (if so, the path to the jdk is in BOOT_JDK). But we |
|
263 |
# 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
|
264 |
|
20363 | 265 |
# Test: Is bootjdk explicitely set by command line arguments? |
266 |
BOOTJDK_DO_CHECK([BOOTJDK_CHECK_ARGUMENTS]) |
|
267 |
if test "x$with_boot_jdk" != x && test "x$BOOT_JDK_FOUND" = xno; then |
|
268 |
# Having specified an argument which is incorrect will produce an instant failure; |
|
269 |
# we should not go on looking |
|
270 |
AC_MSG_ERROR([The path given by --with-boot-jdk does not contain a valid Boot JDK]) |
|
271 |
fi |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
272 |
|
22477 | 273 |
# Test: On MacOS X, can we find a boot jdk using /usr/libexec/java_home? |
274 |
BOOTJDK_DO_CHECK([BOOTJDK_CHECK_MACOSX_JAVA_LOCATOR]) |
|
275 |
||
20363 | 276 |
# Test: Is $JAVA_HOME set? |
277 |
BOOTJDK_DO_CHECK([BOOTJDK_CHECK_JAVA_HOME]) |
|
13697 | 278 |
|
20363 | 279 |
# Test: Is there a java or javac in the PATH, which is a symlink to the JDK? |
280 |
BOOTJDK_DO_CHECK([BOOTJDK_CHECK_JAVA_IN_PATH_IS_SYMLINK]) |
|
13697 | 281 |
|
20363 | 282 |
# Test: Is there a JDK installed in default, well-known locations? |
283 |
BOOTJDK_DO_CHECK([BOOTJDK_CHECK_WELL_KNOWN_LOCATIONS]) |
|
13697 | 284 |
|
20363 | 285 |
# If we haven't found anything yet, we've truly lost. Give up. |
286 |
if test "x$BOOT_JDK_FOUND" = xno; then |
|
287 |
HELP_MSG_MISSING_DEPENDENCY([openjdk]) |
|
288 |
AC_MSG_NOTICE([Could not find a valid Boot JDK. $HELP_MSG]) |
|
289 |
AC_MSG_NOTICE([This might be fixed by explicitely setting --with-boot-jdk]) |
|
290 |
AC_MSG_ERROR([Cannot continue]) |
|
291 |
fi |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
292 |
|
20363 | 293 |
AC_SUBST(BOOT_JDK) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
294 |
|
20363 | 295 |
# Setup tools from the Boot JDK. |
22477 | 296 |
BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVA, java) |
297 |
BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVAC, javac) |
|
298 |
BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVAH, javah) |
|
299 |
BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAR, jar) |
|
300 |
BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JARSIGNER, jarsigner) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
301 |
|
20363 | 302 |
# Finally, set some other options... |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
303 |
|
24304
f51622799778
8042932: Bump up the -source version for JDK 9 builds
coffeys
parents:
23982
diff
changeset
|
304 |
# When compiling code to be executed by the Boot JDK, force jdk8 compatibility. |
f51622799778
8042932: Bump up the -source version for JDK 9 builds
coffeys
parents:
23982
diff
changeset
|
305 |
BOOT_JDK_SOURCETARGET="-source 8 -target 8" |
20363 | 306 |
AC_SUBST(BOOT_JDK_SOURCETARGET) |
36506 | 307 |
|
40241
59abac94e4f2
8136930: Simplify use of module-system options by custom launchers
mchung
parents:
39684
diff
changeset
|
308 |
ADD_JVM_ARG_IF_OK([--patch-module foo=bar], dummy, [$JAVA]) |
36506 | 309 |
AC_MSG_CHECKING([if Boot JDK supports modules]) |
310 |
if test "x$JVM_ARG_OK" = "xtrue"; then |
|
311 |
AC_MSG_RESULT([yes]) |
|
312 |
BOOT_JDK_MODULAR="true" |
|
313 |
else |
|
314 |
AC_MSG_RESULT([no]) |
|
315 |
BOOT_JDK_MODULAR="false" |
|
316 |
fi |
|
317 |
AC_SUBST(BOOT_JDK_MODULAR) |
|
318 |
||
20363 | 319 |
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
|
320 |
|
19ae7cdc0cd0
8139813: Base heap size on type of boot jdk, not architecture of build machine
erikj
parents:
32921
diff
changeset
|
321 |
# Check if the boot jdk is 32 or 64 bit |
19ae7cdc0cd0
8139813: Base heap size on type of boot jdk, not architecture of build machine
erikj
parents:
32921
diff
changeset
|
322 |
if "$JAVA" -d64 -version > /dev/null 2>&1; then |
19ae7cdc0cd0
8139813: Base heap size on type of boot jdk, not architecture of build machine
erikj
parents:
32921
diff
changeset
|
323 |
BOOT_JDK_BITS="64" |
19ae7cdc0cd0
8139813: Base heap size on type of boot jdk, not architecture of build machine
erikj
parents:
32921
diff
changeset
|
324 |
else |
19ae7cdc0cd0
8139813: Base heap size on type of boot jdk, not architecture of build machine
erikj
parents:
32921
diff
changeset
|
325 |
BOOT_JDK_BITS="32" |
19ae7cdc0cd0
8139813: Base heap size on type of boot jdk, not architecture of build machine
erikj
parents:
32921
diff
changeset
|
326 |
fi |
19ae7cdc0cd0
8139813: Base heap size on type of boot jdk, not architecture of build machine
erikj
parents:
32921
diff
changeset
|
327 |
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
|
328 |
AC_MSG_RESULT([$BOOT_JDK_BITS]) |
19ae7cdc0cd0
8139813: Base heap size on type of boot jdk, not architecture of build machine
erikj
parents:
32921
diff
changeset
|
329 |
AC_SUBST(BOOT_JDK_BITS) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
330 |
]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
331 |
|
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
332 |
AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS], |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
333 |
[ |
20363 | 334 |
############################################################################## |
335 |
# |
|
22728
0a9d96bf2023
8036079: --with-boot-jdk-jvmargs configure options are ignored
mduigou
parents:
22477
diff
changeset
|
336 |
# 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
|
337 |
# Not all JVM:s accept the same arguments on the command line. |
20363 | 338 |
# |
339 |
AC_ARG_WITH(boot-jdk-jvmargs, [AS_HELP_STRING([--with-boot-jdk-jvmargs], |
|
22728
0a9d96bf2023
8036079: --with-boot-jdk-jvmargs configure options are ignored
mduigou
parents:
22477
diff
changeset
|
340 |
[specify JVM arguments to be passed to all java invocations of boot JDK, overriding the default values, |
20363 | 341 |
e.g --with-boot-jdk-jvmargs="-Xmx8G -enableassertions"])]) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
342 |
|
22728
0a9d96bf2023
8036079: --with-boot-jdk-jvmargs configure options are ignored
mduigou
parents:
22477
diff
changeset
|
343 |
AC_MSG_CHECKING([flags for boot jdk java command] ) |
0a9d96bf2023
8036079: --with-boot-jdk-jvmargs configure options are ignored
mduigou
parents:
22477
diff
changeset
|
344 |
|
23171 | 345 |
# Disable special log output when a debug build is used as Boot JDK... |
346 |
ADD_JVM_ARG_IF_OK([-XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput],boot_jdk_jvmargs,[$JAVA]) |
|
347 |
||
39684 | 348 |
# Force en-US environment |
349 |
ADD_JVM_ARG_IF_OK([-Duser.language=en -Duser.country=US],boot_jdk_jvmargs,[$JAVA]) |
|
350 |
||
23171 | 351 |
# Apply user provided options. |
352 |
ADD_JVM_ARG_IF_OK([$with_boot_jdk_jvmargs],boot_jdk_jvmargs,[$JAVA]) |
|
353 |
||
354 |
AC_MSG_RESULT([$boot_jdk_jvmargs]) |
|
355 |
||
356 |
# For now, general JAVA_FLAGS are the same as the boot jdk jvmargs |
|
357 |
JAVA_FLAGS=$boot_jdk_jvmargs |
|
358 |
AC_SUBST(JAVA_FLAGS) |
|
359 |
||
360 |
||
361 |
AC_MSG_CHECKING([flags for boot jdk java command for big workloads]) |
|
362 |
||
22728
0a9d96bf2023
8036079: --with-boot-jdk-jvmargs configure options are ignored
mduigou
parents:
22477
diff
changeset
|
363 |
# Starting amount of heap memory. |
23171 | 364 |
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
|
365 |
BOOTCYCLE_JVM_ARGS_BIG=-Xms64M |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
366 |
|
39187
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
367 |
# Maximum amount of heap memory and stack size. |
39189
bae461399d89
8160571: Bootcycle builds still broken with server jvm on Windows 32bit
erikj
parents:
39187
diff
changeset
|
368 |
JVM_HEAP_LIMIT_32="1024" |
39187
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
369 |
# 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
|
370 |
JVM_HEAP_LIMIT_64="1600" |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
371 |
STACK_SIZE_32=768 |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
372 |
STACK_SIZE_64=1536 |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
373 |
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
|
374 |
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
|
375 |
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
|
376 |
fi |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
377 |
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
|
378 |
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
|
379 |
fi |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
380 |
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
|
381 |
JVM_HEAP_LIMIT_32=512 |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
382 |
JVM_HEAP_LIMIT_64=512 |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
383 |
fi |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
384 |
|
33032
19ae7cdc0cd0
8139813: Base heap size on type of boot jdk, not architecture of build machine
erikj
parents:
32921
diff
changeset
|
385 |
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
|
386 |
STACK_SIZE=$STACK_SIZE_32 |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
387 |
JVM_MAX_HEAP=$JVM_HEAP_LIMIT_32 |
22728
0a9d96bf2023
8036079: --with-boot-jdk-jvmargs configure options are ignored
mduigou
parents:
22477
diff
changeset
|
388 |
else |
39187
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
389 |
STACK_SIZE=$STACK_SIZE_64 |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
390 |
JVM_MAX_HEAP=$JVM_HEAP_LIMIT_64 |
20363 | 391 |
fi |
26131 | 392 |
ADD_JVM_ARG_IF_OK([-Xmx${JVM_MAX_HEAP}M],boot_jdk_jvmargs_big,[$JAVA]) |
23171 | 393 |
ADD_JVM_ARG_IF_OK([-XX:ThreadStackSize=$STACK_SIZE],boot_jdk_jvmargs_big,[$JAVA]) |
394 |
||
395 |
AC_MSG_RESULT([$boot_jdk_jvmargs_big]) |
|
22728
0a9d96bf2023
8036079: --with-boot-jdk-jvmargs configure options are ignored
mduigou
parents:
22477
diff
changeset
|
396 |
|
23171 | 397 |
JAVA_FLAGS_BIG=$boot_jdk_jvmargs_big |
398 |
AC_SUBST(JAVA_FLAGS_BIG) |
|
22728
0a9d96bf2023
8036079: --with-boot-jdk-jvmargs configure options are ignored
mduigou
parents:
22477
diff
changeset
|
399 |
|
39187
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
400 |
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
|
401 |
BOOTCYCLE_MAX_HEAP=$JVM_HEAP_LIMIT_32 |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
402 |
BOOTCYCLE_STACK_SIZE=$STACK_SIZE_32 |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
403 |
else |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
404 |
BOOTCYCLE_MAX_HEAP=$JVM_HEAP_LIMIT_64 |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
405 |
BOOTCYCLE_STACK_SIZE=$STACK_SIZE_64 |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
406 |
fi |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
407 |
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
|
408 |
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
|
409 |
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
|
410 |
AC_MSG_RESULT([$BOOTCYCLE_JVM_ARGS_BIG]) |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
411 |
AC_SUBST(BOOTCYCLE_JVM_ARGS_BIG) |
9decd6e374e2
8160285: Bootcycle builds are broken on jdk9/hs for windows i586
erikj
parents:
38843
diff
changeset
|
412 |
|
34101
a1db3b482137
8143296: javac-server/sjavac not compatible with LogFailures on Windows
erikj
parents:
33032
diff
changeset
|
413 |
# By default, the main javac compilations use big |
a1db3b482137
8143296: javac-server/sjavac not compatible with LogFailures on Windows
erikj
parents:
33032
diff
changeset
|
414 |
JAVA_FLAGS_JAVAC="$JAVA_FLAGS_BIG" |
a1db3b482137
8143296: javac-server/sjavac not compatible with LogFailures on Windows
erikj
parents:
33032
diff
changeset
|
415 |
AC_SUBST(JAVA_FLAGS_JAVAC) |
23171 | 416 |
|
417 |
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
|
418 |
|
23171 | 419 |
# Use serial gc for small short lived tools if possible |
420 |
ADD_JVM_ARG_IF_OK([-XX:+UseSerialGC],boot_jdk_jvmargs_small,[$JAVA]) |
|
421 |
ADD_JVM_ARG_IF_OK([-Xms32M],boot_jdk_jvmargs_small,[$JAVA]) |
|
422 |
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
|
423 |
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
|
424 |
|
23171 | 425 |
AC_MSG_RESULT([$boot_jdk_jvmargs_small]) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
426 |
|
23171 | 427 |
JAVA_FLAGS_SMALL=$boot_jdk_jvmargs_small |
428 |
AC_SUBST(JAVA_FLAGS_SMALL) |
|
25854 | 429 |
|
430 |
JAVA_TOOL_FLAGS_SMALL="" |
|
431 |
for f in $JAVA_FLAGS_SMALL; do |
|
432 |
JAVA_TOOL_FLAGS_SMALL="$JAVA_TOOL_FLAGS_SMALL -J$f" |
|
433 |
done |
|
434 |
AC_SUBST(JAVA_TOOL_FLAGS_SMALL) |
|
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
435 |
]) |
36506 | 436 |
|
437 |
# BUILD_JDK: the location of the latest JDK that can run |
|
438 |
# on the host system and supports the target class file version |
|
439 |
# generated in this JDK build. This variable should only be |
|
440 |
# used after the launchers are built. |
|
441 |
# |
|
442 |
||
443 |
# Execute the check given as argument, and verify the result. |
|
444 |
# If the JDK was previously found, do nothing. |
|
445 |
# $1 A command line (typically autoconf macro) to execute |
|
446 |
AC_DEFUN([BOOTJDK_CHECK_BUILD_JDK], |
|
447 |
[ |
|
448 |
if test "x$BUILD_JDK_FOUND" = xno; then |
|
449 |
# Execute the test |
|
450 |
$1 |
|
451 |
||
452 |
# If previous step claimed to have found a JDK, check it to see if it seems to be valid. |
|
453 |
if test "x$BUILD_JDK_FOUND" = xmaybe; then |
|
454 |
# Do we have a bin/java? |
|
455 |
if test ! -x "$BUILD_JDK/bin/java"; then |
|
456 |
AC_MSG_NOTICE([Potential Build JDK found at $BUILD_JDK did not contain bin/java; ignoring]) |
|
457 |
BUILD_JDK_FOUND=no |
|
458 |
elif test ! -x "$BUILD_JDK/bin/jlink"; then |
|
459 |
AC_MSG_NOTICE([Potential Build JDK found at $BUILD_JDK did not contain bin/jlink; ignoring]) |
|
460 |
BUILD_JDK_FOUND=no |
|
37771
30f2faf0e7a6
8153685: Parfait integration missing in the new tools (jmod and jlink)
erikj
parents:
37770
diff
changeset
|
461 |
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
|
462 |
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
|
463 |
BUILD_JDK_FOUND=no |
36506 | 464 |
elif test ! -x "$BUILD_JDK/bin/javac"; then |
465 |
# Do we have a bin/javac? |
|
466 |
AC_MSG_NOTICE([Potential Build JDK found at $BUILD_JDK did not contain bin/javac; ignoring]) |
|
467 |
AC_MSG_NOTICE([(This might be a JRE instead of an JDK)]) |
|
468 |
BUILD_JDK_FOUND=no |
|
469 |
else |
|
470 |
# 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
|
471 |
BUILD_JDK_VERSION=`"$BUILD_JDK/bin/java" -version 2>&1 | $HEAD -n 1` |
36506 | 472 |
|
473 |
# Extra M4 quote needed to protect [] in grep expression. |
|
37014
da8d0d4aa7ea
8154070: Configuration script unable to detect boot JDK's modules support
erikj
parents:
36506
diff
changeset
|
474 |
[FOUND_CORRECT_VERSION=`echo $BUILD_JDK_VERSION | $EGREP '\"9([\.+-].*)?\"'`] |
36506 | 475 |
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
|
476 |
AC_MSG_NOTICE([Potential Build JDK found at $BUILD_JDK is incorrect JDK version ($BUILD_JDK_VERSION); ignoring]) |
36506 | 477 |
AC_MSG_NOTICE([(Your Build JDK must be version 9)]) |
478 |
BUILD_JDK_FOUND=no |
|
479 |
else |
|
480 |
# We're done! |
|
481 |
BUILD_JDK_FOUND=yes |
|
482 |
BASIC_FIXUP_PATH(BUILD_JDK) |
|
483 |
AC_MSG_CHECKING([for Build JDK]) |
|
484 |
AC_MSG_RESULT([$BUILD_JDK]) |
|
485 |
AC_MSG_CHECKING([Build JDK version]) |
|
486 |
BUILD_JDK_VERSION=`"$BUILD_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` |
|
487 |
AC_MSG_RESULT([$BUILD_JDK_VERSION]) |
|
488 |
fi # end check jdk version |
|
489 |
fi # end check java |
|
490 |
fi # end check build jdk found |
|
491 |
fi |
|
492 |
]) |
|
493 |
||
494 |
# By default the BUILD_JDK is the JDK_OUTPUTDIR. If the target architecture |
|
495 |
# is different than the host system doing the build (e.g. cross-compilation), |
|
496 |
# a special BUILD_JDK is built as part of the build process. An external |
|
497 |
# prebuilt BUILD_JDK can also be supplied. |
|
498 |
AC_DEFUN([BOOTJDK_SETUP_BUILD_JDK], |
|
499 |
[ |
|
500 |
AC_ARG_WITH(build-jdk, [AS_HELP_STRING([--with-build-jdk], |
|
501 |
[path to JDK of same version as is being built@<:@the newly built JDK@:>@])]) |
|
502 |
||
37770 | 503 |
CREATE_BUILDJDK=false |
504 |
EXTERNAL_BUILDJDK=false |
|
36506 | 505 |
BUILD_JDK_FOUND="no" |
506 |
if test "x$with_build_jdk" != "x"; then |
|
507 |
BOOTJDK_CHECK_BUILD_JDK([ |
|
508 |
if test "x$with_build_jdk" != x; then |
|
509 |
BUILD_JDK=$with_build_jdk |
|
510 |
BUILD_JDK_FOUND=maybe |
|
511 |
AC_MSG_NOTICE([Found potential Build JDK using configure arguments]) |
|
512 |
fi]) |
|
37770 | 513 |
EXTERNAL_BUILDJDK=true |
36506 | 514 |
else |
515 |
if test "x$COMPILE_TYPE" = "xcross"; then |
|
516 |
BUILD_JDK="\$(BUILDJDK_OUTPUTDIR)/jdk" |
|
517 |
BUILD_JDK_FOUND=yes |
|
518 |
CREATE_BUILDJDK=true |
|
519 |
AC_MSG_CHECKING([for Build JDK]) |
|
520 |
AC_MSG_RESULT([yes, will build it for the host platform]) |
|
521 |
else |
|
522 |
BUILD_JDK="\$(JDK_OUTPUTDIR)" |
|
523 |
BUILD_JDK_FOUND=yes |
|
524 |
AC_MSG_CHECKING([for Build JDK]) |
|
525 |
AC_MSG_RESULT([yes, will use output dir]) |
|
526 |
fi |
|
527 |
fi |
|
528 |
||
37771
30f2faf0e7a6
8153685: Parfait integration missing in the new tools (jmod and jlink)
erikj
parents:
37770
diff
changeset
|
529 |
JMOD="$BUILD_JDK/bin/jmod" |
30f2faf0e7a6
8153685: Parfait integration missing in the new tools (jmod and jlink)
erikj
parents:
37770
diff
changeset
|
530 |
JLINK="$BUILD_JDK/bin/jlink" |
30f2faf0e7a6
8153685: Parfait integration missing in the new tools (jmod and jlink)
erikj
parents:
37770
diff
changeset
|
531 |
AC_SUBST(JMOD) |
30f2faf0e7a6
8153685: Parfait integration missing in the new tools (jmod and jlink)
erikj
parents:
37770
diff
changeset
|
532 |
AC_SUBST(JLINK) |
30f2faf0e7a6
8153685: Parfait integration missing in the new tools (jmod and jlink)
erikj
parents:
37770
diff
changeset
|
533 |
|
36506 | 534 |
if test "x$BUILD_JDK_FOUND" != "xyes"; then |
535 |
AC_MSG_CHECKING([for Build JDK]) |
|
536 |
AC_MSG_RESULT([no]) |
|
537 |
AC_MSG_ERROR([Could not find a suitable Build JDK]) |
|
538 |
fi |
|
539 |
||
540 |
AC_SUBST(CREATE_BUILDJDK) |
|
541 |
AC_SUBST(BUILD_JDK) |
|
37770 | 542 |
AC_SUBST(EXTERNAL_BUILDJDK) |
36506 | 543 |
]) |