hotspot/make/build.sh
author yan
Mon, 12 May 2014 14:12:33 +0400
changeset 24367 705490680527
parent 16630 3dea566541da
child 30211 442fbbb31f75
permissions -rw-r--r--
8030709: Tidy warnings cleanup for java.lang package; minor cleanup in java.math, javax.script Reviewed-by: lancea Contributed-by: Alexander Stepanov <alexander.v.stepanov@oracle.com>
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
#! /bin/sh
489c9b5090e2 Initial load
duke
parents:
diff changeset
     2
#
16630
3dea566541da 8011198: LP64 setting is not preserved on Solaris after 8006965
kvn
parents: 5547
diff changeset
     3
# Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
# This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
# under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
# published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
# This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
# version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
# accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
# You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
# 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    19
#
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 670
diff changeset
    20
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 670
diff changeset
    21
# or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 670
diff changeset
    22
# questions.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
#  
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
    25
489c9b5090e2 Initial load
duke
parents:
diff changeset
    26
# Make sure the variable JAVA_HOME is set before running this script.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    27
489c9b5090e2 Initial load
duke
parents:
diff changeset
    28
set -u
489c9b5090e2 Initial load
duke
parents:
diff changeset
    29
489c9b5090e2 Initial load
duke
parents:
diff changeset
    30
16630
3dea566541da 8011198: LP64 setting is not preserved on Solaris after 8006965
kvn
parents: 5547
diff changeset
    31
if [ $# -lt 1 ]; then 
3dea566541da 8011198: LP64 setting is not preserved on Solaris after 8006965
kvn
parents: 5547
diff changeset
    32
    echo "Usage : $0 BuildTarget [LP64=1] [BuildOptions]"
3dea566541da 8011198: LP64 setting is not preserved on Solaris after 8006965
kvn
parents: 5547
diff changeset
    33
    echo "               Server VM | Client VM"
3dea566541da 8011198: LP64 setting is not preserved on Solaris after 8006965
kvn
parents: 5547
diff changeset
    34
    echo "BuildTarget :  debug     | debug1"
3dea566541da 8011198: LP64 setting is not preserved on Solaris after 8006965
kvn
parents: 5547
diff changeset
    35
    echo "               fastdebug | fastdebug1"
3dea566541da 8011198: LP64 setting is not preserved on Solaris after 8006965
kvn
parents: 5547
diff changeset
    36
    echo "               jvmg      | jvmg1"
3dea566541da 8011198: LP64 setting is not preserved on Solaris after 8006965
kvn
parents: 5547
diff changeset
    37
    echo "               optimized | optimized1"
3dea566541da 8011198: LP64 setting is not preserved on Solaris after 8006965
kvn
parents: 5547
diff changeset
    38
    echo "               profiled  | profiled1"
3dea566541da 8011198: LP64 setting is not preserved on Solaris after 8006965
kvn
parents: 5547
diff changeset
    39
    echo "               product   | product1"
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
    exit 1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
fi
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
16630
3dea566541da 8011198: LP64 setting is not preserved on Solaris after 8006965
kvn
parents: 5547
diff changeset
    43
if [ "${JAVA_HOME-}" = ""  -o  ! -d "${JAVA_HOME-}" -o ! -d ${JAVA_HOME-}/jre/lib/ ]; then
3dea566541da 8011198: LP64 setting is not preserved on Solaris after 8006965
kvn
parents: 5547
diff changeset
    44
    echo "JAVA_HOME needs to be set to a valid JDK path"
3dea566541da 8011198: LP64 setting is not preserved on Solaris after 8006965
kvn
parents: 5547
diff changeset
    45
    echo "JAVA_HOME: ${JAVA_HOME-}"
3dea566541da 8011198: LP64 setting is not preserved on Solaris after 8006965
kvn
parents: 5547
diff changeset
    46
    exit 1
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
fi
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
# Just in case:
16630
3dea566541da 8011198: LP64 setting is not preserved on Solaris after 8006965
kvn
parents: 5547
diff changeset
    50
JAVA_HOME=`( cd $JAVA_HOME; pwd )`
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
16630
3dea566541da 8011198: LP64 setting is not preserved on Solaris after 8006965
kvn
parents: 5547
diff changeset
    52
if [ "${ALT_BOOTDIR-}" = ""  -o  ! -d "${ALT_BOOTDIR-}" -o ! -d ${ALT_BOOTDIR-}/jre/lib/ ]; then
3dea566541da 8011198: LP64 setting is not preserved on Solaris after 8006965
kvn
parents: 5547
diff changeset
    53
    ALT_BOOTDIR=${JAVA_HOME}
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
fi
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
16630
3dea566541da 8011198: LP64 setting is not preserved on Solaris after 8006965
kvn
parents: 5547
diff changeset
    56
# build in current directory by default
3dea566541da 8011198: LP64 setting is not preserved on Solaris after 8006965
kvn
parents: 5547
diff changeset
    57
if [ "${ALT_OUTPUTDIR-}" = ""  -o  ! -d "${ALT_OUTPUTDIR-}" ]; then
3dea566541da 8011198: LP64 setting is not preserved on Solaris after 8006965
kvn
parents: 5547
diff changeset
    58
    ALT_OUTPUTDIR=`(pwd)`
3dea566541da 8011198: LP64 setting is not preserved on Solaris after 8006965
kvn
parents: 5547
diff changeset
    59
fi
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
16630
3dea566541da 8011198: LP64 setting is not preserved on Solaris after 8006965
kvn
parents: 5547
diff changeset
    61
HOTSPOT_SRC=`(dirname $0)`/..
3dea566541da 8011198: LP64 setting is not preserved on Solaris after 8006965
kvn
parents: 5547
diff changeset
    62
HOTSPOT_SRC=`(cd ${HOTSPOT_SRC}; pwd)`
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
for gm in gmake gnumake
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
do
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
  if [ "${GNUMAKE-}" != "" ]; then break; fi
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
  ($gm --version >/dev/null) 2>/dev/null && GNUMAKE=$gm
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
done
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
: ${GNUMAKE:?'Cannot locate the gnumake program.  Stop.'}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
16630
3dea566541da 8011198: LP64 setting is not preserved on Solaris after 8006965
kvn
parents: 5547
diff changeset
    71
# quiet build by default
3dea566541da 8011198: LP64 setting is not preserved on Solaris after 8006965
kvn
parents: 5547
diff changeset
    72
Quiet="MAKE_VERBOSE="
3dea566541da 8011198: LP64 setting is not preserved on Solaris after 8006965
kvn
parents: 5547
diff changeset
    73
3dea566541da 8011198: LP64 setting is not preserved on Solaris after 8006965
kvn
parents: 5547
diff changeset
    74
# no debug info by default
3dea566541da 8011198: LP64 setting is not preserved on Solaris after 8006965
kvn
parents: 5547
diff changeset
    75
NoDebugInfo="ENABLE_FULL_DEBUG_SYMBOLS="
3dea566541da 8011198: LP64 setting is not preserved on Solaris after 8006965
kvn
parents: 5547
diff changeset
    76
3dea566541da 8011198: LP64 setting is not preserved on Solaris after 8006965
kvn
parents: 5547
diff changeset
    77
LANG=C
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
echo "### ENVIRONMENT SETTINGS:"
16630
3dea566541da 8011198: LP64 setting is not preserved on Solaris after 8006965
kvn
parents: 5547
diff changeset
    80
export HOTSPOT_SRC		; echo "HOTSPOT_SRC=$HOTSPOT_SRC"
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
export JAVA_HOME		; echo "JAVA_HOME=$JAVA_HOME"
16630
3dea566541da 8011198: LP64 setting is not preserved on Solaris after 8006965
kvn
parents: 5547
diff changeset
    82
export ALT_BOOTDIR		; echo "ALT_BOOTDIR=$ALT_BOOTDIR"
3dea566541da 8011198: LP64 setting is not preserved on Solaris after 8006965
kvn
parents: 5547
diff changeset
    83
export ALT_OUTPUTDIR		; echo "ALT_OUTPUTDIR=$ALT_OUTPUTDIR"
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
export GNUMAKE			; echo "GNUMAKE=$GNUMAKE"
16630
3dea566541da 8011198: LP64 setting is not preserved on Solaris after 8006965
kvn
parents: 5547
diff changeset
    85
export LANG			; echo "LANG=$LANG"
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
echo "###"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
16630
3dea566541da 8011198: LP64 setting is not preserved on Solaris after 8006965
kvn
parents: 5547
diff changeset
    88
BuildOptions="$Quiet $NoDebugInfo $*"
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
echo \
16630
3dea566541da 8011198: LP64 setting is not preserved on Solaris after 8006965
kvn
parents: 5547
diff changeset
    91
${GNUMAKE} -f ${HOTSPOT_SRC}/make/Makefile $BuildOptions GAMMADIR=${HOTSPOT_SRC}
3dea566541da 8011198: LP64 setting is not preserved on Solaris after 8006965
kvn
parents: 5547
diff changeset
    92
${GNUMAKE} -f ${HOTSPOT_SRC}/make/Makefile $BuildOptions GAMMADIR=${HOTSPOT_SRC}