annotate test/jprt.config @ 4404:b601102d00c8

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