1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/test/jprt.config Sat Dec 01 00:00:00 2007 +0000 1.3 @@ -0,0 +1,163 @@ 1.4 +#!echo "This is not a shell script" 1.5 +############################################################################# 1.6 +# 1.7 +# Copyright 2006-2007 Sun Microsystems, Inc. All Rights Reserved. 1.8 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.9 +# 1.10 +# This code is free software; you can redistribute it and/or modify it 1.11 +# under the terms of the GNU General Public License version 2 only, as 1.12 +# published by the Free Software Foundation. 1.13 +# 1.14 +# This code is distributed in the hope that it will be useful, but WITHOUT 1.15 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.16 +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.17 +# version 2 for more details (a copy is included in the LICENSE file that 1.18 +# accompanied this code). 1.19 +# 1.20 +# You should have received a copy of the GNU General Public License version 1.21 +# 2 along with this work; if not, write to the Free Software Foundation, 1.22 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.23 +# 1.24 +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 1.25 +# CA 95054 USA or visit www.sun.com if you need additional information or 1.26 +# have any questions. 1.27 +# 1.28 +############################################################################# 1.29 + 1.30 +############################################################################# 1.31 +# 1.32 +# JPRT shell configuration for testing. 1.33 +# 1.34 +# Input environment variables: 1.35 +# Windows Only: 1.36 +# PATH 1.37 +# ROOTDIR 1.38 +# 1.39 +# Output variable settings: 1.40 +# make Full path to GNU make 1.41 +# 1.42 +# Output environment variables: 1.43 +# PATH 1.44 +# 1.45 +############################################################################# 1.46 + 1.47 +############################################################################# 1.48 +# Error 1.49 +error() # message 1.50 +{ 1.51 + echo "ERROR: $1" 1.52 + exit 6 1.53 +} 1.54 +# Directory must exist 1.55 +dirMustExist() # dir name 1.56 +{ 1.57 + if [ ! -d "$1" ] ; then 1.58 + error "Directory for $2 does not exist: $1" 1.59 + fi 1.60 +} 1.61 +# File must exist 1.62 +fileMustExist() # dir name 1.63 +{ 1.64 + if [ ! -f "$1" ] ; then 1.65 + error "File for $2 does not exist: $1" 1.66 + fi 1.67 +} 1.68 +############################################################################# 1.69 + 1.70 +# Should be set by JPRT as the 3 basic inputs 1.71 +slashjava="${ALT_SLASH_JAVA}" 1.72 +if [ "${slashjava}" = "" ] ; then 1.73 + slashjava=/java 1.74 +fi 1.75 + 1.76 +# Check input 1.77 +dirMustExist "${slashjava}" ALT_SLASH_JAVA 1.78 + 1.79 +# Uses 'uname -s', but only expect SunOS or Linux, assume Windows otherwise. 1.80 +osname=`uname -s` 1.81 +if [ "${osname}" = SunOS ] ; then 1.82 + 1.83 + # SOLARIS: Sparc or X86 1.84 + osarch=`uname -p` 1.85 + if [ "${osarch}" = sparc ] ; then 1.86 + solaris_arch=sparc 1.87 + else 1.88 + solaris_arch=i386 1.89 + fi 1.90 + 1.91 + # Add basic solaris system paths 1.92 + path4sdk=/usr/ccs/bin:/usr/ccs/lib:/usr/bin:/bin:/usr/sfw/bin 1.93 + 1.94 + # Find GNU make 1.95 + make=/usr/sfw/bin/gmake 1.96 + if [ ! -f ${make} ] ; then 1.97 + make=/opt/sfw/bin/gmake 1.98 + if [ ! -f ${make} ] ; then 1.99 + make=${slashjava}/devtools/${solaris_arch}/bin/gnumake 1.100 + fi 1.101 + fi 1.102 + fileMustExist "${make}" make 1.103 + 1.104 + # File creation mask 1.105 + umask 002 1.106 + 1.107 +elif [ "${osname}" = Linux ] ; then 1.108 + 1.109 + # Add basic paths 1.110 + path4sdk=/usr/bin:/bin:/usr/sbin:/sbin 1.111 + 1.112 + # Find GNU make 1.113 + make=/usr/bin/make 1.114 + fileMustExist "${make}" make 1.115 + 1.116 + umask 002 1.117 + 1.118 +else 1.119 + 1.120 + # Windows: Differs on CYGWIN vs. MKS. 1.121 + 1.122 + # We need to determine if we are running a CYGWIN shell or an MKS shell 1.123 + # (if uname isn't available, then it will be unix_toolset=unknown) 1.124 + unix_toolset=unknown 1.125 + if [ "`uname -a | fgrep Cygwin`" = "" -a -d "${ROOTDIR}" ] ; then 1.126 + # We kind of assume ROOTDIR is where MKS is and it's ok 1.127 + unix_toolset=MKS 1.128 + mkshome=`dosname -s "${ROOTDIR}"` 1.129 + # Most unix utilities are in the mksnt directory of ROOTDIR 1.130 + unixcommand_path="${mkshome}/mksnt" 1.131 + path4sdk="${unixcommand_path}" 1.132 + devtools_path="${slashjava}/devtools/win32/bin" 1.133 + path4sdk="${devtools_path};${path4sdk}" 1.134 + # Find GNU make 1.135 + make="${devtools_path}/gnumake.exe" 1.136 + fileMustExist "${make}" make 1.137 + elif [ "`uname -a | fgrep Cygwin`" != "" -a -f /bin/cygpath ] ; then 1.138 + # For CYGWIN, uname will have "Cygwin" in it, and /bin/cygpath should exist 1.139 + unix_toolset=CYGWIN 1.140 + # Most unix utilities are in the /usr/bin 1.141 + unixcommand_path="/usr/bin" 1.142 + path4sdk="${unixcommand_path}" 1.143 + # Find GNU make 1.144 + make="${unixcommand_path}/make.exe" 1.145 + fileMustExist "${make}" make 1.146 + else 1.147 + echo "WARNING: Cannot figure out if this is MKS or CYGWIN" 1.148 + fi 1.149 + 1.150 + 1.151 + # For windows, it's hard to know where the system is, so we just add this 1.152 + # to PATH. 1.153 + slash_path="`echo ${path4sdk} | sed -e 's@\\\\@/@g' -e 's@//@/@g' -e 's@/$@@' -e 's@/;@;@g'`" 1.154 + path4sdk="${slash_path};${PATH}" 1.155 + 1.156 + # Convert path4sdk to cygwin style 1.157 + if [ "${unix_toolset}" = CYGWIN ] ; then 1.158 + path4sdk="`/usr/bin/cygpath -p ${path4sdk}`" 1.159 + fi 1.160 + 1.161 +fi 1.162 + 1.163 +# Export PATH setting 1.164 +PATH="${path4sdk}" 1.165 +export PATH 1.166 +