test/jprt.config

Thu, 27 May 2010 19:08:38 -0700

author
trims
date
Thu, 27 May 2010 19:08:38 -0700
changeset 1907
c18cbe5936b8
parent 435
a61af66fc99e
child 3156
f08d439fab8c
permissions
-rw-r--r--

6941466: Oracle rebranding changes for Hotspot repositories
Summary: Change all the Sun copyrights to Oracle copyright
Reviewed-by: ohair

duke@435 1 #!echo "This is not a shell script"
duke@435 2 #############################################################################
duke@435 3 #
trims@1907 4 # Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved.
duke@435 5 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@435 6 #
duke@435 7 # This code is free software; you can redistribute it and/or modify it
duke@435 8 # under the terms of the GNU General Public License version 2 only, as
duke@435 9 # published by the Free Software Foundation.
duke@435 10 #
duke@435 11 # This code is distributed in the hope that it will be useful, but WITHOUT
duke@435 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@435 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@435 14 # version 2 for more details (a copy is included in the LICENSE file that
duke@435 15 # accompanied this code).
duke@435 16 #
duke@435 17 # You should have received a copy of the GNU General Public License version
duke@435 18 # 2 along with this work; if not, write to the Free Software Foundation,
duke@435 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@435 20 #
trims@1907 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@1907 22 # or visit www.oracle.com if you need additional information or have any
trims@1907 23 # questions.
duke@435 24 #
duke@435 25 #############################################################################
duke@435 26
duke@435 27 #############################################################################
duke@435 28 #
duke@435 29 # JPRT shell configuration for testing.
duke@435 30 #
duke@435 31 # Input environment variables:
duke@435 32 # Windows Only:
duke@435 33 # PATH
duke@435 34 # ROOTDIR
duke@435 35 #
duke@435 36 # Output variable settings:
duke@435 37 # make Full path to GNU make
duke@435 38 #
duke@435 39 # Output environment variables:
duke@435 40 # PATH
duke@435 41 #
duke@435 42 #############################################################################
duke@435 43
duke@435 44 #############################################################################
duke@435 45 # Error
duke@435 46 error() # message
duke@435 47 {
duke@435 48 echo "ERROR: $1"
duke@435 49 exit 6
duke@435 50 }
duke@435 51 # Directory must exist
duke@435 52 dirMustExist() # dir name
duke@435 53 {
duke@435 54 if [ ! -d "$1" ] ; then
duke@435 55 error "Directory for $2 does not exist: $1"
duke@435 56 fi
duke@435 57 }
duke@435 58 # File must exist
duke@435 59 fileMustExist() # dir name
duke@435 60 {
duke@435 61 if [ ! -f "$1" ] ; then
duke@435 62 error "File for $2 does not exist: $1"
duke@435 63 fi
duke@435 64 }
duke@435 65 #############################################################################
duke@435 66
duke@435 67 # Should be set by JPRT as the 3 basic inputs
duke@435 68 slashjava="${ALT_SLASH_JAVA}"
duke@435 69 if [ "${slashjava}" = "" ] ; then
duke@435 70 slashjava=/java
duke@435 71 fi
duke@435 72
duke@435 73 # Check input
duke@435 74 dirMustExist "${slashjava}" ALT_SLASH_JAVA
duke@435 75
duke@435 76 # Uses 'uname -s', but only expect SunOS or Linux, assume Windows otherwise.
duke@435 77 osname=`uname -s`
duke@435 78 if [ "${osname}" = SunOS ] ; then
duke@435 79
duke@435 80 # SOLARIS: Sparc or X86
duke@435 81 osarch=`uname -p`
duke@435 82 if [ "${osarch}" = sparc ] ; then
duke@435 83 solaris_arch=sparc
duke@435 84 else
duke@435 85 solaris_arch=i386
duke@435 86 fi
duke@435 87
duke@435 88 # Add basic solaris system paths
duke@435 89 path4sdk=/usr/ccs/bin:/usr/ccs/lib:/usr/bin:/bin:/usr/sfw/bin
duke@435 90
duke@435 91 # Find GNU make
duke@435 92 make=/usr/sfw/bin/gmake
duke@435 93 if [ ! -f ${make} ] ; then
duke@435 94 make=/opt/sfw/bin/gmake
duke@435 95 if [ ! -f ${make} ] ; then
duke@435 96 make=${slashjava}/devtools/${solaris_arch}/bin/gnumake
duke@435 97 fi
duke@435 98 fi
duke@435 99 fileMustExist "${make}" make
duke@435 100
duke@435 101 # File creation mask
duke@435 102 umask 002
duke@435 103
duke@435 104 elif [ "${osname}" = Linux ] ; then
duke@435 105
duke@435 106 # Add basic paths
duke@435 107 path4sdk=/usr/bin:/bin:/usr/sbin:/sbin
duke@435 108
duke@435 109 # Find GNU make
duke@435 110 make=/usr/bin/make
duke@435 111 fileMustExist "${make}" make
duke@435 112
duke@435 113 umask 002
duke@435 114
duke@435 115 else
duke@435 116
duke@435 117 # Windows: Differs on CYGWIN vs. MKS.
duke@435 118
duke@435 119 # We need to determine if we are running a CYGWIN shell or an MKS shell
duke@435 120 # (if uname isn't available, then it will be unix_toolset=unknown)
duke@435 121 unix_toolset=unknown
duke@435 122 if [ "`uname -a | fgrep Cygwin`" = "" -a -d "${ROOTDIR}" ] ; then
duke@435 123 # We kind of assume ROOTDIR is where MKS is and it's ok
duke@435 124 unix_toolset=MKS
duke@435 125 mkshome=`dosname -s "${ROOTDIR}"`
duke@435 126 # Most unix utilities are in the mksnt directory of ROOTDIR
duke@435 127 unixcommand_path="${mkshome}/mksnt"
duke@435 128 path4sdk="${unixcommand_path}"
duke@435 129 devtools_path="${slashjava}/devtools/win32/bin"
duke@435 130 path4sdk="${devtools_path};${path4sdk}"
duke@435 131 # Find GNU make
duke@435 132 make="${devtools_path}/gnumake.exe"
duke@435 133 fileMustExist "${make}" make
duke@435 134 elif [ "`uname -a | fgrep Cygwin`" != "" -a -f /bin/cygpath ] ; then
duke@435 135 # For CYGWIN, uname will have "Cygwin" in it, and /bin/cygpath should exist
duke@435 136 unix_toolset=CYGWIN
duke@435 137 # Most unix utilities are in the /usr/bin
duke@435 138 unixcommand_path="/usr/bin"
duke@435 139 path4sdk="${unixcommand_path}"
duke@435 140 # Find GNU make
duke@435 141 make="${unixcommand_path}/make.exe"
duke@435 142 fileMustExist "${make}" make
duke@435 143 else
duke@435 144 echo "WARNING: Cannot figure out if this is MKS or CYGWIN"
duke@435 145 fi
duke@435 146
duke@435 147
duke@435 148 # For windows, it's hard to know where the system is, so we just add this
duke@435 149 # to PATH.
duke@435 150 slash_path="`echo ${path4sdk} | sed -e 's@\\\\@/@g' -e 's@//@/@g' -e 's@/$@@' -e 's@/;@;@g'`"
duke@435 151 path4sdk="${slash_path};${PATH}"
duke@435 152
duke@435 153 # Convert path4sdk to cygwin style
duke@435 154 if [ "${unix_toolset}" = CYGWIN ] ; then
duke@435 155 path4sdk="`/usr/bin/cygpath -p ${path4sdk}`"
duke@435 156 fi
duke@435 157
duke@435 158 fi
duke@435 159
duke@435 160 # Export PATH setting
duke@435 161 PATH="${path4sdk}"
duke@435 162 export PATH
duke@435 163

mercurial