hotspot/make/bsd/build.sh
author twisti
Mon, 13 Feb 2012 04:30:59 -0800
changeset 11784 715f58266a42
parent 10565 dc90c239f4ec
permissions -rw-r--r--
7143766: add ALT_JDK_IMAGE_DIR and improve test_jdk Reviewed-by: rbackman, jrose, dholmes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10565
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     1
#! /bin/sh
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     2
#
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     3
# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     4
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     5
#
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     6
# This code is free software; you can redistribute it and/or modify it
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     7
# under the terms of the GNU General Public License version 2 only, as
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     8
# published by the Free Software Foundation.
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     9
#
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    10
# This code is distributed in the hope that it will be useful, but WITHOUT
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    11
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    12
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    13
# version 2 for more details (a copy is included in the LICENSE file that
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    14
# accompanied this code).
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    15
#
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    16
# You should have received a copy of the GNU General Public License version
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    17
# 2 along with this work; if not, write to the Free Software Foundation,
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    18
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    19
#
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    20
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    21
# or visit www.oracle.com if you need additional information or have any
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    22
# questions.
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    23
#  
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    24
#
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    25
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    26
# Make sure the variable JAVA_HOME is set before running this script.
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    27
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    28
set -u
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    29
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    30
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    31
if [ $# != 2 ]; then 
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    32
    echo "Usage : $0 Build_Options Location"
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    33
    echo "Build Options : debug or optimized or basicdebug or basic or clean"
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    34
    echo "Location : specify any workspace which has gamma sources"
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    35
    exit 1
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    36
fi
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    37
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    38
# Just in case:
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    39
case ${JAVA_HOME} in
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    40
/*) true;;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    41
?*) JAVA_HOME=`( cd $JAVA_HOME; pwd )`;;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    42
esac
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    43
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    44
case `uname -m` in
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    45
  i386|i486|i586|i686)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    46
    mach=i386
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    47
    ;;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    48
  *)
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    49
    echo "Unsupported machine: " `uname -m`
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    50
    exit 1
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    51
    ;;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    52
esac
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    53
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    54
if [ "${JAVA_HOME}" = ""  -o  ! -d "${JAVA_HOME}" -o ! -d ${JAVA_HOME}/jre/lib/${mach} ]; then
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    55
    echo "JAVA_HOME needs to be set to a valid JDK path"
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    56
    echo "ksh : export JAVA_HOME=/net/tetrasparc/export/gobi/JDK1.2_fcs_V/bsd"
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    57
    echo "csh : setenv JAVA_HOME /net/tetrasparc/export/gobi/JDK1.2_fcs_V/bsd"
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    58
    exit 1
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    59
fi
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    60
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    61
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    62
LD_LIBRARY_PATH=${JAVA_HOME}/jre/lib/`uname -p`:\
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    63
${JAVA_HOME}/jre/lib/`uname -p`/native_threads:${LD_LIBRARY_PATH-.}
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    64
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    65
# This is necessary as long as we are using the old launcher
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    66
# with the new distribution format:
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    67
CLASSPATH=${JAVA_HOME}/jre/lib/rt.jar:${CLASSPATH-.}
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    68
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    69
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    70
for gm in gmake gnumake
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    71
do
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    72
  if [ "${GNUMAKE-}" != "" ]; then break; fi
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    73
  ($gm --version >/dev/null) 2>/dev/null && GNUMAKE=$gm
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    74
done
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    75
: ${GNUMAKE:?'Cannot locate the gnumake program.  Stop.'}
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    76
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    77
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    78
echo "### ENVIRONMENT SETTINGS:"
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    79
export JAVA_HOME		; echo "JAVA_HOME=$JAVA_HOME"
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    80
export LD_LIBRARY_PATH		; echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    81
export CLASSPATH		; echo "CLASSPATH=$CLASSPATH"
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    82
export GNUMAKE			; echo "GNUMAKE=$GNUMAKE"
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    83
echo "###"
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    84
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    85
Build_Options=$1
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    86
Location=$2
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    87
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    88
case ${Location} in
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    89
/*) true;;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    90
?*) Location=`(cd ${Location}; pwd)`;;
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    91
esac
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    92
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    93
echo \
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    94
${GNUMAKE} -f ${Location}/make/bsd/Makefile $Build_Options GAMMADIR=${Location}
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    95
${GNUMAKE} -f ${Location}/make/bsd/Makefile $Build_Options GAMMADIR=${Location}