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