annotate make/jprt.config @ 101:ae2a1418f0c8

Added tag jdk7-b35 for changeset 81f66dd906eb
author xdono
date Thu, 11 Sep 2008 11:26:00 -0700
parents
children
rev   line source
duke@0 1 #!echo "This is not a shell script"
duke@0 2 #############################################################################
duke@0 3 #
duke@0 4 # Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
duke@0 5 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@0 6 #
duke@0 7 # This code is free software; you can redistribute it and/or modify it
duke@0 8 # under the terms of the GNU General Public License version 2 only, as
duke@0 9 # published by the Free Software Foundation. Sun designates this
duke@0 10 # particular file as subject to the "Classpath" exception as provided
duke@0 11 # by Sun in the LICENSE file that accompanied this code.
duke@0 12 #
duke@0 13 # This code is distributed in the hope that it will be useful, but WITHOUT
duke@0 14 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@0 15 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@0 16 # version 2 for more details (a copy is included in the LICENSE file that
duke@0 17 # accompanied this code).
duke@0 18 #
duke@0 19 # You should have received a copy of the GNU General Public License version
duke@0 20 # 2 along with this work; if not, write to the Free Software Foundation,
duke@0 21 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@0 22 #
duke@0 23 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
duke@0 24 # CA 95054 USA or visit www.sun.com if you need additional information or
duke@0 25 # have any questions.
duke@0 26 #
duke@0 27 #############################################################################
duke@0 28 #
duke@0 29 # JPRT shell configuration for building.
duke@0 30 #
duke@0 31 # Input environment variables:
duke@0 32 # ALT_BOOTDIR
duke@0 33 # ALT_SLASH_JAVA
duke@0 34 # ALT_JDK_IMPORT_PATH
duke@0 35 # Windows Only:
duke@0 36 # PATH
duke@0 37 # PROCESSOR_IDENTIFIER
duke@0 38 # ROOTDIR
duke@0 39 #
duke@0 40 # Output variable settings:
duke@0 41 # make Full path to GNU make
duke@0 42 #
duke@0 43 # Output environment variables:
duke@0 44 # PATH
duke@0 45 # Windows Only:
duke@0 46 # ALT_DEVTOOLS_PATH (To avoid the C:/UTILS default)
duke@0 47 #
duke@0 48 # After JDK6, most settings will be found via ALT_SLASH_JAVA or
duke@0 49 # by way of other system environment variables. If this was JDK5
duke@0 50 # or an older JDK, you might need to export more ALT_* variables.
duke@0 51 #
duke@0 52 #############################################################################
duke@0 53
duke@0 54 #############################################################################
duke@0 55 # Error
duke@0 56 error() # message
duke@0 57 {
duke@0 58 echo "ERROR: $1"
duke@0 59 exit 6
duke@0 60 }
duke@0 61 # Directory must exist
duke@0 62 dirMustExist() # dir name
duke@0 63 {
duke@0 64 if [ ! -d "$1" ] ; then
duke@0 65 error "Directory for $2 does not exist: $1"
duke@0 66 fi
duke@0 67 }
duke@0 68 # File must exist
duke@0 69 fileMustExist() # dir name
duke@0 70 {
duke@0 71 if [ ! -f "$1" ] ; then
duke@0 72 error "File for $2 does not exist: $1"
duke@0 73 fi
duke@0 74 }
duke@0 75 #############################################################################
duke@0 76
duke@0 77 # Should be set by JPRT as the 3 basic inputs
duke@0 78 bootdir="${ALT_BOOTDIR}"
duke@0 79 slashjava="${ALT_SLASH_JAVA}"
duke@0 80 jdk_import="${ALT_JDK_IMPORT_PATH}"
duke@0 81
duke@0 82 # Check input
duke@0 83 dirMustExist "${bootdir}" ALT_BOOTDIR
duke@0 84 dirMustExist "${slashjava}" ALT_SLASH_JAVA
duke@0 85 dirMustExist "${jdk_import}" ALT_JDK_IMPORT_PATH
duke@0 86
duke@0 87 # Uses 'uname -s', but only expect SunOS or Linux, assume Windows otherwise.
duke@0 88 osname=`uname -s`
duke@0 89 if [ "${osname}" = SunOS ] ; then
duke@0 90
duke@0 91 # SOLARIS: Sparc or X86
duke@0 92 osarch=`uname -p`
duke@0 93 if [ "${osarch}" = sparc ] ; then
duke@0 94 solaris_arch=sparc
duke@0 95 else
duke@0 96 solaris_arch=i386
duke@0 97 fi
duke@0 98
duke@0 99 # Add basic solaris system paths
duke@0 100 path4sdk=/usr/ccs/bin:/usr/ccs/lib:/usr/bin:/bin:/usr/sfw/bin
duke@0 101
duke@0 102 # Get the previous JDK to be used to bootstrap the build
duke@0 103 path4sdk=${bootdir}/bin:${path4sdk}
duke@0 104
duke@0 105 # Ant
duke@0 106 ANT_HOME=${slashjava}/devtools/share/ant/1.7.0
duke@0 107 export ANT_HOME
duke@0 108 antbindir=${ANT_HOME}/bin
duke@0 109 fileMustExist "${antbindir}/ant" ant
duke@0 110 path4sdk=${antbindir}:${path4sdk}
duke@0 111
duke@0 112 # Find GNU make
duke@0 113 make=/usr/sfw/bin/gmake
duke@0 114 if [ ! -f ${make} ] ; then
duke@0 115 make=/opt/sfw/bin/gmake
duke@0 116 if [ ! -f ${make} ] ; then
duke@0 117 make=${slashjava}/devtools/${solaris_arch}/bin/gnumake
duke@0 118 fi
duke@0 119 fi
duke@0 120 fileMustExist "${make}" make
duke@0 121
duke@0 122 # File creation mask
duke@0 123 umask 002
duke@0 124
duke@0 125 elif [ "${osname}" = Linux ] ; then
duke@0 126
duke@0 127 # LINUX: X86, AMD64
duke@0 128 osarch=`uname -m`
duke@0 129 if [ "${osarch}" = i686 ] ; then
duke@0 130 linux_arch=i586
duke@0 131 elif [ "${osarch}" = x86_64 ] ; then
duke@0 132 linux_arch=amd64
duke@0 133 fi
duke@0 134
duke@0 135 # Add basic paths
duke@0 136 path4sdk=/usr/bin:/bin:/usr/sbin:/sbin
duke@0 137
duke@0 138 # Get the previous JDK to be used to bootstrap the build
duke@0 139 path4sdk=${bootdir}/bin:${path4sdk}
duke@0 140
duke@0 141 # Ant
duke@0 142 ANT_HOME=${slashjava}/devtools/share/ant/1.7.0
duke@0 143 export ANT_HOME
duke@0 144 antbindir=${ANT_HOME}/bin
duke@0 145 fileMustExist "${antbindir}/ant" ant
duke@0 146 path4sdk=${antbindir}:${path4sdk}
duke@0 147
duke@0 148 # Find GNU make
duke@0 149 make=/usr/bin/make
duke@0 150 fileMustExist "${make}" make
duke@0 151
duke@0 152 umask 002
duke@0 153
duke@0 154 else
duke@0 155
duke@0 156 # Windows: Differs on CYGWIN vs. MKS
duke@0 157 # Also, blanks in pathnames gives GNU make headaches, so anything placed
duke@0 158 # in any ALT_* variable should be the short windows dosname.
duke@0 159
duke@0 160 # WINDOWS: Install and use MKS or CYGWIN (should have already been done)
duke@0 161 # Assumption here is that you are in a shell window via MKS or cygwin.
duke@0 162 # MKS install should have defined the environment variable ROOTDIR.
duke@0 163 # We also need to figure out which one we have: X86, AMD64
duke@0 164 if [ "`echo ${PROCESSOR_IDENTIFIER} | fgrep AMD64`" != "" ] ; then
duke@0 165 windows_arch=amd64
duke@0 166 else
duke@0 167 windows_arch=i586
duke@0 168 fi
duke@0 169
duke@0 170 # We need to determine if we are running a CYGWIN shell or an MKS shell
duke@0 171 # (if uname isn't available, then it will be unix_toolset=unknown)
duke@0 172 unix_toolset=unknown
duke@0 173 if [ "`uname -a | fgrep Cygwin`" = "" -a -d "${ROOTDIR}" ] ; then
duke@0 174 # We kind of assume ROOTDIR is where MKS is and it's ok
duke@0 175 unix_toolset=MKS
duke@0 176 mkshome=`dosname -s "${ROOTDIR}"`
duke@0 177 # Utility to convert to short pathnames without spaces
duke@0 178 dosname="${mkshome}/mksnt/dosname -s"
duke@0 179 # Most unix utilities are in the mksnt directory of ROOTDIR
duke@0 180 unixcommand_path="${mkshome}/mksnt"
duke@0 181 path4sdk="${unixcommand_path}"
duke@0 182 dirMustExist "${unixcommand_path}" ALT_UNIXCOMMAND_PATH
duke@0 183 devtools_path="${slashjava}/devtools/win32/bin"
duke@0 184 path4sdk="${devtools_path};${path4sdk}"
duke@0 185 # Normally this need not be set, but on Windows it's default is C:/UTILS
duke@0 186 ALT_DEVTOOLS_PATH="${devtools_path}"
duke@0 187 export ALT_DEVTOOLS_PATH
duke@0 188 dirMustExist "${devtools_path}" ALT_DEVTOOLS_PATH
duke@0 189 # Find GNU make
duke@0 190 make="${devtools_path}/gnumake.exe"
duke@0 191 fileMustExist "${make}" make
duke@0 192 elif [ "`uname -a | fgrep Cygwin`" != "" -a -f /bin/cygpath ] ; then
duke@0 193 # For CYGWIN, uname will have "Cygwin" in it, and /bin/cygpath should exist
duke@0 194 unix_toolset=CYGWIN
duke@0 195 # Utility to convert to short pathnames without spaces
duke@0 196 dosname="/usr/bin/cygpath -a -m -s"
duke@0 197 # Most unix utilities are in the /usr/bin
duke@0 198 unixcommand_path="/usr/bin"
duke@0 199 path4sdk="${unixcommand_path}"
duke@0 200 dirMustExist "${unixcommand_path}" ALT_UNIXCOMMAND_PATH
duke@0 201 # Find GNU make
duke@0 202 make="${unixcommand_path}/make.exe"
duke@0 203 fileMustExist "${make}" make
duke@0 204 else
duke@0 205 echo "WARNING: Cannot figure out if this is MKS or CYGWIN"
duke@0 206 fi
duke@0 207
duke@0 208 # WINDOWS: Get the previous JDK to be used to bootstrap the build
duke@0 209 path4sdk="${bootdir}/bin;${path4sdk}"
duke@0 210
duke@0 211 # Ant
duke@0 212 ANT_HOME=${slashjava}/devtools/share/ant/1.7.0
duke@0 213 export ANT_HOME
duke@0 214 antbindir=${ANT_HOME}/bin
duke@0 215 fileMustExist "${antbindir}/ant" ant
duke@0 216 path4sdk="${antbindir};${path4sdk}"
duke@0 217
duke@0 218 # Turn all \\ into /, remove duplicates and trailing /
duke@0 219 slash_path="`echo ${path4sdk} | sed -e 's@\\\\@/@g' -e 's@//@/@g' -e 's@/$@@' -e 's@/;@;@g'`"
duke@0 220
duke@0 221 # For windows, it's hard to know where the system is, so we just add this
duke@0 222 # to PATH.
duke@0 223 path4sdk="${slash_path};${PATH}"
duke@0 224
duke@0 225 # Convert path4sdk to cygwin style
duke@0 226 if [ "${unix_toolset}" = CYGWIN ] ; then
duke@0 227 path4sdk="`/usr/bin/cygpath -p ${path4sdk}`"
duke@0 228 fi
duke@0 229
duke@0 230 fi
duke@0 231
duke@0 232 # Export PATH setting
duke@0 233 PATH="${path4sdk}"
duke@0 234 export PATH
duke@0 235
duke@0 236 # Things we need to unset
duke@0 237 unset LD_LIBRARY_PATH
duke@0 238 unset LD_LIBRARY_PATH_32
duke@0 239 unset LD_LIBRARY_PATH_64
duke@0 240 unset JAVA_HOME
duke@0 241