hotspot/make/solaris/build.sh
author kamg
Fri, 11 Apr 2008 09:56:35 -0400
changeset 357 f4edb0d9f109
parent 338 5cf9f61d76f4
child 670 ddf3e9583f2f
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
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
# Copyright 1998-2000 Sun Microsystems, Inc.  All Rights Reserved.
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
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
    20
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    21
# CA 95054 USA or visit www.sun.com if you need additional information or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
# have any questions.
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
usage() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
    (
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
        echo "Usage : $0 [-sb | -sbfast] config ws_path"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
        echo ""
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
        echo "Where:"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
        echo "    -sb     ::= enable source browser info generation for"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
        echo "                all configs during compilation"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
        echo ""
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
        echo "    -sbfast ::= enable source browser info generation for"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
        echo "                all configs without compilation"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
        echo ""
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
        echo "    config  ::= debug     | debug1     | debugcore"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
        echo "                fastdebug | fastdebug1 | fastdebugcore"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
        echo "                jvmg      | jvmg1      | jvmgcore"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
        echo "                optimized | optimized1 | optimizedcore"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
        echo "                profiled  | profiled1  | profiledcore"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
        echo "                product   | product1   | productcore"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
        echo ""
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
        echo "    ws_path ::= path to HotSpot workspace"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
    ) >&2
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
    exit 1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
# extract possible options
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
options=""
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
if [ $# -gt 2 ]; then 
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
    case "$1" in
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
    -sb)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
	options="CFLAGS_BROWSE=-xsb"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
	shift
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
	;;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
    -sbfast)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
	options="CFLAGS_BROWSE=-xsbfast"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
	shift
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
	;;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
    *)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
	echo "Unknown option: '$1'" >&2
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
	usage
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
	;;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
    esac
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
fi
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
# should be just two args left at this point
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
if [ $# != 2 ]; then 
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
    usage
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
fi
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
# Just in case:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
case ${JAVA_HOME} in
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
/*) true;;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
?*) JAVA_HOME=`( cd $JAVA_HOME; pwd )`;;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
esac
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
if [ "${JAVA_HOME}" = ""  -o  ! -d "${JAVA_HOME}" -o ! -d ${JAVA_HOME}/jre/lib/`uname -p` ]; then
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
    echo "JAVA_HOME needs to be set to a valid JDK path"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
    echo "ksh : export JAVA_HOME=/net/tetrasparc/export/gobi/JDK1.2_fcs_V/solaris"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
    echo "csh : setenv JAVA_HOME /net/tetrasparc/export/gobi/JDK1.2_fcs_V/solaris"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
    exit 1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
fi
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
LD_LIBRARY_PATH=${JAVA_HOME}/jre/lib/`uname -p`:\
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
${JAVA_HOME}/jre/lib/`uname -p`/native_threads:${LD_LIBRARY_PATH-.}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
# This is necessary as long as we are using the old launcher
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
# with the new distribution format:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
CLASSPATH=${JAVA_HOME}/jre/lib/rt.jar:${CLASSPATH-.}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
for gm in gmake gnumake
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
do
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
  if [ "${GNUMAKE-}" != "" ]; then break; fi
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
  ($gm --version >/dev/null) 2>/dev/null && GNUMAKE=$gm
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
done
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
: ${GNUMAKE:?'Cannot locate the gnumake program.  Stop.'}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
echo "### ENVIRONMENT SETTINGS:"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
export JAVA_HOME		; echo "JAVA_HOME=$JAVA_HOME"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
export LD_LIBRARY_PATH		; echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
export CLASSPATH		; echo "CLASSPATH=$CLASSPATH"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
export GNUMAKE			; echo "GNUMAKE=$GNUMAKE"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
echo "###"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
config=$1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
ws_path=$2
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
case ${ws_path} in
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
/*) true;;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
?*) ws_path=`(cd ${ws_path}; pwd)`;;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
esac
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
echo \
338
5cf9f61d76f4 6583644: Move all managed/SCCS files out of 'build' into 'make' directory
kamg
parents: 1
diff changeset
   124
${GNUMAKE} -f ${ws_path}/make/solaris/Makefile \
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
    $config GAMMADIR=${ws_path} $options
338
5cf9f61d76f4 6583644: Move all managed/SCCS files out of 'build' into 'make' directory
kamg
parents: 1
diff changeset
   126
${GNUMAKE} -f ${ws_path}/make/solaris/Makefile \
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
    $config GAMMADIR=${ws_path} $options