1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/make/jprt.config Sat Dec 01 00:00:00 2007 +0000 1.3 @@ -0,0 +1,241 @@ 1.4 +#!echo "This is not a shell script" 1.5 +############################################################################# 1.6 +# 1.7 +# Copyright 2006 Sun Microsystems, Inc. All Rights Reserved. 1.8 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.9 +# 1.10 +# This code is free software; you can redistribute it and/or modify it 1.11 +# under the terms of the GNU General Public License version 2 only, as 1.12 +# published by the Free Software Foundation. Sun designates this 1.13 +# particular file as subject to the "Classpath" exception as provided 1.14 +# by Sun in the LICENSE file that accompanied this code. 1.15 +# 1.16 +# This code is distributed in the hope that it will be useful, but WITHOUT 1.17 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.18 +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.19 +# version 2 for more details (a copy is included in the LICENSE file that 1.20 +# accompanied this code). 1.21 +# 1.22 +# You should have received a copy of the GNU General Public License version 1.23 +# 2 along with this work; if not, write to the Free Software Foundation, 1.24 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.25 +# 1.26 +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 1.27 +# CA 95054 USA or visit www.sun.com if you need additional information or 1.28 +# have any questions. 1.29 +# 1.30 +############################################################################# 1.31 +# 1.32 +# JPRT shell configuration for building. 1.33 +# 1.34 +# Input environment variables: 1.35 +# ALT_BOOTDIR 1.36 +# ALT_SLASH_JAVA 1.37 +# ALT_JDK_IMPORT_PATH 1.38 +# Windows Only: 1.39 +# PATH 1.40 +# PROCESSOR_IDENTIFIER 1.41 +# ROOTDIR 1.42 +# 1.43 +# Output variable settings: 1.44 +# make Full path to GNU make 1.45 +# 1.46 +# Output environment variables: 1.47 +# PATH 1.48 +# Windows Only: 1.49 +# ALT_DEVTOOLS_PATH (To avoid the C:/UTILS default) 1.50 +# 1.51 +# After JDK6, most settings will be found via ALT_SLASH_JAVA or 1.52 +# by way of other system environment variables. If this was JDK5 1.53 +# or an older JDK, you might need to export more ALT_* variables. 1.54 +# 1.55 +############################################################################# 1.56 + 1.57 +############################################################################# 1.58 +# Error 1.59 +error() # message 1.60 +{ 1.61 + echo "ERROR: $1" 1.62 + exit 6 1.63 +} 1.64 +# Directory must exist 1.65 +dirMustExist() # dir name 1.66 +{ 1.67 + if [ ! -d "$1" ] ; then 1.68 + error "Directory for $2 does not exist: $1" 1.69 + fi 1.70 +} 1.71 +# File must exist 1.72 +fileMustExist() # dir name 1.73 +{ 1.74 + if [ ! -f "$1" ] ; then 1.75 + error "File for $2 does not exist: $1" 1.76 + fi 1.77 +} 1.78 +############################################################################# 1.79 + 1.80 +# Should be set by JPRT as the 3 basic inputs 1.81 +bootdir="${ALT_BOOTDIR}" 1.82 +slashjava="${ALT_SLASH_JAVA}" 1.83 +jdk_import="${ALT_JDK_IMPORT_PATH}" 1.84 + 1.85 +# Check input 1.86 +dirMustExist "${bootdir}" ALT_BOOTDIR 1.87 +dirMustExist "${slashjava}" ALT_SLASH_JAVA 1.88 +dirMustExist "${jdk_import}" ALT_JDK_IMPORT_PATH 1.89 + 1.90 +# Uses 'uname -s', but only expect SunOS or Linux, assume Windows otherwise. 1.91 +osname=`uname -s` 1.92 +if [ "${osname}" = SunOS ] ; then 1.93 + 1.94 + # SOLARIS: Sparc or X86 1.95 + osarch=`uname -p` 1.96 + if [ "${osarch}" = sparc ] ; then 1.97 + solaris_arch=sparc 1.98 + else 1.99 + solaris_arch=i386 1.100 + fi 1.101 + 1.102 + # Add basic solaris system paths 1.103 + path4sdk=/usr/ccs/bin:/usr/ccs/lib:/usr/bin:/bin:/usr/sfw/bin 1.104 + 1.105 + # Get the previous JDK to be used to bootstrap the build 1.106 + path4sdk=${bootdir}/bin:${path4sdk} 1.107 + 1.108 + # Ant 1.109 + ANT_HOME=${slashjava}/devtools/share/ant/1.7.0 1.110 + export ANT_HOME 1.111 + antbindir=${ANT_HOME}/bin 1.112 + fileMustExist "${antbindir}/ant" ant 1.113 + path4sdk=${antbindir}:${path4sdk} 1.114 + 1.115 + # Find GNU make 1.116 + make=/usr/sfw/bin/gmake 1.117 + if [ ! -f ${make} ] ; then 1.118 + make=/opt/sfw/bin/gmake 1.119 + if [ ! -f ${make} ] ; then 1.120 + make=${slashjava}/devtools/${solaris_arch}/bin/gnumake 1.121 + fi 1.122 + fi 1.123 + fileMustExist "${make}" make 1.124 + 1.125 + # File creation mask 1.126 + umask 002 1.127 + 1.128 +elif [ "${osname}" = Linux ] ; then 1.129 + 1.130 + # LINUX: X86, AMD64 1.131 + osarch=`uname -m` 1.132 + if [ "${osarch}" = i686 ] ; then 1.133 + linux_arch=i586 1.134 + elif [ "${osarch}" = x86_64 ] ; then 1.135 + linux_arch=amd64 1.136 + fi 1.137 + 1.138 + # Add basic paths 1.139 + path4sdk=/usr/bin:/bin:/usr/sbin:/sbin 1.140 + 1.141 + # Get the previous JDK to be used to bootstrap the build 1.142 + path4sdk=${bootdir}/bin:${path4sdk} 1.143 + 1.144 + # Ant 1.145 + ANT_HOME=${slashjava}/devtools/share/ant/1.7.0 1.146 + export ANT_HOME 1.147 + antbindir=${ANT_HOME}/bin 1.148 + fileMustExist "${antbindir}/ant" ant 1.149 + path4sdk=${antbindir}:${path4sdk} 1.150 + 1.151 + # Find GNU make 1.152 + make=/usr/bin/make 1.153 + fileMustExist "${make}" make 1.154 + 1.155 + umask 002 1.156 + 1.157 +else 1.158 + 1.159 + # Windows: Differs on CYGWIN vs. MKS 1.160 + # Also, blanks in pathnames gives GNU make headaches, so anything placed 1.161 + # in any ALT_* variable should be the short windows dosname. 1.162 + 1.163 + # WINDOWS: Install and use MKS or CYGWIN (should have already been done) 1.164 + # Assumption here is that you are in a shell window via MKS or cygwin. 1.165 + # MKS install should have defined the environment variable ROOTDIR. 1.166 + # We also need to figure out which one we have: X86, AMD64 1.167 + if [ "`echo ${PROCESSOR_IDENTIFIER} | fgrep AMD64`" != "" ] ; then 1.168 + windows_arch=amd64 1.169 + else 1.170 + windows_arch=i586 1.171 + fi 1.172 + 1.173 + # We need to determine if we are running a CYGWIN shell or an MKS shell 1.174 + # (if uname isn't available, then it will be unix_toolset=unknown) 1.175 + unix_toolset=unknown 1.176 + if [ "`uname -a | fgrep Cygwin`" = "" -a -d "${ROOTDIR}" ] ; then 1.177 + # We kind of assume ROOTDIR is where MKS is and it's ok 1.178 + unix_toolset=MKS 1.179 + mkshome=`dosname -s "${ROOTDIR}"` 1.180 + # Utility to convert to short pathnames without spaces 1.181 + dosname="${mkshome}/mksnt/dosname -s" 1.182 + # Most unix utilities are in the mksnt directory of ROOTDIR 1.183 + unixcommand_path="${mkshome}/mksnt" 1.184 + path4sdk="${unixcommand_path}" 1.185 + dirMustExist "${unixcommand_path}" ALT_UNIXCOMMAND_PATH 1.186 + devtools_path="${slashjava}/devtools/win32/bin" 1.187 + path4sdk="${devtools_path};${path4sdk}" 1.188 + # Normally this need not be set, but on Windows it's default is C:/UTILS 1.189 + ALT_DEVTOOLS_PATH="${devtools_path}" 1.190 + export ALT_DEVTOOLS_PATH 1.191 + dirMustExist "${devtools_path}" ALT_DEVTOOLS_PATH 1.192 + # Find GNU make 1.193 + make="${devtools_path}/gnumake.exe" 1.194 + fileMustExist "${make}" make 1.195 + elif [ "`uname -a | fgrep Cygwin`" != "" -a -f /bin/cygpath ] ; then 1.196 + # For CYGWIN, uname will have "Cygwin" in it, and /bin/cygpath should exist 1.197 + unix_toolset=CYGWIN 1.198 + # Utility to convert to short pathnames without spaces 1.199 + dosname="/usr/bin/cygpath -a -m -s" 1.200 + # Most unix utilities are in the /usr/bin 1.201 + unixcommand_path="/usr/bin" 1.202 + path4sdk="${unixcommand_path}" 1.203 + dirMustExist "${unixcommand_path}" ALT_UNIXCOMMAND_PATH 1.204 + # Find GNU make 1.205 + make="${unixcommand_path}/make.exe" 1.206 + fileMustExist "${make}" make 1.207 + else 1.208 + echo "WARNING: Cannot figure out if this is MKS or CYGWIN" 1.209 + fi 1.210 + 1.211 + # WINDOWS: Get the previous JDK to be used to bootstrap the build 1.212 + path4sdk="${bootdir}/bin;${path4sdk}" 1.213 + 1.214 + # Ant 1.215 + ANT_HOME=${slashjava}/devtools/share/ant/1.7.0 1.216 + export ANT_HOME 1.217 + antbindir=${ANT_HOME}/bin 1.218 + fileMustExist "${antbindir}/ant" ant 1.219 + path4sdk="${antbindir};${path4sdk}" 1.220 + 1.221 + # Turn all \\ into /, remove duplicates and trailing / 1.222 + slash_path="`echo ${path4sdk} | sed -e 's@\\\\@/@g' -e 's@//@/@g' -e 's@/$@@' -e 's@/;@;@g'`" 1.223 + 1.224 + # For windows, it's hard to know where the system is, so we just add this 1.225 + # to PATH. 1.226 + path4sdk="${slash_path};${PATH}" 1.227 + 1.228 + # Convert path4sdk to cygwin style 1.229 + if [ "${unix_toolset}" = CYGWIN ] ; then 1.230 + path4sdk="`/usr/bin/cygpath -p ${path4sdk}`" 1.231 + fi 1.232 + 1.233 +fi 1.234 + 1.235 +# Export PATH setting 1.236 +PATH="${path4sdk}" 1.237 +export PATH 1.238 + 1.239 +# Things we need to unset 1.240 +unset LD_LIBRARY_PATH 1.241 +unset LD_LIBRARY_PATH_32 1.242 +unset LD_LIBRARY_PATH_64 1.243 +unset JAVA_HOME 1.244 +