test/jprt.config

changeset 0
f90c822e73f8
child 6876
710a3c8b516e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/test/jprt.config	Wed Apr 27 01:25:04 2016 +0800
     1.3 @@ -0,0 +1,185 @@
     1.4 +#!echo "This is not a shell script"
     1.5 +#############################################################################
     1.6 +# 
     1.7 +# Copyright (c) 2006, 2007, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    1.25 +# or visit www.oracle.com if you need additional information or have any
    1.26 +# 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 +case "${osname}" in
    1.82 +  SunOS )
    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 +
   1.108 +  Linux | Darwin )
   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 +
   1.119 +  FreeBSD | OpenBSD )
   1.120 +    # Add basic paths
   1.121 +    path4sdk=/usr/bin:/bin:/usr/sbin:/sbin
   1.122 +
   1.123 +    # Find GNU make
   1.124 +    make=/usr/local/bin/gmake
   1.125 +    fileMustExist "${make}" make
   1.126 +
   1.127 +    umask 002
   1.128 +    ;;
   1.129 +
   1.130 +  NetBSD )
   1.131 +    # Add basic paths
   1.132 +    path4sdk=/usr/bin:/bin:/usr/sbin:/sbin
   1.133 +
   1.134 +    # Find GNU make
   1.135 +    make=/usr/pkg/bin/gmake
   1.136 +    fileMustExist "${make}" make
   1.137 +
   1.138 +    umask 002
   1.139 +    ;;
   1.140 +
   1.141 +  * )
   1.142 +    # Windows: Differs on CYGWIN vs. MKS.
   1.143 +   
   1.144 +    # We need to determine if we are running a CYGWIN shell or an MKS shell
   1.145 +    #    (if uname isn't available, then it will be unix_toolset=unknown)
   1.146 +    unix_toolset=unknown
   1.147 +    if [ "`uname -a | fgrep Cygwin`" = "" -a -d "${ROOTDIR}" ] ; then
   1.148 +        # We kind of assume ROOTDIR is where MKS is and it's ok
   1.149 +        unix_toolset=MKS
   1.150 +        mkshome=`dosname -s "${ROOTDIR}"`
   1.151 +        # Most unix utilities are in the mksnt directory of ROOTDIR
   1.152 +        unixcommand_path="${mkshome}/mksnt"
   1.153 +        path4sdk="${unixcommand_path}"
   1.154 +	devtools_path="${slashjava}/devtools/win32/bin"
   1.155 +	path4sdk="${devtools_path};${path4sdk}"
   1.156 +        # Find GNU make
   1.157 +        make="${devtools_path}/gnumake.exe"
   1.158 +        fileMustExist "${make}" make
   1.159 +    elif [ "`uname -a | fgrep Cygwin`" != "" -a -f /bin/cygpath ] ; then
   1.160 +        # For CYGWIN, uname will have "Cygwin" in it, and /bin/cygpath should exist
   1.161 +        unix_toolset=CYGWIN
   1.162 +        # Most unix utilities are in the /usr/bin
   1.163 +        unixcommand_path="/usr/bin"
   1.164 +        path4sdk="${unixcommand_path}"
   1.165 +        # Find GNU make
   1.166 +        make="${unixcommand_path}/make.exe"
   1.167 +        fileMustExist "${make}" make
   1.168 +    else
   1.169 +      echo "WARNING: Cannot figure out if this is MKS or CYGWIN"
   1.170 +    fi
   1.171 +
   1.172 +    
   1.173 +    # For windows, it's hard to know where the system is, so we just add this
   1.174 +    #    to PATH.
   1.175 +    slash_path="`echo ${path4sdk} | sed -e 's@\\\\@/@g' -e 's@//@/@g' -e 's@/$@@' -e 's@/;@;@g'`"
   1.176 +    path4sdk="${slash_path};${PATH}"
   1.177 +    
   1.178 +    # Convert path4sdk to cygwin style
   1.179 +    if [ "${unix_toolset}" = CYGWIN ] ; then
   1.180 +	path4sdk="`/usr/bin/cygpath -p ${path4sdk}`"
   1.181 +    fi
   1.182 +    ;;
   1.183 +esac
   1.184 +
   1.185 +# Export PATH setting
   1.186 +PATH="${path4sdk}"
   1.187 +export PATH
   1.188 +

mercurial