annotate make/jprt.config @ 29:746ca6b12c56

Merge
author ohair
date Wed, 06 Aug 2008 16:39:58 -0700
parents 55b2666e52e1 844619bd3580
children e18ad724572f
rev   line source
duke@0 1 #!echo "This is not a shell script"
duke@0 2 #############################################################################
duke@0 3 #
duke@0 4 # Copyright 2006-2007 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 # OPENJDK
duke@0 36 # Windows Only:
duke@0 37 # PATH
duke@0 38 # VS71COMNTOOLS
duke@0 39 # PROCESSOR_IDENTIFIER
duke@0 40 # ROOTDIR
duke@0 41 #
duke@0 42 # Output variable settings:
duke@0 43 # make Full path to GNU make
duke@0 44 # compiler_path Path to compiler bin directory
duke@0 45 # compiler_name Unique name of this compiler
duke@0 46 #
duke@0 47 # Output environment variables:
duke@0 48 # PATH
duke@0 49 # ALT_COMPILER_PATH
duke@0 50 # OPENJDK only:
duke@0 51 # ALT_CLOSED_JDK_IMPORT_PATH
duke@0 52 # ALT_JDK_DEVTOOLS_DIR
duke@0 53 # Windows Only:
duke@0 54 # ALT_MSDEVTOOLS_PATH
duke@0 55 # ALT_DEVTOOLS_PATH (To avoid the C:/UTILS default)
duke@0 56 # LIB
duke@0 57 # INCLUDE
duke@0 58 #
duke@0 59 # After JDK6, most settings will be found via ALT_SLASH_JAVA or
duke@0 60 # by way of other system environment variables. If this was JDK5
duke@0 61 # or an older JDK, you might need to export more ALT_* variables.
duke@0 62 #
duke@0 63 # On Windows AMD64, if MSSDK is not set, assumes Platform SDK is installed at:
duke@0 64 # C:/Program Files/Microsoft Platform SDK
duke@0 65 #
duke@0 66 #############################################################################
duke@0 67
duke@0 68 #############################################################################
duke@0 69 # Error
duke@0 70 error() # message
duke@0 71 {
duke@0 72 echo "ERROR: $1"
duke@0 73 exit 6
duke@0 74 }
duke@0 75 # Directory must exist
duke@0 76 dirMustExist() # dir name
duke@0 77 {
duke@0 78 if [ ! -d "$1" ] ; then
duke@0 79 error "Directory for $2 does not exist: $1"
duke@0 80 fi
duke@0 81 }
duke@0 82 # File must exist
duke@0 83 fileMustExist() # dir name
duke@0 84 {
duke@0 85 if [ ! -f "$1" ] ; then
duke@0 86 error "File for $2 does not exist: $1"
duke@0 87 fi
duke@0 88 }
duke@0 89 #############################################################################
duke@0 90
duke@0 91 # Should be set by JPRT as the 3 basic inputs
duke@0 92 bootdir="${ALT_BOOTDIR}"
duke@0 93 slashjava="${ALT_SLASH_JAVA}"
duke@0 94 jdk_import="${ALT_JDK_IMPORT_PATH}"
duke@0 95
duke@0 96 # The /java/devtools items
duke@0 97 jdk_devtools="${slashjava}/devtools"
duke@0 98 share="${jdk_devtools}/share"
duke@0 99
duke@0 100 # Needed for langtools, maybe other parts of the build
duke@0 101 ANT_HOME="${share}/ant/latest"
duke@0 102 export ANT_HOME
duke@0 103 FINDBUGS_HOME="${share}/findbugs/latest"
duke@0 104 export FINDBUGS_HOME
duke@0 105
duke@0 106 # The 3 bin directories in common to all platforms
duke@0 107 sharebin="${share}/bin"
duke@0 108 antbin="${ANT_HOME}/bin"
duke@0 109 findbugsbin="${FINDBUGS_HOME}/bin"
duke@0 110
duke@0 111 # Check input
duke@0 112 dirMustExist "${bootdir}" ALT_BOOTDIR
duke@0 113 dirMustExist "${slashjava}" ALT_SLASH_JAVA
duke@0 114 dirMustExist "${jdk_import}" ALT_JDK_IMPORT_PATH
duke@0 115 dirMustExist "${ANT_HOME}" ANT_HOME
duke@0 116 dirMustExist "${FINDBUGS_HOME}" FINDBUGS_HOME
duke@0 117
ohair@27 118 # If ALT_PREVIOUS_RELEASE_IMAGE not defined, set it to the bootdir area for
duke@0 119 # any possible image comparisons.
duke@0 120 # We assume bootdir is a previous jdk release image, valid for comparison
duke@0 121 # reasons.
ohair@27 122 if [ "${ALT_PREVIOUS_RELEASE_IMAGE}" = "" ] ; then
ohair@27 123 ALT_PREVIOUS_RELEASE_IMAGE="${bootdir}"
ohair@27 124 export ALT_PREVIOUS_RELEASE_IMAGE
duke@0 125 fi
duke@0 126
duke@0 127 # Use the JDK import for now (FIXME: use the binary plugs?)
duke@0 128 if [ "${OPENJDK}" = true ] ; then
duke@0 129 ALT_CLOSED_JDK_IMPORT_PATH="${jdk_import}"
duke@0 130 export ALT_CLOSED_JDK_IMPORT_PATH
duke@0 131 fi
duke@0 132
duke@0 133 # Uses 'uname -s', but only expect SunOS or Linux, assume Windows otherwise.
duke@0 134 osname=`uname -s`
duke@0 135 if [ "${osname}" = SunOS ] ; then
duke@0 136
duke@0 137 # SOLARIS: Sparc or X86
duke@0 138 osarch=`uname -p`
duke@0 139 if [ "${osarch}" = sparc ] ; then
duke@0 140 solaris_arch=sparc
duke@0 141 else
duke@0 142 solaris_arch=i386
duke@0 143 fi
duke@0 144
ohair@20 145 # Get the compilers into path (make sure it matches ALT setting)
ohair@20 146 if [ "${JPRT_SOLARIS_COMPILER_NAME}" != "" ] ; then
ohair@20 147 compiler_name=${JPRT_SOLARIS_COMPILER_NAME}
ohair@20 148 else
ohair@28 149 compiler_name=SS12
ohair@20 150 fi
ohair@20 151 compiler_path=${jdk_devtools}/${solaris_arch}/SUNWspro/${compiler_name}/bin
duke@0 152 ALT_COMPILER_PATH="${compiler_path}"
duke@0 153 export ALT_COMPILER_PATH
duke@0 154 dirMustExist "${compiler_path}" ALT_COMPILER_PATH
duke@0 155 path4sdk=${compiler_path}:${sharebin}:${antbin}:${findbugsbin}
duke@0 156
duke@0 157 # Add basic solaris system paths
duke@0 158 path4sdk=${path4sdk}:/usr/ccs/bin:/usr/ccs/lib:/usr/bin:/bin:/usr/sfw/bin
duke@0 159
duke@0 160 # Get the previous JDK to be used to bootstrap the build
duke@0 161 path4sdk=${bootdir}/bin:${path4sdk}
duke@0 162
duke@0 163 # Find GNU make
duke@0 164 make=/usr/sfw/bin/gmake
duke@0 165 if [ ! -f ${make} ] ; then
duke@0 166 make=/opt/sfw/bin/gmake
duke@0 167 if [ ! -f ${make} ] ; then
duke@0 168 make=${jdk_devtools}/${solaris_arch}/bin/gnumake
duke@0 169 fi
duke@0 170 fi
duke@0 171 fileMustExist "${make}" make
duke@0 172
duke@0 173 # File creation mask
duke@0 174 umask 002
duke@0 175
duke@0 176 elif [ "${osname}" = Linux ] ; then
duke@0 177
duke@0 178 # LINUX: X86, AMD64
duke@0 179 osarch=`uname -m`
duke@0 180 if [ "${osarch}" = i686 ] ; then
duke@0 181 linux_arch=i586
duke@0 182 elif [ "${osarch}" = x86_64 ] ; then
duke@0 183 linux_arch=amd64
duke@0 184 fi
duke@0 185
duke@0 186 # Get the compilers into path (make sure it matches ALT setting)
duke@0 187 compiler_path=/usr/bin
duke@0 188 compiler_name=usr_bin
duke@0 189 ALT_COMPILER_PATH="${compiler_path}"
duke@0 190 export ALT_COMPILER_PATH
duke@0 191 dirMustExist "${compiler_path}" ALT_COMPILER_PATH
duke@0 192 path4sdk=${compiler_path}:${sharebin}:${antbin}:${findbugsbin}
duke@0 193
duke@0 194 # Add basic paths
duke@0 195 path4sdk=${path4sdk}:/usr/bin:/bin:/usr/sbin:/sbin
duke@0 196
duke@0 197 # Get the previous JDK to be used to bootstrap the build
duke@0 198 path4sdk=${bootdir}/bin:${path4sdk}
duke@0 199
duke@0 200 # Find GNU make
duke@0 201 make=/usr/bin/make
duke@0 202 fileMustExist "${make}" make
duke@0 203
duke@0 204 umask 002
duke@0 205
duke@0 206 # Linux platform may be old, use motif files from the devtools area
duke@0 207 if [ "${OPENJDK}" = true ] ; then
duke@0 208 ALT_JDK_DEVTOOLS_DIR="${jdk_devtools}"
duke@0 209 export ALT_JDK_DEVTOOLS_DIR
duke@0 210 fi
duke@0 211
duke@0 212
duke@0 213 else
duke@0 214
duke@0 215 # Windows: Differs on CYGWIN vs. MKS, and the compiler available.
duke@0 216 # Also, blanks in pathnames gives GNU make headaches, so anything placed
duke@0 217 # in any ALT_* variable should be the short windows dosname.
duke@0 218
duke@0 219 # WINDOWS: Install and use MKS or CYGWIN (should have already been done)
duke@0 220 # Assumption here is that you are in a shell window via MKS or cygwin.
duke@0 221 # MKS install should have defined the environment variable ROOTDIR.
duke@0 222 # We also need to figure out which one we have: X86, AMD64
duke@0 223 if [ "`echo ${PROCESSOR_IDENTIFIER} | fgrep AMD64`" != "" ] ; then
duke@0 224 windows_arch=amd64
duke@0 225 else
duke@0 226 windows_arch=i586
duke@0 227 fi
duke@0 228
duke@0 229 # We need to determine if we are running a CYGWIN shell or an MKS shell
duke@0 230 # (if uname isn't available, then it will be unix_toolset=unknown)
duke@0 231 unix_toolset=unknown
duke@0 232 if [ "`uname -a | fgrep Cygwin`" = "" -a -d "${ROOTDIR}" ] ; then
duke@0 233 # We kind of assume ROOTDIR is where MKS is and it's ok
duke@0 234 unix_toolset=MKS
duke@0 235 mkshome=`dosname -s "${ROOTDIR}"`
duke@0 236 # Utility to convert to short pathnames without spaces
duke@0 237 dosname="${mkshome}/mksnt/dosname -s"
duke@0 238 # Most unix utilities are in the mksnt directory of ROOTDIR
duke@0 239 unixcommand_path="${mkshome}/mksnt"
duke@0 240 path4sdk="${sharebin};${antbin};${findbugsbin};${unixcommand_path}"
duke@0 241 dirMustExist "${unixcommand_path}" ALT_UNIXCOMMAND_PATH
duke@0 242 devtools_path="${jdk_devtools}/win32/bin"
duke@0 243 path4sdk="${devtools_path};${path4sdk}"
duke@0 244 # Normally this need not be set, but on Windows it's default is C:/UTILS
duke@0 245 ALT_DEVTOOLS_PATH="${devtools_path}"
duke@0 246 export ALT_DEVTOOLS_PATH
duke@0 247 dirMustExist "${devtools_path}" ALT_DEVTOOLS_PATH
duke@0 248 # Find GNU make
duke@0 249 make="${devtools_path}/gnumake.exe"
duke@0 250 fileMustExist "${make}" make
duke@0 251 elif [ "`uname -a | fgrep Cygwin`" != "" -a -f /bin/cygpath ] ; then
duke@0 252 # For CYGWIN, uname will have "Cygwin" in it, and /bin/cygpath should exist
duke@0 253 unix_toolset=CYGWIN
duke@0 254 # Utility to convert to short pathnames without spaces
duke@0 255 dosname="/usr/bin/cygpath -a -m -s"
duke@0 256 # Most unix utilities are in the /usr/bin
duke@0 257 unixcommand_path="/usr/bin"
duke@0 258 path4sdk="${sharebin};${antbin};${findbugsbin};${unixcommand_path}"
duke@0 259 dirMustExist "${unixcommand_path}" ALT_UNIXCOMMAND_PATH
duke@0 260 # Find GNU make
duke@0 261 make="${unixcommand_path}/make.exe"
duke@0 262 fileMustExist "${make}" make
duke@0 263 else
duke@0 264 echo "WARNING: Cannot figure out if this is MKS or CYGWIN"
duke@0 265 fi
duke@0 266
duke@0 267 # WINDOWS: Compiler setup (nasty part)
duke@0 268 # NOTE: You can use vcvars32.bat to set PATH, LIB, and INCLUDE.
duke@0 269 # NOTE: CYGWIN has a link.exe too, make sure the compilers are first
duke@0 270 if [ "${windows_arch}" = i586 ] ; then
duke@0 271 # 32bit Windows compiler settings
duke@0 272 # VisualStudio .NET 2003 VC++ 7.1 (VS71COMNTOOLS should be defined)
duke@0 273 vs_root=`${dosname} "${VS71COMNTOOLS}/../.."`
duke@0 274 # Fill in PATH, LIB, and INCLUDE (unset all others to make sure)
duke@0 275 msdev_root="${vs_root}/Common7/Tools"
duke@0 276 msdevtools_path="${msdev_root}/bin"
duke@0 277 vc7_root="${vs_root}/Vc7"
duke@0 278 compiler_path="${vc7_root}/bin"
duke@0 279 compiler_name=VS2003
duke@0 280 platform_sdk="${vc7_root}/PlatformSDK"
duke@0 281 # LIB and INCLUDE must use ; as a separator
duke@0 282 include4sdk="${vc7_root}/atlmfc/include"
duke@0 283 include4sdk="${include4sdk};${vc7_root}/include"
duke@0 284 include4sdk="${include4sdk};${platform_sdk}/include/prerelease"
duke@0 285 include4sdk="${include4sdk};${platform_sdk}/include"
duke@0 286 include4sdk="${include4sdk};${vs_root}/SDK/v1.1/include"
duke@0 287 lib4sdk="${vc7_root}/atlmfc/lib"
duke@0 288 lib4sdk="${lib4sdk};${vc7_root}/lib"
duke@0 289 lib4sdk="${lib4sdk};${platform_sdk}/lib/prerelease"
duke@0 290 lib4sdk="${lib4sdk};${platform_sdk}/lib"
duke@0 291 lib4sdk="${lib4sdk};${vs_root}/SDK/v1.1/lib"
duke@0 292 # Search path and DLL locating path
duke@0 293 # WARNING: CYGWIN has a link.exe too, make sure compilers are first
duke@0 294 path4sdk="${vs_root}/Common7/Tools/bin;${path4sdk}"
duke@0 295 path4sdk="${vs_root}/SDK/v1.1/bin;${path4sdk}"
duke@0 296 path4sdk="${vs_root}/Common7/Tools;${path4sdk}"
duke@0 297 path4sdk="${vs_root}/Common7/Tools/bin/prerelease;${path4sdk}"
duke@0 298 path4sdk="${vs_root}/Common7/IDE;${path4sdk}"
duke@0 299 path4sdk="${compiler_path};${path4sdk}"
duke@0 300 elif [ "${windows_arch}" = amd64 ] ; then
duke@0 301 # AMD64 64bit Windows compiler settings
duke@0 302 if [ "${MSSDK}" != "" ] ; then
duke@0 303 platform_sdk="${MSSDK}"
duke@0 304 else
duke@0 305 platform_sdk=`${dosname} "C:/Program Files/Microsoft Platform SDK/"`
duke@0 306 fi
duke@0 307 compiler_path="${platform_sdk}/Bin/win64/x86/AMD64"
duke@0 308 compiler_name=VS2005_PSDK
duke@0 309 msdevtools_path="${platform_sdk}/Bin"
duke@0 310 # LIB and INCLUDE must use ; as a separator
duke@0 311 include4sdk="${platform_sdk}/Include"
duke@0 312 include4sdk="${include4sdk};${platform_sdk}/Include/crt/sys"
duke@0 313 include4sdk="${include4sdk};${platform_sdk}/Include/mfc"
duke@0 314 include4sdk="${include4sdk};${platform_sdk}/Include/atl"
duke@0 315 include4sdk="${include4sdk};${platform_sdk}/Include/crt"
duke@0 316 lib4sdk="${platform_sdk}/Lib/AMD64"
duke@0 317 lib4sdk="${lib4sdk};${platform_sdk}/Lib/AMD64/atlmfc"
duke@0 318 # Search path and DLL locating path
duke@0 319 # WARNING: CYGWIN has a link.exe too, make sure compilers are first
duke@0 320 path4sdk="${platform_sdk}/bin;${path4sdk}"
duke@0 321 path4sdk="${compiler_path};${path4sdk}"
duke@0 322 fi
duke@0 323 # Export LIB and INCLUDE
duke@0 324 unset lib
duke@0 325 unset Lib
duke@0 326 LIB="${lib4sdk}"
duke@0 327 export LIB
duke@0 328 unset include
duke@0 329 unset Include
duke@0 330 INCLUDE="${include4sdk}"
duke@0 331 export INCLUDE
duke@0 332 # Set the ALT variable
duke@0 333 ALT_COMPILER_PATH=`${dosname} "${compiler_path}"`
duke@0 334 export ALT_COMPILER_PATH
duke@0 335 dirMustExist "${compiler_path}" ALT_COMPILER_PATH
duke@0 336 ALT_MSDEVTOOLS_PATH=`${dosname} "${msdevtools_path}"`
duke@0 337 export ALT_MSDEVTOOLS_PATH
duke@0 338 dirMustExist "${msdevtools_path}" ALT_MSDEVTOOLS_PATH
duke@0 339
duke@0 340 # WINDOWS: Get the previous JDK to be used to bootstrap the build
duke@0 341 path4sdk="${bootdir}/bin;${path4sdk}"
duke@0 342
duke@0 343 # Turn all \\ into /, remove duplicates and trailing /
duke@0 344 slash_path="`echo ${path4sdk} | sed -e 's@\\\\@/@g' -e 's@//@/@g' -e 's@/$@@' -e 's@/;@;@g'`"
duke@0 345
duke@0 346 # For windows, it's hard to know where the system is, so we just add this
duke@0 347 # to PATH.
duke@0 348 path4sdk="${slash_path};${PATH}"
duke@0 349
duke@0 350 # Convert path4sdk to cygwin style
duke@0 351 if [ "${unix_toolset}" = CYGWIN ] ; then
duke@0 352 path4sdk="`/usr/bin/cygpath -p ${path4sdk}`"
duke@0 353 fi
duke@0 354
duke@0 355 # Set special windows ALT variables
duke@0 356 ALT_ISHIELDDIR="C:/ishield802"
duke@0 357 export ALT_ISHIELDDIR
duke@0 358
duke@0 359 # Sponsors binaries
duke@0 360 ALT_SPONSOR1DIR=C:/sponsor_binaries
duke@0 361 export ALT_SPONSOR1DIR
duke@0 362 ALT_SPONSOR2DIR=C:/sponsor_binaries
duke@0 363 export ALT_SPONSOR2DIR
duke@0 364
duke@0 365 fi
duke@0 366
duke@0 367 # Export PATH setting
duke@0 368 PATH="${path4sdk}"
duke@0 369 export PATH
duke@0 370
duke@0 371 # Things we need to unset
duke@0 372 unset LD_LIBRARY_PATH
duke@0 373 unset LD_LIBRARY_PATH_32
duke@0 374 unset LD_LIBRARY_PATH_64
duke@0 375 unset JAVA_HOME
duke@0 376