Tue, 28 May 2019 18:50:01 +0200
8218020: Fix version number in mesa.md 3rd party legal file
Reviewed-by: clanger
erikj@459 | 1 | # |
erikj@459 | 2 | # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. |
erikj@459 | 3 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
erikj@459 | 4 | # |
erikj@459 | 5 | # This code is free software; you can redistribute it and/or modify it |
erikj@459 | 6 | # under the terms of the GNU General Public License version 2 only, as |
erikj@459 | 7 | # published by the Free Software Foundation. Oracle designates this |
erikj@459 | 8 | # particular file as subject to the "Classpath" exception as provided |
erikj@459 | 9 | # by Oracle in the LICENSE file that accompanied this code. |
erikj@459 | 10 | # |
erikj@459 | 11 | # This code is distributed in the hope that it will be useful, but WITHOUT |
erikj@459 | 12 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
erikj@459 | 13 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
erikj@459 | 14 | # version 2 for more details (a copy is included in the LICENSE file that |
erikj@459 | 15 | # accompanied this code). |
erikj@459 | 16 | # |
erikj@459 | 17 | # You should have received a copy of the GNU General Public License version |
erikj@459 | 18 | # 2 along with this work; if not, write to the Free Software Foundation, |
erikj@459 | 19 | # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
erikj@459 | 20 | # |
erikj@459 | 21 | # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
erikj@459 | 22 | # or visit www.oracle.com if you need additional information or have any |
erikj@459 | 23 | # questions. |
erikj@459 | 24 | # |
erikj@459 | 25 | |
ohair@478 | 26 | # Execute the check given as argument, and verify the result |
ohair@478 | 27 | # If the Boot JDK was previously found, do nothing |
ohair@478 | 28 | # $1 A command line (typically autoconf macro) to execute |
ohair@478 | 29 | AC_DEFUN([BOOTJDK_DO_CHECK], |
erikj@459 | 30 | [ |
ohair@478 | 31 | if test "x$BOOT_JDK_FOUND" = xno; then |
ohair@478 | 32 | # Now execute the test |
ohair@478 | 33 | $1 |
ohair@478 | 34 | |
ohair@478 | 35 | # If previous step claimed to have found a JDK, check it to see if it seems to be valid. |
ohair@478 | 36 | if test "x$BOOT_JDK_FOUND" = xmaybe; then |
ohair@478 | 37 | # Do we have a bin/java? |
ohair@478 | 38 | if test ! -x "$BOOT_JDK/bin/java"; then |
ohair@478 | 39 | AC_MSG_NOTICE([Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring]) |
ohair@478 | 40 | BOOT_JDK_FOUND=no |
ohair@478 | 41 | else |
ohair@478 | 42 | # Do we have a bin/javac? |
ohair@478 | 43 | if test ! -x "$BOOT_JDK/bin/javac"; then |
ohair@478 | 44 | AC_MSG_NOTICE([Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring]) |
ohair@478 | 45 | AC_MSG_NOTICE([(This might be an JRE instead of an JDK)]) |
ohair@478 | 46 | BOOT_JDK_FOUND=no |
ihse@839 | 47 | else |
ohair@478 | 48 | # Do we have an rt.jar? (On MacOSX it is called classes.jar) |
ohair@478 | 49 | if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then |
ohair@478 | 50 | AC_MSG_NOTICE([Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring]) |
ohair@478 | 51 | BOOT_JDK_FOUND=no |
ohair@478 | 52 | else |
ohair@478 | 53 | # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version? |
ohair@478 | 54 | BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1` |
ohair@478 | 55 | |
ohair@478 | 56 | # Extra M4 quote needed to protect [] in grep expression. |
ohair@478 | 57 | [FOUND_VERSION_78=`echo $BOOT_JDK_VERSION | grep '\"1\.[78]\.'`] |
ohair@478 | 58 | if test "x$FOUND_VERSION_78" = x; then |
ohair@478 | 59 | AC_MSG_NOTICE([Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring]) |
ohair@478 | 60 | AC_MSG_NOTICE([(Your Boot JDK must be version 7 or 8)]) |
ohair@478 | 61 | BOOT_JDK_FOUND=no |
ohair@478 | 62 | else |
ohair@478 | 63 | # We're done! :-) |
ohair@478 | 64 | BOOT_JDK_FOUND=yes |
ohair@494 | 65 | BASIC_FIXUP_PATH(BOOT_JDK) |
ohair@478 | 66 | AC_MSG_CHECKING([for Boot JDK]) |
ohair@494 | 67 | AC_MSG_RESULT([$BOOT_JDK]) |
ohair@494 | 68 | AC_MSG_CHECKING([Boot JDK version]) |
ohair@494 | 69 | BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` |
ohair@494 | 70 | AC_MSG_RESULT([$BOOT_JDK_VERSION]) |
ohair@478 | 71 | fi # end check jdk version |
ohair@478 | 72 | fi # end check rt.jar |
ohair@478 | 73 | fi # end check javac |
ohair@478 | 74 | fi # end check java |
ohair@478 | 75 | fi # end check boot jdk found |
ohair@478 | 76 | fi |
ohair@478 | 77 | ]) |
ohair@478 | 78 | |
ohair@478 | 79 | # Test: Is bootjdk explicitely set by command line arguments? |
ohair@478 | 80 | AC_DEFUN([BOOTJDK_CHECK_ARGUMENTS], |
ohair@478 | 81 | [ |
ihse@839 | 82 | if test "x$with_boot_jdk" != x; then |
ohair@478 | 83 | BOOT_JDK=$with_boot_jdk |
ohair@478 | 84 | BOOT_JDK_FOUND=maybe |
ohair@478 | 85 | AC_MSG_NOTICE([Found potential Boot JDK using configure arguments]) |
ihse@839 | 86 | fi |
ohair@478 | 87 | ]) |
ohair@478 | 88 | |
ohair@478 | 89 | # Test: Is bootjdk available from builddeps? |
ohair@478 | 90 | AC_DEFUN([BOOTJDK_CHECK_BUILDDEPS], |
ohair@478 | 91 | [ |
ihse@839 | 92 | BDEPS_CHECK_MODULE(BOOT_JDK, bootjdk, xxx, [BOOT_JDK_FOUND=maybe], [BOOT_JDK_FOUND=no]) |
ohair@478 | 93 | ]) |
ohair@478 | 94 | |
ohair@478 | 95 | # Test: Is $JAVA_HOME set? |
ohair@478 | 96 | AC_DEFUN([BOOTJDK_CHECK_JAVA_HOME], |
ohair@478 | 97 | [ |
ihse@839 | 98 | if test "x$JAVA_HOME" != x; then |
ihse@839 | 99 | JAVA_HOME_PROCESSED="$JAVA_HOME" |
ihse@839 | 100 | BASIC_FIXUP_PATH(JAVA_HOME_PROCESSED) |
ihse@839 | 101 | if test ! -d "$JAVA_HOME_PROCESSED"; then |
ihse@839 | 102 | AC_MSG_NOTICE([Your JAVA_HOME points to a non-existing directory!]) |
ihse@839 | 103 | else |
ihse@839 | 104 | # Aha, the user has set a JAVA_HOME |
ihse@839 | 105 | # let us use that as the Boot JDK. |
ihse@839 | 106 | BOOT_JDK="$JAVA_HOME_PROCESSED" |
ihse@839 | 107 | BOOT_JDK_FOUND=maybe |
ihse@839 | 108 | AC_MSG_NOTICE([Found potential Boot JDK using JAVA_HOME]) |
erikj@459 | 109 | fi |
ihse@839 | 110 | fi |
erikj@459 | 111 | ]) |
erikj@459 | 112 | |
ohair@478 | 113 | # Test: Is there a java or javac in the PATH, which is a symlink to the JDK? |
ohair@478 | 114 | AC_DEFUN([BOOTJDK_CHECK_JAVA_IN_PATH_IS_SYMLINK], |
erikj@459 | 115 | [ |
ihse@839 | 116 | AC_PATH_PROG(JAVAC_CHECK, javac) |
ihse@839 | 117 | AC_PATH_PROG(JAVA_CHECK, java) |
ihse@839 | 118 | BINARY="$JAVAC_CHECK" |
ihse@839 | 119 | if test "x$JAVAC_CHECK" = x; then |
ihse@839 | 120 | BINARY="$JAVA_CHECK" |
ihse@839 | 121 | fi |
ihse@839 | 122 | if test "x$BINARY" != x; then |
ihse@839 | 123 | # So there is a java(c) binary, it might be part of a JDK. |
ihse@839 | 124 | # Lets find the JDK/JRE directory by following symbolic links. |
ihse@839 | 125 | # Linux/GNU systems often have links from /usr/bin/java to |
ihse@839 | 126 | # /etc/alternatives/java to the real JDK binary. |
ihse@839 | 127 | BASIC_REMOVE_SYMBOLIC_LINKS(BINARY) |
ihse@839 | 128 | BOOT_JDK=`dirname "$BINARY"` |
ihse@839 | 129 | BOOT_JDK=`cd "$BOOT_JDK/.."; pwd` |
ihse@839 | 130 | if test -x "$BOOT_JDK/bin/javac" && test -x "$BOOT_JDK/bin/java"; then |
ihse@839 | 131 | # Looks like we found ourselves an JDK |
ihse@839 | 132 | BOOT_JDK_FOUND=maybe |
ihse@839 | 133 | AC_MSG_NOTICE([Found potential Boot JDK using java(c) in PATH]) |
ohair@478 | 134 | fi |
ihse@839 | 135 | fi |
ohair@478 | 136 | ]) |
ohair@478 | 137 | |
ohair@478 | 138 | # Test: Is there a /usr/libexec/java_home? (Typically on MacOSX) |
ohair@478 | 139 | AC_DEFUN([BOOTJDK_CHECK_LIBEXEC_JAVA_HOME], |
ohair@478 | 140 | [ |
ihse@839 | 141 | if test -x /usr/libexec/java_home; then |
ihse@839 | 142 | BOOT_JDK=`/usr/libexec/java_home` |
ihse@839 | 143 | BOOT_JDK_FOUND=maybe |
ihse@839 | 144 | AC_MSG_NOTICE([Found potential Boot JDK using /usr/libexec/java_home]) |
ihse@839 | 145 | fi |
ohair@478 | 146 | ]) |
ohair@478 | 147 | |
ohair@478 | 148 | # Look for a jdk in the given path. If there are multiple, try to select the newest. |
ohair@478 | 149 | # If found, set BOOT_JDK and BOOT_JDK_FOUND. |
ohair@478 | 150 | # $1 = Path to directory containing jdk installations. |
ohair@478 | 151 | # $2 = String to append to the found JDK directory to get the proper JDK home |
ohair@478 | 152 | AC_DEFUN([BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY], |
ohair@478 | 153 | [ |
ohair@478 | 154 | BOOT_JDK_PREFIX="$1" |
ohair@478 | 155 | BOOT_JDK_SUFFIX="$2" |
ohair@494 | 156 | ALL_JDKS_FOUND=`$LS "$BOOT_JDK_PREFIX" 2> /dev/null | $SORT -r` |
ohair@494 | 157 | if test "x$ALL_JDKS_FOUND" != x; then |
ohair@494 | 158 | for JDK_TO_TRY in $ALL_JDKS_FOUND ; do |
ohair@494 | 159 | BOOTJDK_DO_CHECK([ |
ohair@494 | 160 | BOOT_JDK="${BOOT_JDK_PREFIX}/${JDK_TO_TRY}${BOOT_JDK_SUFFIX}" |
ohair@494 | 161 | if test -d "$BOOT_JDK"; then |
ohair@494 | 162 | BOOT_JDK_FOUND=maybe |
ohair@494 | 163 | AC_MSG_NOTICE([Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)]) |
ohair@494 | 164 | fi |
ohair@494 | 165 | ]) |
ohair@494 | 166 | done |
ohair@478 | 167 | fi |
ohair@478 | 168 | ]) |
ohair@478 | 169 | |
ohair@478 | 170 | # Call BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY, but use the given |
ohair@478 | 171 | # environmental variable as base for where to look. |
ohair@478 | 172 | # $1 Name of an environmal variable, assumed to point to the Program Files directory. |
ohair@478 | 173 | AC_DEFUN([BOOTJDK_FIND_BEST_JDK_IN_WINDOWS_VIRTUAL_DIRECTORY], |
ohair@478 | 174 | [ |
ohair@478 | 175 | if test "x[$]$1" != x; then |
ohair@494 | 176 | VIRTUAL_DIR="[$]$1/Java" |
ohair@494 | 177 | BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(VIRTUAL_DIR) |
ohair@494 | 178 | BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY($VIRTUAL_DIR) |
ohair@478 | 179 | fi |
ohair@478 | 180 | ]) |
ohair@478 | 181 | |
ohair@478 | 182 | # Test: Is there a JDK installed in default, well-known locations? |
ohair@478 | 183 | AC_DEFUN([BOOTJDK_CHECK_WELL_KNOWN_LOCATIONS], |
ohair@478 | 184 | [ |
ohair@478 | 185 | if test "x$OPENJDK_TARGET_OS" = xwindows; then |
ohair@478 | 186 | BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_WINDOWS_VIRTUAL_DIRECTORY([ProgramW6432])]) |
ohair@478 | 187 | BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_WINDOWS_VIRTUAL_DIRECTORY([PROGRAMW6432])]) |
ohair@478 | 188 | BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_WINDOWS_VIRTUAL_DIRECTORY([PROGRAMFILES])]) |
ohair@478 | 189 | BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_WINDOWS_VIRTUAL_DIRECTORY([ProgramFiles])]) |
ohair@478 | 190 | BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY([/cygdrive/c/Program Files/Java])]) |
ohair@478 | 191 | elif test "x$OPENJDK_TARGET_OS" = xmacosx; then |
ohair@478 | 192 | BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY([/Library/Java/JavaVirtualMachines],[/Contents/Home])]) |
ohair@478 | 193 | BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY([/System/Library/Java/JavaVirtualMachines],[/Contents/Home])]) |
ohair@494 | 194 | elif test "x$OPENJDK_TARGET_OS" = xlinux; then |
ohair@494 | 195 | BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY([/usr/lib/jvm])]) |
ohair@478 | 196 | fi |
ohair@478 | 197 | ]) |
ohair@478 | 198 | |
ohair@478 | 199 | # Check that a command-line tool in the Boot JDK is correct |
ohair@478 | 200 | # $1 = name of variable to assign |
ohair@478 | 201 | # $2 = name of binary |
ohair@478 | 202 | AC_DEFUN([BOOTJDK_CHECK_TOOL_IN_BOOTJDK], |
ohair@478 | 203 | [ |
ohair@478 | 204 | AC_MSG_CHECKING([for $2 in Boot JDK]) |
ohair@478 | 205 | $1=$BOOT_JDK/bin/$2 |
ohair@478 | 206 | if test ! -x [$]$1; then |
ihse@839 | 207 | AC_MSG_RESULT(not found) |
ihse@839 | 208 | AC_MSG_NOTICE([Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk]) |
ihse@839 | 209 | AC_MSG_ERROR([Could not find $2 in the Boot JDK]) |
ohair@478 | 210 | fi |
ohair@478 | 211 | AC_MSG_RESULT(ok) |
erikj@459 | 212 | ]) |
erikj@459 | 213 | |
erikj@459 | 214 | ############################################################################### |
erikj@459 | 215 | # |
ihse@839 | 216 | # We need a Boot JDK to bootstrap the build. |
erikj@459 | 217 | # |
erikj@459 | 218 | |
erikj@459 | 219 | AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK], |
erikj@459 | 220 | [ |
ihse@839 | 221 | BOOT_JDK_FOUND=no |
ihse@839 | 222 | AC_ARG_WITH(boot-jdk, [AS_HELP_STRING([--with-boot-jdk], |
ihse@839 | 223 | [path to Boot JDK (used to bootstrap build) @<:@probed@:>@])]) |
ohair@478 | 224 | |
ihse@839 | 225 | # We look for the Boot JDK through various means, going from more certain to |
ihse@839 | 226 | # more of a guess-work. After each test, BOOT_JDK_FOUND is set to "yes" if |
ihse@839 | 227 | # we detected something (if so, the path to the jdk is in BOOT_JDK). But we |
ihse@839 | 228 | # must check if this is indeed valid; otherwise we'll continue looking. |
ohair@478 | 229 | |
ihse@839 | 230 | # Test: Is bootjdk explicitely set by command line arguments? |
ihse@839 | 231 | BOOTJDK_DO_CHECK([BOOTJDK_CHECK_ARGUMENTS]) |
ihse@839 | 232 | if test "x$with_boot_jdk" != x && test "x$BOOT_JDK_FOUND" = xno; then |
ihse@839 | 233 | # Having specified an argument which is incorrect will produce an instant failure; |
ihse@839 | 234 | # we should not go on looking |
ihse@839 | 235 | AC_MSG_ERROR([The path given by --with-boot-jdk does not contain a valid Boot JDK]) |
ihse@839 | 236 | fi |
erikj@459 | 237 | |
ihse@839 | 238 | # Test: Is bootjdk available from builddeps? |
ihse@839 | 239 | BOOTJDK_DO_CHECK([BOOTJDK_CHECK_BUILDDEPS]) |
ohair@478 | 240 | |
ihse@839 | 241 | # Test: Is $JAVA_HOME set? |
ihse@839 | 242 | BOOTJDK_DO_CHECK([BOOTJDK_CHECK_JAVA_HOME]) |
ohair@478 | 243 | |
ihse@839 | 244 | # Test: Is there a /usr/libexec/java_home? (Typically on MacOSX) |
ihse@839 | 245 | BOOTJDK_DO_CHECK([BOOTJDK_CHECK_LIBEXEC_JAVA_HOME]) |
ohair@478 | 246 | |
ihse@839 | 247 | # Test: Is there a java or javac in the PATH, which is a symlink to the JDK? |
ihse@839 | 248 | BOOTJDK_DO_CHECK([BOOTJDK_CHECK_JAVA_IN_PATH_IS_SYMLINK]) |
ohair@478 | 249 | |
ihse@839 | 250 | # Test: Is there a JDK installed in default, well-known locations? |
ihse@839 | 251 | BOOTJDK_DO_CHECK([BOOTJDK_CHECK_WELL_KNOWN_LOCATIONS]) |
ohair@478 | 252 | |
ihse@839 | 253 | # If we haven't found anything yet, we've truly lost. Give up. |
ihse@839 | 254 | if test "x$BOOT_JDK_FOUND" = xno; then |
ihse@839 | 255 | HELP_MSG_MISSING_DEPENDENCY([openjdk]) |
ihse@839 | 256 | AC_MSG_NOTICE([Could not find a valid Boot JDK. $HELP_MSG]) |
ihse@839 | 257 | AC_MSG_NOTICE([This might be fixed by explicitely setting --with-boot-jdk]) |
ihse@839 | 258 | AC_MSG_ERROR([Cannot continue]) |
ihse@839 | 259 | fi |
ohair@478 | 260 | |
ihse@839 | 261 | # Setup proper paths for what we found |
ihse@839 | 262 | BOOT_RTJAR="$BOOT_JDK/jre/lib/rt.jar" |
ihse@839 | 263 | if test ! -f "$BOOT_RTJAR"; then |
ohair@478 | 264 | # On MacOSX it is called classes.jar |
ohair@478 | 265 | BOOT_RTJAR="$BOOT_JDK/../Classes/classes.jar" |
ohair@478 | 266 | if test -f "$BOOT_RTJAR"; then |
ihse@839 | 267 | # Remove the .. |
ohair@478 | 268 | BOOT_RTJAR="`cd ${BOOT_RTJAR%/*} && pwd`/${BOOT_RTJAR##*/}" |
erikj@459 | 269 | fi |
ihse@839 | 270 | fi |
ihse@839 | 271 | BOOT_TOOLSJAR="$BOOT_JDK/lib/tools.jar" |
ihse@839 | 272 | BOOT_JDK="$BOOT_JDK" |
ihse@839 | 273 | AC_SUBST(BOOT_RTJAR) |
ihse@839 | 274 | AC_SUBST(BOOT_TOOLSJAR) |
ihse@839 | 275 | AC_SUBST(BOOT_JDK) |
erikj@459 | 276 | |
ihse@839 | 277 | # Setup tools from the Boot JDK. |
ihse@839 | 278 | BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVA,java) |
ihse@839 | 279 | BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVAC,javac) |
ihse@839 | 280 | BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVAH,javah) |
ihse@839 | 281 | BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVAP,javap) |
ihse@839 | 282 | BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAR,jar) |
ihse@839 | 283 | BOOTJDK_CHECK_TOOL_IN_BOOTJDK(RMIC,rmic) |
ihse@839 | 284 | BOOTJDK_CHECK_TOOL_IN_BOOTJDK(NATIVE2ASCII,native2ascii) |
erikj@459 | 285 | |
ihse@839 | 286 | # Finally, set some other options... |
erikj@459 | 287 | |
ihse@839 | 288 | # When compiling code to be executed by the Boot JDK, force jdk7 compatibility. |
ihse@839 | 289 | BOOT_JDK_SOURCETARGET="-source 7 -target 7" |
ihse@839 | 290 | AC_SUBST(BOOT_JDK_SOURCETARGET) |
ihse@839 | 291 | AC_SUBST(JAVAC_FLAGS) |
erikj@1580 | 292 | |
erikj@1580 | 293 | # Check if the boot jdk is 32 or 64 bit |
erikj@1580 | 294 | if "$JAVA" -d64 -version > /dev/null 2>&1; then |
erikj@1580 | 295 | BOOT_JDK_BITS="64" |
erikj@1580 | 296 | else |
erikj@1580 | 297 | BOOT_JDK_BITS="32" |
erikj@1580 | 298 | fi |
erikj@1580 | 299 | AC_MSG_CHECKING([if Boot JDK is 32 or 64 bits]) |
erikj@1580 | 300 | AC_MSG_RESULT([$BOOT_JDK_BITS]) |
erikj@1580 | 301 | AC_SUBST(BOOT_JDK_BITS) |
erikj@459 | 302 | ]) |
erikj@459 | 303 | |
erikj@459 | 304 | AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS], |
erikj@459 | 305 | [ |
ihse@839 | 306 | ############################################################################## |
ihse@839 | 307 | # |
ihse@839 | 308 | # Specify options for anything that is run with the Boot JDK. |
ihse@839 | 309 | # |
ihse@839 | 310 | AC_ARG_WITH(boot-jdk-jvmargs, [AS_HELP_STRING([--with-boot-jdk-jvmargs], |
ihse@839 | 311 | [specify JVM arguments to be passed to all invocations of the Boot JDK, overriding the default values, |
ihse@839 | 312 | e.g --with-boot-jdk-jvmargs="-Xmx8G -enableassertions"])]) |
erikj@459 | 313 | |
erikj@1187 | 314 | AC_MSG_CHECKING([flags for boot jdk java command] ) |
erikj@459 | 315 | |
erikj@1187 | 316 | # Disable special log output when a debug build is used as Boot JDK... |
erikj@1187 | 317 | ADD_JVM_ARG_IF_OK([-XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput],boot_jdk_jvmargs,[$JAVA]) |
erikj@1187 | 318 | |
erikj@1187 | 319 | # Apply user provided options. |
erikj@1187 | 320 | ADD_JVM_ARG_IF_OK([$with_boot_jdk_jvmargs],boot_jdk_jvmargs,[$JAVA]) |
erikj@1187 | 321 | |
erikj@1187 | 322 | AC_MSG_RESULT([$boot_jdk_jvmargs]) |
erikj@1187 | 323 | |
erikj@1187 | 324 | # For now, general JAVA_FLAGS are the same as the boot jdk jvmargs |
erikj@1187 | 325 | JAVA_FLAGS=$boot_jdk_jvmargs |
erikj@1187 | 326 | AC_SUBST(JAVA_FLAGS) |
erikj@1187 | 327 | |
erikj@1187 | 328 | |
erikj@1187 | 329 | AC_MSG_CHECKING([flags for boot jdk java command for big workloads]) |
erikj@1187 | 330 | |
erikj@1187 | 331 | # Starting amount of heap memory. |
erikj@1187 | 332 | ADD_JVM_ARG_IF_OK([-Xms64M],boot_jdk_jvmargs_big,[$JAVA]) |
erikj@1187 | 333 | |
erikj@1187 | 334 | # Maximum amount of heap memory. |
erikj@1187 | 335 | # Maximum stack size. |
erikj@1580 | 336 | if test "x$BOOT_JDK_BITS" = x32; then |
sgehwolf@2222 | 337 | JVM_MAX_HEAP=768M |
erikj@1187 | 338 | STACK_SIZE=768 |
erikj@1187 | 339 | else |
erikj@1187 | 340 | # Running Javac on a JVM on a 64-bit machine, takes more space since 64-bit |
erikj@1187 | 341 | # pointers are used. Apparently, we need to increase the heap and stack |
erikj@1187 | 342 | # space for the jvm. More specifically, when running javac to build huge |
erikj@1187 | 343 | # jdk batch |
erikj@1187 | 344 | JVM_MAX_HEAP=1600M |
erikj@1187 | 345 | STACK_SIZE=1536 |
ihse@839 | 346 | fi |
erikj@1187 | 347 | ADD_JVM_ARG_IF_OK([-Xmx$JVM_MAX_HEAP],boot_jdk_jvmargs_big,[$JAVA]) |
erikj@1187 | 348 | ADD_JVM_ARG_IF_OK([-XX:ThreadStackSize=$STACK_SIZE],boot_jdk_jvmargs_big,[$JAVA]) |
erikj@1187 | 349 | ADD_JVM_ARG_IF_OK([-XX:PermSize=32m],boot_jdk_jvmargs_big,[$JAVA]) |
erikj@1187 | 350 | ADD_JVM_ARG_IF_OK([-XX:MaxPermSize=160m],boot_jdk_jvmargs_big,[$JAVA]) |
erikj@459 | 351 | |
erikj@1187 | 352 | AC_MSG_RESULT([$boot_jdk_jvmargs_big]) |
erikj@1187 | 353 | |
erikj@1187 | 354 | JAVA_FLAGS_BIG=$boot_jdk_jvmargs_big |
erikj@1187 | 355 | AC_SUBST(JAVA_FLAGS_BIG) |
erikj@1187 | 356 | |
erikj@1187 | 357 | |
erikj@1187 | 358 | AC_MSG_CHECKING([flags for boot jdk java command for small workloads]) |
erikj@1187 | 359 | |
erikj@1187 | 360 | # Use serial gc for small short lived tools if possible |
erikj@1187 | 361 | ADD_JVM_ARG_IF_OK([-XX:+UseSerialGC],boot_jdk_jvmargs_small,[$JAVA]) |
erikj@1187 | 362 | ADD_JVM_ARG_IF_OK([-Xms32M],boot_jdk_jvmargs_small,[$JAVA]) |
erikj@1187 | 363 | ADD_JVM_ARG_IF_OK([-Xmx512M],boot_jdk_jvmargs_small,[$JAVA]) |
erikj@1187 | 364 | |
erikj@1187 | 365 | AC_MSG_RESULT([$boot_jdk_jvmargs_small]) |
erikj@1187 | 366 | |
erikj@1187 | 367 | JAVA_FLAGS_SMALL=$boot_jdk_jvmargs_small |
erikj@1187 | 368 | AC_SUBST(JAVA_FLAGS_SMALL) |
erikj@459 | 369 | ]) |