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