annotate test/jprt.config @ 7135:db1323224053

8030822: (tz) Support tzdata2013i Reviewed-by: coffeys, mfang, okutsu
author aefimov
date Tue, 04 Feb 2014 17:37:42 +0400
parents 37a05a11f281
children
rev   line source
duke@0 1 #!echo "This is not a shell script"
duke@0 2 #############################################################################
ohair@2362 3 # Copyright (c) 2006, 2007, 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 #
ohair@2362 20 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@2362 21 # or visit www.oracle.com if you need additional information or have any
ohair@2362 22 # questions.
duke@0 23 #############################################################################
duke@0 24 #
duke@0 25 # JPRT shell configuration for testing.
duke@0 26 #
duke@0 27 # Input environment variables:
duke@0 28 # Windows Only:
duke@0 29 # PATH
duke@0 30 # ROOTDIR
duke@0 31 #
duke@0 32 # Output variable settings:
duke@0 33 # make Full path to GNU make
duke@0 34 #
duke@0 35 # Output environment variables:
duke@0 36 # PATH
duke@0 37 #
duke@0 38 #############################################################################
duke@0 39
duke@0 40 #############################################################################
duke@0 41 # Error
duke@0 42 error() # message
duke@0 43 {
duke@0 44 echo "ERROR: $1"
duke@0 45 exit 6
duke@0 46 }
duke@0 47 # Directory must exist
duke@0 48 dirMustExist() # dir name
duke@0 49 {
duke@0 50 if [ ! -d "$1" ] ; then
duke@0 51 error "Directory for $2 does not exist: $1"
duke@0 52 fi
duke@0 53 }
duke@0 54 # File must exist
duke@0 55 fileMustExist() # dir name
duke@0 56 {
duke@0 57 if [ ! -f "$1" ] ; then
duke@0 58 error "File for $2 does not exist: $1"
duke@0 59 fi
duke@0 60 }
duke@0 61 #############################################################################
duke@0 62
duke@0 63 # Should be set by JPRT as the 3 basic inputs
duke@0 64 slashjava="${ALT_SLASH_JAVA}"
duke@0 65 if [ "${slashjava}" = "" ] ; then
duke@0 66 slashjava=/java
duke@0 67 fi
duke@0 68
duke@0 69 # Check input
duke@0 70 dirMustExist "${slashjava}" ALT_SLASH_JAVA
duke@0 71
duke@0 72 # Uses 'uname -s', but only expect SunOS or Linux, assume Windows otherwise.
duke@0 73 osname=`uname -s`
duke@0 74 if [ "${osname}" = SunOS ] ; then
duke@0 75
duke@0 76 # SOLARIS: Sparc or X86
duke@0 77 osarch=`uname -p`
duke@0 78 if [ "${osarch}" = sparc ] ; then
duke@0 79 solaris_arch=sparc
duke@0 80 else
duke@0 81 solaris_arch=i386
duke@0 82 fi
duke@0 83
duke@0 84 # Add basic solaris system paths
duke@0 85 path4sdk=/usr/ccs/bin:/usr/ccs/lib:/usr/bin:/bin:/usr/sfw/bin
duke@0 86
duke@0 87 # Find GNU make
duke@0 88 make=/usr/sfw/bin/gmake
duke@0 89 if [ ! -f ${make} ] ; then
duke@0 90 make=/opt/sfw/bin/gmake
duke@0 91 if [ ! -f ${make} ] ; then
duke@0 92 make=${slashjava}/devtools/${solaris_arch}/bin/gnumake
duke@0 93 fi
duke@0 94 fi
duke@0 95 fileMustExist "${make}" make
duke@0 96
duke@0 97 # File creation mask
duke@0 98 umask 002
duke@0 99
duke@0 100 elif [ "${osname}" = Linux ] ; then
duke@0 101
duke@0 102 # Add basic paths
duke@0 103 path4sdk=/usr/bin:/bin:/usr/sbin:/sbin
duke@0 104
duke@0 105 # Find GNU make
duke@0 106 make=/usr/bin/make
duke@0 107 fileMustExist "${make}" make
duke@0 108
duke@0 109 umask 002
duke@0 110
duke@0 111 else
duke@0 112
duke@0 113 # Windows: Differs on CYGWIN vs. MKS.
duke@0 114
duke@0 115 # We need to determine if we are running a CYGWIN shell or an MKS shell
duke@0 116 # (if uname isn't available, then it will be unix_toolset=unknown)
duke@0 117 unix_toolset=unknown
duke@0 118 if [ "`uname -a | fgrep Cygwin`" = "" -a -d "${ROOTDIR}" ] ; then
duke@0 119 # We kind of assume ROOTDIR is where MKS is and it's ok
duke@0 120 unix_toolset=MKS
duke@0 121 mkshome=`dosname -s "${ROOTDIR}"`
duke@0 122 # Most unix utilities are in the mksnt directory of ROOTDIR
duke@0 123 unixcommand_path="${mkshome}/mksnt"
duke@0 124 path4sdk="${unixcommand_path}"
duke@0 125 devtools_path="${slashjava}/devtools/win32/bin"
duke@0 126 path4sdk="${devtools_path};${path4sdk}"
duke@0 127 # Find GNU make
duke@0 128 make="${devtools_path}/gnumake.exe"
duke@0 129 fileMustExist "${make}" make
duke@0 130 elif [ "`uname -a | fgrep Cygwin`" != "" -a -f /bin/cygpath ] ; then
duke@0 131 # For CYGWIN, uname will have "Cygwin" in it, and /bin/cygpath should exist
duke@0 132 unix_toolset=CYGWIN
duke@0 133 # Most unix utilities are in the /usr/bin
duke@0 134 unixcommand_path="/usr/bin"
duke@0 135 path4sdk="${unixcommand_path}"
duke@0 136 # Find GNU make
duke@0 137 make="${unixcommand_path}/make.exe"
duke@0 138 fileMustExist "${make}" make
duke@0 139 else
duke@0 140 echo "WARNING: Cannot figure out if this is MKS or CYGWIN"
duke@0 141 fi
duke@0 142
duke@0 143
duke@0 144 # For windows, it's hard to know where the system is, so we just add this
duke@0 145 # to PATH.
duke@0 146 slash_path="`echo ${path4sdk} | sed -e 's@\\\\@/@g' -e 's@//@/@g' -e 's@/$@@' -e 's@/;@;@g'`"
duke@0 147 path4sdk="${slash_path};${PATH}"
duke@0 148
duke@0 149 # Convert path4sdk to cygwin style
duke@0 150 if [ "${unix_toolset}" = CYGWIN ] ; then
duke@0 151 path4sdk="`/usr/bin/cygpath -p ${path4sdk}`"
duke@0 152 fi
duke@0 153
duke@0 154 fi
duke@0 155
duke@0 156 # Export PATH setting
duke@0 157 PATH="${path4sdk}"
duke@0 158 export PATH
duke@0 159