hotspot/make/linux/build.sh
author dcubed
Tue, 24 Apr 2012 15:20:40 -0700
changeset 12503 9df71f999005
parent 10563 b9b82ff9f0e9
permissions -rw-r--r--
Merge
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
#
10563
b9b82ff9f0e9 7081842: assert(Compile::current()->unique() < (uint)MaxNodeLimit) failed: Node limit exceeded
kvn
parents: 5547
diff changeset
     3
# Copyright (c) 1999, 2011, 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
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
if [ $# != 2 ]; then 
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
    echo "Usage : $0 Build_Options Location"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
    echo "Build Options : debug or optimized or basicdebug or basic or clean"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
    echo "Location : specify any workspace which has gamma sources"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
    exit 1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
fi
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
# Just in case:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
case ${JAVA_HOME} in
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
/*) true;;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
?*) JAVA_HOME=`( cd $JAVA_HOME; pwd )`;;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
esac
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
case `uname -m` in
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
  i386|i486|i586|i686)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
    mach=i386
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
    ;;
10563
b9b82ff9f0e9 7081842: assert(Compile::current()->unique() < (uint)MaxNodeLimit) failed: Node limit exceeded
kvn
parents: 5547
diff changeset
    48
  x86_64)
b9b82ff9f0e9 7081842: assert(Compile::current()->unique() < (uint)MaxNodeLimit) failed: Node limit exceeded
kvn
parents: 5547
diff changeset
    49
    mach=amd64
b9b82ff9f0e9 7081842: assert(Compile::current()->unique() < (uint)MaxNodeLimit) failed: Node limit exceeded
kvn
parents: 5547
diff changeset
    50
    ;;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
  *)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
    echo "Unsupported machine: " `uname -m`
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
    exit 1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
    ;;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
esac
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
if [ "${JAVA_HOME}" = ""  -o  ! -d "${JAVA_HOME}" -o ! -d ${JAVA_HOME}/jre/lib/${mach} ]; then
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
    echo "JAVA_HOME needs to be set to a valid JDK path"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
    echo "ksh : export JAVA_HOME=/net/tetrasparc/export/gobi/JDK1.2_fcs_V/linux"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
    echo "csh : setenv JAVA_HOME /net/tetrasparc/export/gobi/JDK1.2_fcs_V/linux"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
    exit 1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
fi
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
LD_LIBRARY_PATH=${JAVA_HOME}/jre/lib/`uname -p`:\
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
${JAVA_HOME}/jre/lib/`uname -p`/native_threads:${LD_LIBRARY_PATH-.}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
# This is necessary as long as we are using the old launcher
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
# with the new distribution format:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
CLASSPATH=${JAVA_HOME}/jre/lib/rt.jar:${CLASSPATH-.}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
for gm in gmake gnumake
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
do
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
  if [ "${GNUMAKE-}" != "" ]; then break; fi
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
  ($gm --version >/dev/null) 2>/dev/null && GNUMAKE=$gm
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
done
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
: ${GNUMAKE:?'Cannot locate the gnumake program.  Stop.'}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
echo "### ENVIRONMENT SETTINGS:"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
export JAVA_HOME		; echo "JAVA_HOME=$JAVA_HOME"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
export LD_LIBRARY_PATH		; echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
export CLASSPATH		; echo "CLASSPATH=$CLASSPATH"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
export GNUMAKE			; echo "GNUMAKE=$GNUMAKE"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
echo "###"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
Build_Options=$1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
Location=$2
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
case ${Location} in
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
/*) true;;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
?*) Location=`(cd ${Location}; pwd)`;;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
esac
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
echo \
338
5cf9f61d76f4 6583644: Move all managed/SCCS files out of 'build' into 'make' directory
kamg
parents: 1
diff changeset
    97
${GNUMAKE} -f ${Location}/make/linux/Makefile $Build_Options GAMMADIR=${Location}
5cf9f61d76f4 6583644: Move all managed/SCCS files out of 'build' into 'make' directory
kamg
parents: 1
diff changeset
    98
${GNUMAKE} -f ${Location}/make/linux/Makefile $Build_Options GAMMADIR=${Location}