annotate test/jprt.config @ 0:a61af66fc99e

Initial load
author duke
date Sat, 01 Dec 2007 00:00:00 +0000
parents
children c18cbe5936b8
rev   line source
duke@0 1 #!echo "This is not a shell script"
duke@0 2 #############################################################################
duke@0 3 #
duke@0 4 # Copyright 2006-2007 Sun Microsystems, Inc. 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 #
duke@0 21 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
duke@0 22 # CA 95054 USA or visit www.sun.com if you need additional information or
duke@0 23 # have any 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`
duke@0 78 if [ "${osname}" = SunOS ] ; then
duke@0 79
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
duke@0 103
duke@0 104 elif [ "${osname}" = Linux ] ; then
duke@0 105
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
duke@0 114
duke@0 115 else
duke@0 116
duke@0 117 # Windows: Differs on CYGWIN vs. MKS.
duke@0 118
duke@0 119 # We need to determine if we are running a CYGWIN shell or an MKS shell
duke@0 120 # (if uname isn't available, then it will be unix_toolset=unknown)
duke@0 121 unix_toolset=unknown
duke@0 122 if [ "`uname -a | fgrep Cygwin`" = "" -a -d "${ROOTDIR}" ] ; then
duke@0 123 # We kind of assume ROOTDIR is where MKS is and it's ok
duke@0 124 unix_toolset=MKS
duke@0 125 mkshome=`dosname -s "${ROOTDIR}"`
duke@0 126 # Most unix utilities are in the mksnt directory of ROOTDIR
duke@0 127 unixcommand_path="${mkshome}/mksnt"
duke@0 128 path4sdk="${unixcommand_path}"
duke@0 129 devtools_path="${slashjava}/devtools/win32/bin"
duke@0 130 path4sdk="${devtools_path};${path4sdk}"
duke@0 131 # Find GNU make
duke@0 132 make="${devtools_path}/gnumake.exe"
duke@0 133 fileMustExist "${make}" make
duke@0 134 elif [ "`uname -a | fgrep Cygwin`" != "" -a -f /bin/cygpath ] ; then
duke@0 135 # For CYGWIN, uname will have "Cygwin" in it, and /bin/cygpath should exist
duke@0 136 unix_toolset=CYGWIN
duke@0 137 # Most unix utilities are in the /usr/bin
duke@0 138 unixcommand_path="/usr/bin"
duke@0 139 path4sdk="${unixcommand_path}"
duke@0 140 # Find GNU make
duke@0 141 make="${unixcommand_path}/make.exe"
duke@0 142 fileMustExist "${make}" make
duke@0 143 else
duke@0 144 echo "WARNING: Cannot figure out if this is MKS or CYGWIN"
duke@0 145 fi
duke@0 146
duke@0 147
duke@0 148 # For windows, it's hard to know where the system is, so we just add this
duke@0 149 # to PATH.
duke@0 150 slash_path="`echo ${path4sdk} | sed -e 's@\\\\@/@g' -e 's@//@/@g' -e 's@/$@@' -e 's@/;@;@g'`"
duke@0 151 path4sdk="${slash_path};${PATH}"
duke@0 152
duke@0 153 # Convert path4sdk to cygwin style
duke@0 154 if [ "${unix_toolset}" = CYGWIN ] ; then
duke@0 155 path4sdk="`/usr/bin/cygpath -p ${path4sdk}`"
duke@0 156 fi
duke@0 157
duke@0 158 fi
duke@0 159
duke@0 160 # Export PATH setting
duke@0 161 PATH="${path4sdk}"
duke@0 162 export PATH
duke@0 163