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