0N/A#!echo "This is not a shell script"
0N/A#############################################################################
2362N/A# Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved.
0N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A#
0N/A# This code is free software; you can redistribute it and/or modify it
0N/A# under the terms of the GNU General Public License version 2 only, as
0N/A# published by the Free Software Foundation.
0N/A#
0N/A# This code is distributed in the hope that it will be useful, but WITHOUT
0N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A# version 2 for more details (a copy is included in the LICENSE file that
0N/A# accompanied this code).
0N/A#
0N/A# You should have received a copy of the GNU General Public License version
0N/A# 2 along with this work; if not, write to the Free Software Foundation,
0N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A#
2362N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A# or visit www.oracle.com if you need additional information or have any
2362N/A# questions.
0N/A#############################################################################
0N/A#
0N/A# JPRT shell configuration for testing.
0N/A#
0N/A# Input environment variables:
0N/A# Windows Only:
0N/A# PATH
0N/A# ROOTDIR
0N/A#
0N/A# Output variable settings:
0N/A# make Full path to GNU make
0N/A#
0N/A# Output environment variables:
0N/A# PATH
0N/A#
0N/A#############################################################################
0N/A
0N/A#############################################################################
0N/A# Error
0N/Aerror() # message
0N/A{
0N/A echo "ERROR: $1"
0N/A exit 6
0N/A}
0N/A# Directory must exist
0N/AdirMustExist() # dir name
0N/A{
0N/A if [ ! -d "$1" ] ; then
0N/A error "Directory for $2 does not exist: $1"
0N/A fi
0N/A}
0N/A# File must exist
0N/AfileMustExist() # dir name
0N/A{
0N/A if [ ! -f "$1" ] ; then
0N/A error "File for $2 does not exist: $1"
0N/A fi
0N/A}
0N/A#############################################################################
0N/A
0N/A# Should be set by JPRT as the 3 basic inputs
0N/Aslashjava="${ALT_SLASH_JAVA}"
0N/Aif [ "${slashjava}" = "" ] ; then
0N/A slashjava=/java
0N/Afi
0N/A
0N/A# Check input
0N/AdirMustExist "${slashjava}" ALT_SLASH_JAVA
0N/A
0N/A# Uses 'uname -s', but only expect SunOS or Linux, assume Windows otherwise.
0N/Aosname=`uname -s`
0N/Aif [ "${osname}" = SunOS ] ; then
0N/A
0N/A # SOLARIS: Sparc or X86
0N/A osarch=`uname -p`
0N/A if [ "${osarch}" = sparc ] ; then
0N/A solaris_arch=sparc
0N/A else
0N/A solaris_arch=i386
0N/A fi
0N/A
0N/A # Add basic solaris system paths
0N/A path4sdk=/usr/ccs/bin:/usr/ccs/lib:/usr/bin:/bin:/usr/sfw/bin
0N/A
0N/A # Find GNU make
0N/A make=/usr/sfw/bin/gmake
0N/A if [ ! -f ${make} ] ; then
0N/A make=/opt/sfw/bin/gmake
0N/A if [ ! -f ${make} ] ; then
0N/A make=${slashjava}/devtools/${solaris_arch}/bin/gnumake
0N/A fi
0N/A fi
0N/A fileMustExist "${make}" make
0N/A
0N/A # File creation mask
0N/A umask 002
0N/A
0N/Aelif [ "${osname}" = Linux ] ; then
0N/A
0N/A # Add basic paths
0N/A path4sdk=/usr/bin:/bin:/usr/sbin:/sbin
0N/A
0N/A # Find GNU make
0N/A make=/usr/bin/make
0N/A fileMustExist "${make}" make
0N/A
0N/A umask 002
0N/A
0N/Aelse
0N/A
0N/A # Windows: Differs on CYGWIN vs. MKS.
0N/A
0N/A # We need to determine if we are running a CYGWIN shell or an MKS shell
0N/A # (if uname isn't available, then it will be unix_toolset=unknown)
0N/A unix_toolset=unknown
0N/A if [ "`uname -a | fgrep Cygwin`" = "" -a -d "${ROOTDIR}" ] ; then
0N/A # We kind of assume ROOTDIR is where MKS is and it's ok
0N/A unix_toolset=MKS
0N/A mkshome=`dosname -s "${ROOTDIR}"`
0N/A # Most unix utilities are in the mksnt directory of ROOTDIR
0N/A unixcommand_path="${mkshome}/mksnt"
0N/A path4sdk="${unixcommand_path}"
0N/A devtools_path="${slashjava}/devtools/win32/bin"
0N/A path4sdk="${devtools_path};${path4sdk}"
0N/A # Find GNU make
0N/A make="${devtools_path}/gnumake.exe"
0N/A fileMustExist "${make}" make
0N/A elif [ "`uname -a | fgrep Cygwin`" != "" -a -f /bin/cygpath ] ; then
0N/A # For CYGWIN, uname will have "Cygwin" in it, and /bin/cygpath should exist
0N/A unix_toolset=CYGWIN
0N/A # Most unix utilities are in the /usr/bin
0N/A unixcommand_path="/usr/bin"
0N/A path4sdk="${unixcommand_path}"
0N/A # Find GNU make
0N/A make="${unixcommand_path}/make.exe"
0N/A fileMustExist "${make}" make
0N/A else
0N/A echo "WARNING: Cannot figure out if this is MKS or CYGWIN"
0N/A fi
0N/A
0N/A
0N/A # For windows, it's hard to know where the system is, so we just add this
0N/A # to PATH.
0N/A slash_path="`echo ${path4sdk} | sed -e 's@\\\\@/@g' -e 's@//@/@g' -e 's@/$@@' -e 's@/;@;@g'`"
0N/A path4sdk="${slash_path};${PATH}"
0N/A
0N/A # Convert path4sdk to cygwin style
0N/A if [ "${unix_toolset}" = CYGWIN ] ; then
0N/A path4sdk="`/usr/bin/cygpath -p ${path4sdk}`"
0N/A fi
0N/A
0N/Afi
0N/A
0N/A# Export PATH setting
0N/APATH="${path4sdk}"
0N/Aexport PATH
0N/A