annotate hotspot/make/build.sh @ 24116:9f9b4ba34aad

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