test/jprt.config

Thu, 25 Aug 2011 17:18:25 -0700

author
schien
date
Thu, 25 Aug 2011 17:18:25 -0700
changeset 1067
f497fac86cf9
parent 554
9d9f26857129
permissions
-rw-r--r--

Added tag jdk8-b02 for changeset b3c059de2a61

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

mercurial