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