common/autoconf/boot-jdk.m4
author ohair
Tue, 18 Sep 2012 11:29:16 -0700
changeset 13697 5262b00bc10c
parent 13133 701e61c32ece
child 14111 2a82ecb35fc7
permissions -rw-r--r--
7197849: Update new build-infra makefiles Reviewed-by: ihse, erikj, ohrstrom, tbell
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
     1
#
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
     2
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
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
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    26
# Execute the check given as argument, and verify the result
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    27
# If the Boot JDK was previously found, do nothing
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    28
# $1 A command line (typically autoconf macro) to execute
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    29
AC_DEFUN([BOOTJDK_DO_CHECK],
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    30
[
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    31
  if test "x$BOOT_JDK_FOUND" = xno; then
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    32
    # Now execute the test
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    33
    $1
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    34
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    35
    # If previous step claimed to have found a JDK, check it to see if it seems to be valid.
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    36
    if test "x$BOOT_JDK_FOUND" = xmaybe; then
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    37
      # Do we have a bin/java?
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    38
      if test ! -x "$BOOT_JDK/bin/java"; then
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    39
        AC_MSG_NOTICE([Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    40
        BOOT_JDK_FOUND=no
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    41
      else
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    42
        # Do we have a bin/javac?
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    43
        if test ! -x "$BOOT_JDK/bin/javac"; then
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    44
          AC_MSG_NOTICE([Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    45
          AC_MSG_NOTICE([(This might be an JRE instead of an JDK)])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    46
          BOOT_JDK_FOUND=no
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    47
        else 
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    48
          # Do we have an rt.jar? (On MacOSX it is called classes.jar)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    49
          if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    50
            AC_MSG_NOTICE([Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    51
            BOOT_JDK_FOUND=no
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    52
          else
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    53
            # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    54
            BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    55
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    56
            # Extra M4 quote needed to protect [] in grep expression.
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    57
            [FOUND_VERSION_78=`echo $BOOT_JDK_VERSION | grep  '\"1\.[78]\.'`]
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    58
            if test "x$FOUND_VERSION_78" = x; then
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    59
              AC_MSG_NOTICE([Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    60
              AC_MSG_NOTICE([(Your Boot JDK must be version 7 or 8)])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    61
              BOOT_JDK_FOUND=no
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    62
            else
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    63
              # We're done! :-)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    64
              BOOT_JDK_FOUND=yes
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    65
              SPACESAFE(BOOT_JDK,[the path to the Boot JDK])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    66
              AC_MSG_CHECKING([for Boot JDK])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    67
              AC_MSG_RESULT([$BOOT_JDK ($BOOT_JDK_VERSION)])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    68
            fi # end check jdk version
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    69
          fi # end check rt.jar
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    70
        fi # end check javac
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    71
      fi # end check java
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    72
    fi # end check boot jdk found
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    73
  fi
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    74
])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    75
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    76
# Test: Is bootjdk explicitely set by command line arguments?
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    77
AC_DEFUN([BOOTJDK_CHECK_ARGUMENTS],
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    78
[
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    79
if test "x$with_boot_jdk" != x; then
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    80
    BOOT_JDK=$with_boot_jdk
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    81
    BOOT_JDK_FOUND=maybe
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    82
    AC_MSG_NOTICE([Found potential Boot JDK using configure arguments])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    83
fi
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    84
])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    85
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    86
# Test: Is bootjdk available from builddeps?
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    87
AC_DEFUN([BOOTJDK_CHECK_BUILDDEPS],
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    88
[
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    89
    BDEPS_CHECK_MODULE(BOOT_JDK, bootjdk, xxx, [BOOT_JDK_FOUND=maybe], [BOOT_JDK_FOUND=no])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    90
])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    91
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    92
# Test: Is $JAVA_HOME set?
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    93
AC_DEFUN([BOOTJDK_CHECK_JAVA_HOME],
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    94
[
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    95
    if test "x$JAVA_HOME" != x; then
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    96
        if test "x$OPENJDK_TARGET_OS" = xwindows; then
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    97
          # On Windows, JAVA_HOME is likely in DOS-style
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    98
          JAVA_HOME_PROCESSED="`$CYGPATH -u "$JAVA_HOME"`"
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    99
        else
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   100
          JAVA_HOME_PROCESSED="$JAVA_HOME"
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   101
        fi
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   102
        if test ! -d "$JAVA_HOME_PROCESSED"; then
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   103
            AC_MSG_NOTICE([Your JAVA_HOME points to a non-existing directory!])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   104
        else
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   105
          # Aha, the user has set a JAVA_HOME
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   106
          # let us use that as the Boot JDK.
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   107
          BOOT_JDK="$JAVA_HOME_PROCESSED"
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   108
          BOOT_JDK_FOUND=maybe
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   109
          AC_MSG_NOTICE([Found potential Boot JDK using JAVA_HOME])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   110
        fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   111
    fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   112
])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   113
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   114
# Test: Is there a java or javac in the PATH, which is a symlink to the JDK?
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   115
AC_DEFUN([BOOTJDK_CHECK_JAVA_IN_PATH_IS_SYMLINK],
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   116
[
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   117
    AC_PATH_PROG(JAVAC_CHECK, javac)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   118
    AC_PATH_PROG(JAVA_CHECK, java)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   119
    BINARY="$JAVAC_CHECK"
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   120
    if test "x$JAVAC_CHECK" = x; then
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   121
        BINARY="$JAVA_CHECK"
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   122
    fi
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   123
    if test "x$BINARY" != x; then
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   124
        # So there is a java(c) binary, it might be part of a JDK.
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   125
        # Lets find the JDK/JRE directory by following symbolic links.
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   126
        # Linux/GNU systems often have links from /usr/bin/java to 
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   127
        # /etc/alternatives/java to the real JDK binary.
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   128
        SET_FULL_PATH_SPACESAFE(BINARY)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   129
        REMOVE_SYMBOLIC_LINKS(BINARY)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   130
        BOOT_JDK=`dirname "$BINARY"`
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   131
        BOOT_JDK=`cd "$BOOT_JDK/.."; pwd`
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   132
        if test -x "$BOOT_JDK/bin/javac" && test -x "$BOOT_JDK/bin/java"; then
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   133
            # Looks like we found ourselves an JDK
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   134
            BOOT_JDK_FOUND=maybe
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   135
            AC_MSG_NOTICE([Found potential Boot JDK using java(c) in PATH])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   136
        fi
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   137
    fi
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   138
])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   139
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   140
# Test: Is there a /usr/libexec/java_home? (Typically on MacOSX)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   141
AC_DEFUN([BOOTJDK_CHECK_LIBEXEC_JAVA_HOME],
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   142
[
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   143
    if test -x /usr/libexec/java_home; then
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   144
        BOOT_JDK=`/usr/libexec/java_home`
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   145
        BOOT_JDK_FOUND=maybe
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   146
        AC_MSG_NOTICE([Found potential Boot JDK using /usr/libexec/java_home])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   147
    fi
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   148
])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   149
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   150
# Look for a jdk in the given path. If there are multiple, try to select the newest.
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   151
# If found, set BOOT_JDK and BOOT_JDK_FOUND.
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   152
# $1 = Path to directory containing jdk installations.
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   153
# $2 = String to append to the found JDK directory to get the proper JDK home
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   154
AC_DEFUN([BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY],
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   155
[
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   156
  BOOT_JDK_PREFIX="$1"
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   157
  BOOT_JDK_SUFFIX="$2"
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   158
  BEST_JDK_FOUND=`$LS "$BOOT_JDK_PREFIX" 2> /dev/null | $GREP jdk | $SORT -r | $HEAD -n 1 `
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   159
  if test "x$BEST_JDK_FOUND" != x; then
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   160
    BOOT_JDK="${BOOT_JDK_PREFIX}/${BEST_JDK_FOUND}${BOOT_JDK_SUFFIX}"
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   161
    if test -d "$BOOT_JDK"; then
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   162
      BOOT_JDK_FOUND=maybe
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   163
      AC_MSG_NOTICE([Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX)])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   164
    fi
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   165
  fi
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   166
])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   167
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   168
# Call BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY, but use the given
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   169
# environmental variable as base for where to look.
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   170
# $1 Name of an environmal variable, assumed to point to the Program Files directory.
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   171
AC_DEFUN([BOOTJDK_FIND_BEST_JDK_IN_WINDOWS_VIRTUAL_DIRECTORY],
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   172
[
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   173
  if test "x[$]$1" != x; then
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   174
    BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY([`$CYGPATH -u "[$]$1"`/Java])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   175
  fi
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   176
])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   177
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   178
# Test: Is there a JDK installed in default, well-known locations?
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   179
AC_DEFUN([BOOTJDK_CHECK_WELL_KNOWN_LOCATIONS],
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   180
[
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   181
  if test "x$OPENJDK_TARGET_OS" = xwindows; then
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   182
    BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_WINDOWS_VIRTUAL_DIRECTORY([ProgramW6432])])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   183
    BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_WINDOWS_VIRTUAL_DIRECTORY([PROGRAMW6432])])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   184
    BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_WINDOWS_VIRTUAL_DIRECTORY([PROGRAMFILES])])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   185
    BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_WINDOWS_VIRTUAL_DIRECTORY([ProgramFiles])])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   186
    BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY([/cygdrive/c/Program Files/Java])])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   187
  elif test "x$OPENJDK_TARGET_OS" = xmacosx; then
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   188
    BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY([/Library/Java/JavaVirtualMachines],[/Contents/Home])])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   189
    BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY([/System/Library/Java/JavaVirtualMachines],[/Contents/Home])])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   190
  fi
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   191
])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   192
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   193
# Check that a command-line tool in the Boot JDK is correct
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   194
# $1 = name of variable to assign
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   195
# $2 = name of binary
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   196
AC_DEFUN([BOOTJDK_CHECK_TOOL_IN_BOOTJDK],
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   197
[
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   198
  AC_MSG_CHECKING([for $2 in Boot JDK])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   199
  $1=$BOOT_JDK/bin/$2
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   200
  if test ! -x [$]$1; then
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   201
      AC_MSG_RESULT(not found)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   202
      AC_MSG_NOTICE([Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   203
      AC_MSG_ERROR([Could not find $2 in the Boot JDK])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   204
  fi
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   205
  AC_MSG_RESULT(ok)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   206
])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   207
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   208
###############################################################################
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   209
#
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   210
# We need a Boot JDK to bootstrap the build. 
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   211
#
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   212
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   213
AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK],
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   214
[
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   215
BOOT_JDK_FOUND=no
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   216
AC_ARG_WITH(boot-jdk, [AS_HELP_STRING([--with-boot-jdk],
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   217
    [path to Boot JDK (used to bootstrap build) @<:@probed@:>@])])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   218
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   219
# We look for the Boot JDK through various means, going from more certain to
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   220
# more of a guess-work. After each test, BOOT_JDK_FOUND is set to "yes" if
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   221
# we detected something (if so, the path to the jdk is in BOOT_JDK). But we 
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   222
# 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
   223
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   224
# Test: Is bootjdk explicitely set by command line arguments?
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   225
BOOTJDK_DO_CHECK([BOOTJDK_CHECK_ARGUMENTS])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   226
if test "x$with_boot_jdk" != x && test "x$BOOT_JDK_FOUND" = xno; then
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   227
  # Having specified an argument which is incorrect will produce an instant failure;
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   228
  # we should not go on looking
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   229
  AC_MSG_ERROR([The path given by --with-boot-jdk does not contain a valid Boot JDK])
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   230
fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   231
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   232
# Test: Is bootjdk available from builddeps?
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   233
BOOTJDK_DO_CHECK([BOOTJDK_CHECK_BUILDDEPS])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   234
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   235
# Test: Is $JAVA_HOME set?
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   236
BOOTJDK_DO_CHECK([BOOTJDK_CHECK_JAVA_HOME])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   237
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   238
# Test: Is there a /usr/libexec/java_home? (Typically on MacOSX)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   239
BOOTJDK_DO_CHECK([BOOTJDK_CHECK_LIBEXEC_JAVA_HOME])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   240
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   241
# Test: Is there a java or javac in the PATH, which is a symlink to the JDK?
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   242
BOOTJDK_DO_CHECK([BOOTJDK_CHECK_JAVA_IN_PATH_IS_SYMLINK])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   243
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   244
# Test: Is there a JDK installed in default, well-known locations?
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   245
BOOTJDK_DO_CHECK([BOOTJDK_CHECK_WELL_KNOWN_LOCATIONS])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   246
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   247
# If we haven't found anything yet, we've truly lost. Give up.
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   248
if test "x$BOOT_JDK_FOUND" = xno; then
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   249
  HELP_MSG_MISSING_DEPENDENCY([openjdk])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   250
  AC_MSG_NOTICE([Could not find a valid Boot JDK. $HELP_MSG])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   251
  AC_MSG_NOTICE([This might be fixed by explicitely setting --with-boot-jdk])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   252
  AC_MSG_ERROR([Cannot continue])
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   253
fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   254
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   255
# Setup proper paths for what we found
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   256
BOOT_RTJAR="$BOOT_JDK/jre/lib/rt.jar"
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   257
if test ! -f "$BOOT_RTJAR"; then
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   258
    # On MacOSX it is called classes.jar
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   259
    BOOT_RTJAR="$BOOT_JDK/../Classes/classes.jar"
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   260
    if test -f "$BOOT_RTJAR"; then
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   261
      # Remove the .. 
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   262
      BOOT_RTJAR="`cd ${BOOT_RTJAR%/*} && pwd`/${BOOT_RTJAR##*/}"
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   263
    fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   264
fi
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   265
BOOT_TOOLSJAR="$BOOT_JDK/lib/tools.jar"
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   266
BOOT_JDK="$BOOT_JDK"
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   267
AC_SUBST(BOOT_RTJAR)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   268
AC_SUBST(BOOT_TOOLSJAR)
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   269
AC_SUBST(BOOT_JDK)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   270
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   271
# Setup tools from the Boot JDK.
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   272
BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVA,java)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   273
BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVAC,javac)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   274
BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVAH,javah)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   275
BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVAP,javap)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   276
BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAR,jar)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   277
BOOTJDK_CHECK_TOOL_IN_BOOTJDK(RMIC,rmic)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   278
BOOTJDK_CHECK_TOOL_IN_BOOTJDK(NATIVE2ASCII,native2ascii)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   279
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   280
# Finally, set some other options...
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   281
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   282
# When compiling code to be executed by the Boot JDK, force jdk7 compatibility.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   283
BOOT_JDK_SOURCETARGET="-source 7 -target 7"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   284
AC_SUBST(BOOT_JDK_SOURCETARGET)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   285
AC_SUBST(JAVAC_FLAGS)
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
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   288
AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS],
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
#
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   292
# Specify options for anything that is run with the Boot JDK.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   293
#
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   294
AC_ARG_WITH(boot-jdk-jvmargs, [AS_HELP_STRING([--with-boot-jdk-jvmargs],
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   295
	[specify JVM arguments to be passed to all invocations of the Boot JDK, overriding the default values,
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   296
     e.g --with-boot-jdk-jvmargs="-Xmx8G -enableassertions"])])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   297
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   298
if test "x$with_boot_jdk_jvmargs" = x; then
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   299
    # Not all JVM:s accept the same arguments on the command line.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   300
    # OpenJDK specific increase in thread stack for JDK build,
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   301
    # well more specifically, when running javac.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   302
    if test "x$BUILD_NUM_BITS" = x32; then
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   303
       STACK_SIZE=768
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   304
    else
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   305
       # Running Javac on a JVM on a 64-bit machine, the stack takes more space
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   306
       # since 64-bit pointers are pushed on the stach. Apparently, we need
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   307
       # to increase the stack space when javacing the JDK....
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   308
       STACK_SIZE=1536
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   309
    fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   310
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   311
    # Minimum amount of heap memory.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   312
    ADD_JVM_ARG_IF_OK([-Xms64M],boot_jdk_jvmargs,[$JAVA])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   313
    if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   314
        # Why does macosx need more heap? Its the huge JDK batch.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   315
        ADD_JVM_ARG_IF_OK([-Xmx1600M],boot_jdk_jvmargs,[$JAVA])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   316
    else
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   317
        ADD_JVM_ARG_IF_OK([-Xmx1100M],boot_jdk_jvmargs,[$JAVA])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   318
    fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   319
    # When is adding -client something that speeds up the JVM?
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   320
    # ADD_JVM_ARG_IF_OK([-client],boot_jdk_jvmargs,[$JAVA])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   321
    ADD_JVM_ARG_IF_OK([-XX:PermSize=32m],boot_jdk_jvmargs,[$JAVA])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   322
    ADD_JVM_ARG_IF_OK([-XX:MaxPermSize=160m],boot_jdk_jvmargs,[$JAVA])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   323
    ADD_JVM_ARG_IF_OK([-XX:ThreadStackSize=$STACK_SIZE],boot_jdk_jvmargs,[$JAVA])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   324
    # Disable special log output when a debug build is used as Boot JDK...
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   325
    ADD_JVM_ARG_IF_OK([-XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput],boot_jdk_jvmargs,[$JAVA])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   326
fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   327
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   328
AC_SUBST(BOOT_JDK_JVMARGS, $boot_jdk_jvmargs)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   329
])