test/jprt.config

Tue, 08 Aug 2017 15:57:29 +0800

author
aoqi
date
Tue, 08 Aug 2017 15:57:29 +0800
changeset 6876
710a3c8b516e
parent 3156
f08d439fab8c
parent 0
f90c822e73f8
permissions
-rw-r--r--

merge

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

mercurial