Fri, 20 Jun 2008 08:44:55 -0700
Added tag jdk7-b29 for changeset 8b71960f79ce
duke@1 | 1 | #!echo "This is not a shell script" |
duke@1 | 2 | ############################################################################# |
duke@1 | 3 | # |
duke@1 | 4 | # Copyright 2006-2007 Sun Microsystems, Inc. All Rights Reserved. |
duke@1 | 5 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
duke@1 | 6 | # |
duke@1 | 7 | # This code is free software; you can redistribute it and/or modify it |
duke@1 | 8 | # under the terms of the GNU General Public License version 2 only, as |
duke@1 | 9 | # published by the Free Software Foundation. Sun designates this |
duke@1 | 10 | # particular file as subject to the "Classpath" exception as provided |
duke@1 | 11 | # by Sun in the LICENSE file that accompanied this code. |
duke@1 | 12 | # |
duke@1 | 13 | # This code is distributed in the hope that it will be useful, but WITHOUT |
duke@1 | 14 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
duke@1 | 15 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
duke@1 | 16 | # version 2 for more details (a copy is included in the LICENSE file that |
duke@1 | 17 | # accompanied this code). |
duke@1 | 18 | # |
duke@1 | 19 | # You should have received a copy of the GNU General Public License version |
duke@1 | 20 | # 2 along with this work; if not, write to the Free Software Foundation, |
duke@1 | 21 | # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
duke@1 | 22 | # |
duke@1 | 23 | # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
duke@1 | 24 | # CA 95054 USA or visit www.sun.com if you need additional information or |
duke@1 | 25 | # have any questions. |
duke@1 | 26 | # |
duke@1 | 27 | ############################################################################# |
duke@1 | 28 | # |
duke@1 | 29 | # JPRT shell configuration for building. |
duke@1 | 30 | # |
duke@1 | 31 | # Input environment variables: |
duke@1 | 32 | # ALT_BOOTDIR |
duke@1 | 33 | # ALT_SLASH_JAVA |
duke@1 | 34 | # ALT_JDK_IMPORT_PATH |
duke@1 | 35 | # Windows Only: |
duke@1 | 36 | # PATH |
duke@1 | 37 | # VS71COMNTOOLS |
duke@1 | 38 | # PROCESSOR_IDENTIFIER |
duke@1 | 39 | # ROOTDIR |
duke@1 | 40 | # |
duke@1 | 41 | # Output variable settings: |
duke@1 | 42 | # make Full path to GNU make |
duke@1 | 43 | # compiler_path Path to compiler bin directory |
duke@1 | 44 | # compiler_name Unique name of this compiler |
duke@1 | 45 | # |
duke@1 | 46 | # Output environment variables: |
duke@1 | 47 | # PATH |
duke@1 | 48 | # ALT_COMPILER_PATH |
duke@1 | 49 | # Windows Only: |
duke@1 | 50 | # ALT_MSDEVTOOLS_PATH |
duke@1 | 51 | # ALT_DEVTOOLS_PATH (To avoid the C:/UTILS default) |
duke@1 | 52 | # LIB |
duke@1 | 53 | # INCLUDE |
duke@1 | 54 | # |
duke@1 | 55 | # After JDK6, most settings will be found via ALT_SLASH_JAVA or |
duke@1 | 56 | # by way of other system environment variables. If this was JDK5 |
duke@1 | 57 | # or an older JDK, you might need to export more ALT_* variables. |
duke@1 | 58 | # |
duke@1 | 59 | # On Windows AMD64, if MSSDK is not set, assumes Platform SDK is installed at: |
duke@1 | 60 | # C:/Program Files/Microsoft Platform SDK |
duke@1 | 61 | # |
duke@1 | 62 | ############################################################################# |
duke@1 | 63 | |
duke@1 | 64 | ############################################################################# |
duke@1 | 65 | # Error |
duke@1 | 66 | error() # message |
duke@1 | 67 | { |
duke@1 | 68 | echo "ERROR: $1" |
duke@1 | 69 | exit 6 |
duke@1 | 70 | } |
duke@1 | 71 | # Directory must exist |
duke@1 | 72 | dirMustExist() # dir name |
duke@1 | 73 | { |
duke@1 | 74 | if [ ! -d "$1" ] ; then |
duke@1 | 75 | error "Directory for $2 does not exist: $1" |
duke@1 | 76 | fi |
duke@1 | 77 | } |
duke@1 | 78 | # File must exist |
duke@1 | 79 | fileMustExist() # dir name |
duke@1 | 80 | { |
duke@1 | 81 | if [ ! -f "$1" ] ; then |
duke@1 | 82 | error "File for $2 does not exist: $1" |
duke@1 | 83 | fi |
duke@1 | 84 | } |
duke@1 | 85 | ############################################################################# |
duke@1 | 86 | |
duke@1 | 87 | # Should be set by JPRT as the 3 basic inputs |
duke@1 | 88 | bootdir="${ALT_BOOTDIR}" |
duke@1 | 89 | slashjava="${ALT_SLASH_JAVA}" |
duke@1 | 90 | jdk_import="${ALT_JDK_IMPORT_PATH}" |
duke@1 | 91 | |
duke@1 | 92 | # The /java/devtools items |
duke@1 | 93 | jdk_devtools="${slashjava}/devtools" |
duke@1 | 94 | share="${jdk_devtools}/share" |
duke@1 | 95 | |
duke@1 | 96 | # Needed for langtools, maybe other parts of the build |
duke@1 | 97 | ANT_HOME="${share}/ant/latest" |
duke@1 | 98 | export ANT_HOME |
duke@1 | 99 | FINDBUGS_HOME="${share}/findbugs/latest" |
duke@1 | 100 | export FINDBUGS_HOME |
duke@1 | 101 | |
duke@1 | 102 | # The 3 bin directories in common to all platforms |
duke@1 | 103 | sharebin="${share}/bin" |
duke@1 | 104 | antbin="${ANT_HOME}/bin" |
duke@1 | 105 | findbugsbin="${FINDBUGS_HOME}/bin" |
duke@1 | 106 | |
duke@1 | 107 | # Check input |
duke@1 | 108 | dirMustExist "${bootdir}" ALT_BOOTDIR |
duke@1 | 109 | dirMustExist "${slashjava}" ALT_SLASH_JAVA |
duke@1 | 110 | dirMustExist "${jdk_import}" ALT_JDK_IMPORT_PATH |
duke@1 | 111 | dirMustExist "${ANT_HOME}" ANT_HOME |
duke@1 | 112 | dirMustExist "${FINDBUGS_HOME}" FINDBUGS_HOME |
duke@1 | 113 | |
duke@1 | 114 | # Uses 'uname -s', but only expect SunOS or Linux, assume Windows otherwise. |
duke@1 | 115 | osname=`uname -s` |
duke@1 | 116 | if [ "${osname}" = SunOS ] ; then |
duke@1 | 117 | |
duke@1 | 118 | # SOLARIS: Sparc or X86 |
duke@1 | 119 | osarch=`uname -p` |
duke@1 | 120 | if [ "${osarch}" = sparc ] ; then |
duke@1 | 121 | solaris_arch=sparc |
duke@1 | 122 | else |
duke@1 | 123 | solaris_arch=i386 |
duke@1 | 124 | fi |
duke@1 | 125 | |
ohair@10 | 126 | # Get the compilers into path (make sure it matches ALT setting) |
ohair@10 | 127 | if [ "${JPRT_SOLARIS_COMPILER_NAME}" != "" ] ; then |
ohair@10 | 128 | compiler_name=${JPRT_SOLARIS_COMPILER_NAME} |
ohair@10 | 129 | else |
ohair@10 | 130 | # FIXUP: Change to SS12 when validated |
ohair@10 | 131 | #compiler_name=SS12 |
ohair@10 | 132 | compiler_name=SS11 |
ohair@10 | 133 | fi |
ohair@10 | 134 | compiler_path=${jdk_devtools}/${solaris_arch}/SUNWspro/${compiler_name}/bin |
duke@1 | 135 | ALT_COMPILER_PATH="${compiler_path}" |
duke@1 | 136 | export ALT_COMPILER_PATH |
duke@1 | 137 | dirMustExist "${compiler_path}" ALT_COMPILER_PATH |
duke@1 | 138 | path4sdk=${compiler_path}:${sharebin}:${antbin}:${findbugsbin} |
duke@1 | 139 | |
duke@1 | 140 | # Add basic solaris system paths |
duke@1 | 141 | path4sdk=${path4sdk}:/usr/ccs/bin:/usr/ccs/lib:/usr/bin:/bin:/usr/sfw/bin |
duke@1 | 142 | |
duke@1 | 143 | # Get the previous JDK to be used to bootstrap the build |
duke@1 | 144 | path4sdk=${bootdir}/bin:${path4sdk} |
duke@1 | 145 | |
duke@1 | 146 | # Find GNU make |
duke@1 | 147 | make=/usr/sfw/bin/gmake |
duke@1 | 148 | if [ ! -f ${make} ] ; then |
duke@1 | 149 | make=/opt/sfw/bin/gmake |
duke@1 | 150 | if [ ! -f ${make} ] ; then |
duke@1 | 151 | make=${jdk_devtools}/${solaris_arch}/bin/gnumake |
duke@1 | 152 | fi |
duke@1 | 153 | fi |
duke@1 | 154 | fileMustExist "${make}" make |
duke@1 | 155 | |
duke@1 | 156 | # File creation mask |
duke@1 | 157 | umask 002 |
duke@1 | 158 | |
duke@1 | 159 | elif [ "${osname}" = Linux ] ; then |
duke@1 | 160 | |
duke@1 | 161 | # LINUX: X86, AMD64 |
duke@1 | 162 | osarch=`uname -m` |
duke@1 | 163 | if [ "${osarch}" = i686 ] ; then |
duke@1 | 164 | linux_arch=i586 |
duke@1 | 165 | elif [ "${osarch}" = x86_64 ] ; then |
duke@1 | 166 | linux_arch=amd64 |
duke@1 | 167 | fi |
duke@1 | 168 | |
duke@1 | 169 | # Get the compilers into path (make sure it matches ALT setting) |
duke@1 | 170 | compiler_path=/usr/bin |
duke@1 | 171 | compiler_name=usr_bin |
duke@1 | 172 | ALT_COMPILER_PATH="${compiler_path}" |
duke@1 | 173 | export ALT_COMPILER_PATH |
duke@1 | 174 | dirMustExist "${compiler_path}" ALT_COMPILER_PATH |
duke@1 | 175 | path4sdk=${compiler_path}:${sharebin}:${antbin}:${findbugsbin} |
duke@1 | 176 | |
duke@1 | 177 | # Add basic paths |
duke@1 | 178 | path4sdk=${path4sdk}:/usr/bin:/bin:/usr/sbin:/sbin |
duke@1 | 179 | |
duke@1 | 180 | # Get the previous JDK to be used to bootstrap the build |
duke@1 | 181 | path4sdk=${bootdir}/bin:${path4sdk} |
duke@1 | 182 | |
duke@1 | 183 | # Find GNU make |
duke@1 | 184 | make=/usr/bin/make |
duke@1 | 185 | fileMustExist "${make}" make |
duke@1 | 186 | |
duke@1 | 187 | umask 002 |
duke@1 | 188 | |
duke@1 | 189 | else |
duke@1 | 190 | |
duke@1 | 191 | # Windows: Differs on CYGWIN vs. MKS, and the compiler available. |
duke@1 | 192 | # Also, blanks in pathnames gives GNU make headaches, so anything placed |
duke@1 | 193 | # in any ALT_* variable should be the short windows dosname. |
duke@1 | 194 | |
duke@1 | 195 | # WINDOWS: Install and use MKS or CYGWIN (should have already been done) |
duke@1 | 196 | # Assumption here is that you are in a shell window via MKS or cygwin. |
duke@1 | 197 | # MKS install should have defined the environment variable ROOTDIR. |
duke@1 | 198 | # We also need to figure out which one we have: X86, AMD64 |
duke@1 | 199 | if [ "`echo ${PROCESSOR_IDENTIFIER} | fgrep AMD64`" != "" ] ; then |
duke@1 | 200 | windows_arch=amd64 |
duke@1 | 201 | else |
duke@1 | 202 | windows_arch=i586 |
duke@1 | 203 | fi |
duke@1 | 204 | |
duke@1 | 205 | # We need to determine if we are running a CYGWIN shell or an MKS shell |
duke@1 | 206 | # (if uname isn't available, then it will be unix_toolset=unknown) |
duke@1 | 207 | unix_toolset=unknown |
duke@1 | 208 | if [ "`uname -a | fgrep Cygwin`" = "" -a -d "${ROOTDIR}" ] ; then |
duke@1 | 209 | # We kind of assume ROOTDIR is where MKS is and it's ok |
duke@1 | 210 | unix_toolset=MKS |
duke@1 | 211 | mkshome=`dosname -s "${ROOTDIR}"` |
duke@1 | 212 | # Utility to convert to short pathnames without spaces |
duke@1 | 213 | dosname="${mkshome}/mksnt/dosname -s" |
duke@1 | 214 | # Most unix utilities are in the mksnt directory of ROOTDIR |
duke@1 | 215 | unixcommand_path="${mkshome}/mksnt" |
duke@1 | 216 | path4sdk="${sharebin};${antbin};${findbugsbin};${unixcommand_path}" |
duke@1 | 217 | dirMustExist "${unixcommand_path}" ALT_UNIXCOMMAND_PATH |
duke@1 | 218 | devtools_path="${jdk_devtools}/win32/bin" |
duke@1 | 219 | path4sdk="${devtools_path};${path4sdk}" |
duke@1 | 220 | # Normally this need not be set, but on Windows it's default is C:/UTILS |
duke@1 | 221 | ALT_DEVTOOLS_PATH="${devtools_path}" |
duke@1 | 222 | export ALT_DEVTOOLS_PATH |
duke@1 | 223 | dirMustExist "${devtools_path}" ALT_DEVTOOLS_PATH |
duke@1 | 224 | # Find GNU make |
duke@1 | 225 | make="${devtools_path}/gnumake.exe" |
duke@1 | 226 | fileMustExist "${make}" make |
duke@1 | 227 | elif [ "`uname -a | fgrep Cygwin`" != "" -a -f /bin/cygpath ] ; then |
duke@1 | 228 | # For CYGWIN, uname will have "Cygwin" in it, and /bin/cygpath should exist |
duke@1 | 229 | unix_toolset=CYGWIN |
duke@1 | 230 | # Utility to convert to short pathnames without spaces |
duke@1 | 231 | dosname="/usr/bin/cygpath -a -m -s" |
duke@1 | 232 | # Most unix utilities are in the /usr/bin |
duke@1 | 233 | unixcommand_path="/usr/bin" |
duke@1 | 234 | path4sdk="${sharebin};${antbin};${findbugsbin};${unixcommand_path}" |
duke@1 | 235 | dirMustExist "${unixcommand_path}" ALT_UNIXCOMMAND_PATH |
duke@1 | 236 | # Find GNU make |
duke@1 | 237 | make="${unixcommand_path}/make.exe" |
duke@1 | 238 | fileMustExist "${make}" make |
duke@1 | 239 | else |
duke@1 | 240 | echo "WARNING: Cannot figure out if this is MKS or CYGWIN" |
duke@1 | 241 | fi |
duke@1 | 242 | |
duke@1 | 243 | # WINDOWS: Compiler setup (nasty part) |
duke@1 | 244 | # NOTE: You can use vcvars32.bat to set PATH, LIB, and INCLUDE. |
duke@1 | 245 | # NOTE: CYGWIN has a link.exe too, make sure the compilers are first |
duke@1 | 246 | if [ "${windows_arch}" = i586 ] ; then |
duke@1 | 247 | # 32bit Windows compiler settings |
duke@1 | 248 | # VisualStudio .NET 2003 VC++ 7.1 (VS71COMNTOOLS should be defined) |
duke@1 | 249 | vs_root=`${dosname} "${VS71COMNTOOLS}/../.."` |
duke@1 | 250 | # Fill in PATH, LIB, and INCLUDE (unset all others to make sure) |
duke@1 | 251 | msdev_root="${vs_root}/Common7/Tools" |
duke@1 | 252 | msdevtools_path="${msdev_root}/bin" |
duke@1 | 253 | vc7_root="${vs_root}/Vc7" |
duke@1 | 254 | compiler_path="${vc7_root}/bin" |
duke@1 | 255 | compiler_name=VS2003 |
duke@1 | 256 | platform_sdk="${vc7_root}/PlatformSDK" |
duke@1 | 257 | # LIB and INCLUDE must use ; as a separator |
duke@1 | 258 | include4sdk="${vc7_root}/atlmfc/include" |
duke@1 | 259 | include4sdk="${include4sdk};${vc7_root}/include" |
duke@1 | 260 | include4sdk="${include4sdk};${platform_sdk}/include/prerelease" |
duke@1 | 261 | include4sdk="${include4sdk};${platform_sdk}/include" |
duke@1 | 262 | include4sdk="${include4sdk};${vs_root}/SDK/v1.1/include" |
duke@1 | 263 | lib4sdk="${vc7_root}/atlmfc/lib" |
duke@1 | 264 | lib4sdk="${lib4sdk};${vc7_root}/lib" |
duke@1 | 265 | lib4sdk="${lib4sdk};${platform_sdk}/lib/prerelease" |
duke@1 | 266 | lib4sdk="${lib4sdk};${platform_sdk}/lib" |
duke@1 | 267 | lib4sdk="${lib4sdk};${vs_root}/SDK/v1.1/lib" |
duke@1 | 268 | # Search path and DLL locating path |
duke@1 | 269 | # WARNING: CYGWIN has a link.exe too, make sure compilers are first |
duke@1 | 270 | path4sdk="${vs_root}/Common7/Tools/bin;${path4sdk}" |
duke@1 | 271 | path4sdk="${vs_root}/SDK/v1.1/bin;${path4sdk}" |
duke@1 | 272 | path4sdk="${vs_root}/Common7/Tools;${path4sdk}" |
duke@1 | 273 | path4sdk="${vs_root}/Common7/Tools/bin/prerelease;${path4sdk}" |
duke@1 | 274 | path4sdk="${vs_root}/Common7/IDE;${path4sdk}" |
duke@1 | 275 | path4sdk="${compiler_path};${path4sdk}" |
duke@1 | 276 | elif [ "${windows_arch}" = amd64 ] ; then |
duke@1 | 277 | # AMD64 64bit Windows compiler settings |
duke@1 | 278 | if [ "${MSSDK}" != "" ] ; then |
duke@1 | 279 | platform_sdk="${MSSDK}" |
duke@1 | 280 | else |
duke@1 | 281 | platform_sdk=`${dosname} "C:/Program Files/Microsoft Platform SDK/"` |
duke@1 | 282 | fi |
duke@1 | 283 | compiler_path="${platform_sdk}/Bin/win64/x86/AMD64" |
duke@1 | 284 | compiler_name=VS2005_PSDK |
duke@1 | 285 | msdevtools_path="${platform_sdk}/Bin" |
duke@1 | 286 | # LIB and INCLUDE must use ; as a separator |
duke@1 | 287 | include4sdk="${platform_sdk}/Include" |
duke@1 | 288 | include4sdk="${include4sdk};${platform_sdk}/Include/crt/sys" |
duke@1 | 289 | include4sdk="${include4sdk};${platform_sdk}/Include/mfc" |
duke@1 | 290 | include4sdk="${include4sdk};${platform_sdk}/Include/atl" |
duke@1 | 291 | include4sdk="${include4sdk};${platform_sdk}/Include/crt" |
duke@1 | 292 | lib4sdk="${platform_sdk}/Lib/AMD64" |
duke@1 | 293 | lib4sdk="${lib4sdk};${platform_sdk}/Lib/AMD64/atlmfc" |
duke@1 | 294 | # Search path and DLL locating path |
duke@1 | 295 | # WARNING: CYGWIN has a link.exe too, make sure compilers are first |
duke@1 | 296 | path4sdk="${platform_sdk}/bin;${path4sdk}" |
duke@1 | 297 | path4sdk="${compiler_path};${path4sdk}" |
duke@1 | 298 | fi |
duke@1 | 299 | # Export LIB and INCLUDE |
duke@1 | 300 | unset lib |
duke@1 | 301 | unset Lib |
duke@1 | 302 | LIB="${lib4sdk}" |
duke@1 | 303 | export LIB |
duke@1 | 304 | unset include |
duke@1 | 305 | unset Include |
duke@1 | 306 | INCLUDE="${include4sdk}" |
duke@1 | 307 | export INCLUDE |
duke@1 | 308 | # Set the ALT variable |
duke@1 | 309 | ALT_COMPILER_PATH=`${dosname} "${compiler_path}"` |
duke@1 | 310 | export ALT_COMPILER_PATH |
duke@1 | 311 | dirMustExist "${compiler_path}" ALT_COMPILER_PATH |
duke@1 | 312 | ALT_MSDEVTOOLS_PATH=`${dosname} "${msdevtools_path}"` |
duke@1 | 313 | export ALT_MSDEVTOOLS_PATH |
duke@1 | 314 | dirMustExist "${msdevtools_path}" ALT_MSDEVTOOLS_PATH |
duke@1 | 315 | |
duke@1 | 316 | # WINDOWS: Get the previous JDK to be used to bootstrap the build |
duke@1 | 317 | path4sdk="${bootdir}/bin;${path4sdk}" |
duke@1 | 318 | |
duke@1 | 319 | # Turn all \\ into /, remove duplicates and trailing / |
duke@1 | 320 | slash_path="`echo ${path4sdk} | sed -e 's@\\\\@/@g' -e 's@//@/@g' -e 's@/$@@' -e 's@/;@;@g'`" |
duke@1 | 321 | |
duke@1 | 322 | # For windows, it's hard to know where the system is, so we just add this |
duke@1 | 323 | # to PATH. |
duke@1 | 324 | path4sdk="${slash_path};${PATH}" |
duke@1 | 325 | |
duke@1 | 326 | # Convert path4sdk to cygwin style |
duke@1 | 327 | if [ "${unix_toolset}" = CYGWIN ] ; then |
duke@1 | 328 | path4sdk="`/usr/bin/cygpath -p ${path4sdk}`" |
duke@1 | 329 | fi |
duke@1 | 330 | |
duke@1 | 331 | fi |
duke@1 | 332 | |
duke@1 | 333 | # Export PATH setting |
duke@1 | 334 | PATH="${path4sdk}" |
duke@1 | 335 | export PATH |
duke@1 | 336 | |
duke@1 | 337 | # Things we need to unset |
duke@1 | 338 | unset LD_LIBRARY_PATH |
duke@1 | 339 | unset LD_LIBRARY_PATH_32 |
duke@1 | 340 | unset LD_LIBRARY_PATH_64 |
duke@1 | 341 | unset JAVA_HOME |
duke@1 | 342 |