annotate make/linux/build.sh @ 2745:81aa07130d30

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