make/jprt.config

Thu, 23 Apr 2009 15:54:45 -0700

author
xdono
date
Thu, 23 Apr 2009 15:54:45 -0700
changeset 67
aa147fe5f386
parent 49
e2f388853a9d
permissions
-rw-r--r--

Added tag jdk7-b56 for changeset 553a664b807b

duke@1 1 #!echo "This is not a shell script"
duke@1 2 #############################################################################
duke@1 3 #
xdono@49 4 # Copyright 2006-2009 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 # The 3 bin directories in common to all platforms
duke@1 97 sharebin="${share}/bin"
duke@1 98
duke@1 99 # Check input
duke@1 100 dirMustExist "${bootdir}" ALT_BOOTDIR
duke@1 101 dirMustExist "${slashjava}" ALT_SLASH_JAVA
duke@1 102 dirMustExist "${jdk_import}" ALT_JDK_IMPORT_PATH
duke@1 103
duke@1 104 # Uses 'uname -s', but only expect SunOS or Linux, assume Windows otherwise.
duke@1 105 osname=`uname -s`
duke@1 106 if [ "${osname}" = SunOS ] ; then
duke@1 107
duke@1 108 # SOLARIS: Sparc or X86
duke@1 109 osarch=`uname -p`
duke@1 110 if [ "${osarch}" = sparc ] ; then
duke@1 111 solaris_arch=sparc
duke@1 112 else
duke@1 113 solaris_arch=i386
duke@1 114 fi
duke@1 115
ohair@10 116 # Get the compilers into path (make sure it matches ALT setting)
ohair@10 117 if [ "${JPRT_SOLARIS_COMPILER_NAME}" != "" ] ; then
ohair@10 118 compiler_name=${JPRT_SOLARIS_COMPILER_NAME}
ohair@10 119 else
ohair@20 120 compiler_name=SS12
ohair@10 121 fi
ohair@10 122 compiler_path=${jdk_devtools}/${solaris_arch}/SUNWspro/${compiler_name}/bin
duke@1 123 ALT_COMPILER_PATH="${compiler_path}"
duke@1 124 export ALT_COMPILER_PATH
duke@1 125 dirMustExist "${compiler_path}" ALT_COMPILER_PATH
ohair@27 126 path4sdk=${compiler_path}:${sharebin}
duke@1 127
duke@1 128 # Add basic solaris system paths
duke@1 129 path4sdk=${path4sdk}:/usr/ccs/bin:/usr/ccs/lib:/usr/bin:/bin:/usr/sfw/bin
duke@1 130
duke@1 131 # Get the previous JDK to be used to bootstrap the build
duke@1 132 path4sdk=${bootdir}/bin:${path4sdk}
duke@1 133
duke@1 134 # Find GNU make
duke@1 135 make=/usr/sfw/bin/gmake
duke@1 136 if [ ! -f ${make} ] ; then
duke@1 137 make=/opt/sfw/bin/gmake
duke@1 138 if [ ! -f ${make} ] ; then
duke@1 139 make=${jdk_devtools}/${solaris_arch}/bin/gnumake
duke@1 140 fi
duke@1 141 fi
duke@1 142 fileMustExist "${make}" make
duke@1 143
duke@1 144 # File creation mask
duke@1 145 umask 002
duke@1 146
duke@1 147 elif [ "${osname}" = Linux ] ; then
duke@1 148
duke@1 149 # LINUX: X86, AMD64
duke@1 150 osarch=`uname -m`
duke@1 151 if [ "${osarch}" = i686 ] ; then
duke@1 152 linux_arch=i586
duke@1 153 elif [ "${osarch}" = x86_64 ] ; then
duke@1 154 linux_arch=amd64
duke@1 155 fi
duke@1 156
duke@1 157 # Get the compilers into path (make sure it matches ALT setting)
duke@1 158 compiler_path=/usr/bin
duke@1 159 compiler_name=usr_bin
duke@1 160 ALT_COMPILER_PATH="${compiler_path}"
duke@1 161 export ALT_COMPILER_PATH
duke@1 162 dirMustExist "${compiler_path}" ALT_COMPILER_PATH
ohair@27 163 path4sdk=${compiler_path}:${sharebin}
duke@1 164
duke@1 165 # Add basic paths
duke@1 166 path4sdk=${path4sdk}:/usr/bin:/bin:/usr/sbin:/sbin
duke@1 167
duke@1 168 # Get the previous JDK to be used to bootstrap the build
duke@1 169 path4sdk=${bootdir}/bin:${path4sdk}
duke@1 170
duke@1 171 # Find GNU make
duke@1 172 make=/usr/bin/make
duke@1 173 fileMustExist "${make}" make
duke@1 174
duke@1 175 umask 002
duke@1 176
duke@1 177 else
duke@1 178
duke@1 179 # Windows: Differs on CYGWIN vs. MKS, and the compiler available.
duke@1 180 # Also, blanks in pathnames gives GNU make headaches, so anything placed
duke@1 181 # in any ALT_* variable should be the short windows dosname.
duke@1 182
duke@1 183 # WINDOWS: Install and use MKS or CYGWIN (should have already been done)
duke@1 184 # Assumption here is that you are in a shell window via MKS or cygwin.
duke@1 185 # MKS install should have defined the environment variable ROOTDIR.
duke@1 186 # We also need to figure out which one we have: X86, AMD64
duke@1 187 if [ "`echo ${PROCESSOR_IDENTIFIER} | fgrep AMD64`" != "" ] ; then
duke@1 188 windows_arch=amd64
duke@1 189 else
duke@1 190 windows_arch=i586
duke@1 191 fi
duke@1 192
duke@1 193 # We need to determine if we are running a CYGWIN shell or an MKS shell
duke@1 194 # (if uname isn't available, then it will be unix_toolset=unknown)
duke@1 195 unix_toolset=unknown
duke@1 196 if [ "`uname -a | fgrep Cygwin`" = "" -a -d "${ROOTDIR}" ] ; then
duke@1 197 # We kind of assume ROOTDIR is where MKS is and it's ok
duke@1 198 unix_toolset=MKS
duke@1 199 mkshome=`dosname -s "${ROOTDIR}"`
duke@1 200 # Utility to convert to short pathnames without spaces
duke@1 201 dosname="${mkshome}/mksnt/dosname -s"
duke@1 202 # Most unix utilities are in the mksnt directory of ROOTDIR
duke@1 203 unixcommand_path="${mkshome}/mksnt"
ohair@27 204 path4sdk="${sharebin};${unixcommand_path}"
duke@1 205 dirMustExist "${unixcommand_path}" ALT_UNIXCOMMAND_PATH
duke@1 206 devtools_path="${jdk_devtools}/win32/bin"
duke@1 207 path4sdk="${devtools_path};${path4sdk}"
duke@1 208 # Normally this need not be set, but on Windows it's default is C:/UTILS
duke@1 209 ALT_DEVTOOLS_PATH="${devtools_path}"
duke@1 210 export ALT_DEVTOOLS_PATH
duke@1 211 dirMustExist "${devtools_path}" ALT_DEVTOOLS_PATH
duke@1 212 # Find GNU make
duke@1 213 make="${devtools_path}/gnumake.exe"
duke@1 214 fileMustExist "${make}" make
duke@1 215 elif [ "`uname -a | fgrep Cygwin`" != "" -a -f /bin/cygpath ] ; then
duke@1 216 # For CYGWIN, uname will have "Cygwin" in it, and /bin/cygpath should exist
duke@1 217 unix_toolset=CYGWIN
duke@1 218 # Utility to convert to short pathnames without spaces
duke@1 219 dosname="/usr/bin/cygpath -a -m -s"
duke@1 220 # Most unix utilities are in the /usr/bin
duke@1 221 unixcommand_path="/usr/bin"
ohair@27 222 path4sdk="${sharebin};${unixcommand_path}"
duke@1 223 dirMustExist "${unixcommand_path}" ALT_UNIXCOMMAND_PATH
duke@1 224 # Find GNU make
duke@1 225 make="${unixcommand_path}/make.exe"
duke@1 226 fileMustExist "${make}" make
duke@1 227 else
duke@1 228 echo "WARNING: Cannot figure out if this is MKS or CYGWIN"
duke@1 229 fi
duke@1 230
duke@1 231 # WINDOWS: Compiler setup (nasty part)
duke@1 232 # NOTE: You can use vcvars32.bat to set PATH, LIB, and INCLUDE.
duke@1 233 # NOTE: CYGWIN has a link.exe too, make sure the compilers are first
duke@1 234 if [ "${windows_arch}" = i586 ] ; then
duke@1 235 # 32bit Windows compiler settings
duke@1 236 # VisualStudio .NET 2003 VC++ 7.1 (VS71COMNTOOLS should be defined)
duke@1 237 vs_root=`${dosname} "${VS71COMNTOOLS}/../.."`
duke@1 238 # Fill in PATH, LIB, and INCLUDE (unset all others to make sure)
duke@1 239 msdev_root="${vs_root}/Common7/Tools"
duke@1 240 msdevtools_path="${msdev_root}/bin"
duke@1 241 vc7_root="${vs_root}/Vc7"
duke@1 242 compiler_path="${vc7_root}/bin"
duke@1 243 compiler_name=VS2003
duke@1 244 platform_sdk="${vc7_root}/PlatformSDK"
duke@1 245 # LIB and INCLUDE must use ; as a separator
duke@1 246 include4sdk="${vc7_root}/atlmfc/include"
duke@1 247 include4sdk="${include4sdk};${vc7_root}/include"
duke@1 248 include4sdk="${include4sdk};${platform_sdk}/include/prerelease"
duke@1 249 include4sdk="${include4sdk};${platform_sdk}/include"
duke@1 250 include4sdk="${include4sdk};${vs_root}/SDK/v1.1/include"
duke@1 251 lib4sdk="${vc7_root}/atlmfc/lib"
duke@1 252 lib4sdk="${lib4sdk};${vc7_root}/lib"
duke@1 253 lib4sdk="${lib4sdk};${platform_sdk}/lib/prerelease"
duke@1 254 lib4sdk="${lib4sdk};${platform_sdk}/lib"
duke@1 255 lib4sdk="${lib4sdk};${vs_root}/SDK/v1.1/lib"
duke@1 256 # Search path and DLL locating path
duke@1 257 # WARNING: CYGWIN has a link.exe too, make sure compilers are first
duke@1 258 path4sdk="${vs_root}/Common7/Tools/bin;${path4sdk}"
duke@1 259 path4sdk="${vs_root}/SDK/v1.1/bin;${path4sdk}"
duke@1 260 path4sdk="${vs_root}/Common7/Tools;${path4sdk}"
duke@1 261 path4sdk="${vs_root}/Common7/Tools/bin/prerelease;${path4sdk}"
duke@1 262 path4sdk="${vs_root}/Common7/IDE;${path4sdk}"
duke@1 263 path4sdk="${compiler_path};${path4sdk}"
duke@1 264 elif [ "${windows_arch}" = amd64 ] ; then
duke@1 265 # AMD64 64bit Windows compiler settings
duke@1 266 if [ "${MSSDK}" != "" ] ; then
duke@1 267 platform_sdk="${MSSDK}"
duke@1 268 else
duke@1 269 platform_sdk=`${dosname} "C:/Program Files/Microsoft Platform SDK/"`
duke@1 270 fi
duke@1 271 compiler_path="${platform_sdk}/Bin/win64/x86/AMD64"
duke@1 272 compiler_name=VS2005_PSDK
duke@1 273 msdevtools_path="${platform_sdk}/Bin"
duke@1 274 # LIB and INCLUDE must use ; as a separator
duke@1 275 include4sdk="${platform_sdk}/Include"
duke@1 276 include4sdk="${include4sdk};${platform_sdk}/Include/crt/sys"
duke@1 277 include4sdk="${include4sdk};${platform_sdk}/Include/mfc"
duke@1 278 include4sdk="${include4sdk};${platform_sdk}/Include/atl"
duke@1 279 include4sdk="${include4sdk};${platform_sdk}/Include/crt"
duke@1 280 lib4sdk="${platform_sdk}/Lib/AMD64"
duke@1 281 lib4sdk="${lib4sdk};${platform_sdk}/Lib/AMD64/atlmfc"
duke@1 282 # Search path and DLL locating path
duke@1 283 # WARNING: CYGWIN has a link.exe too, make sure compilers are first
duke@1 284 path4sdk="${platform_sdk}/bin;${path4sdk}"
duke@1 285 path4sdk="${compiler_path};${path4sdk}"
duke@1 286 fi
duke@1 287 # Export LIB and INCLUDE
duke@1 288 unset lib
duke@1 289 unset Lib
duke@1 290 LIB="${lib4sdk}"
duke@1 291 export LIB
duke@1 292 unset include
duke@1 293 unset Include
duke@1 294 INCLUDE="${include4sdk}"
duke@1 295 export INCLUDE
duke@1 296 # Set the ALT variable
duke@1 297 ALT_COMPILER_PATH=`${dosname} "${compiler_path}"`
duke@1 298 export ALT_COMPILER_PATH
duke@1 299 dirMustExist "${compiler_path}" ALT_COMPILER_PATH
duke@1 300 ALT_MSDEVTOOLS_PATH=`${dosname} "${msdevtools_path}"`
duke@1 301 export ALT_MSDEVTOOLS_PATH
duke@1 302 dirMustExist "${msdevtools_path}" ALT_MSDEVTOOLS_PATH
duke@1 303
duke@1 304 # WINDOWS: Get the previous JDK to be used to bootstrap the build
duke@1 305 path4sdk="${bootdir}/bin;${path4sdk}"
duke@1 306
duke@1 307 # Turn all \\ into /, remove duplicates and trailing /
duke@1 308 slash_path="`echo ${path4sdk} | sed -e 's@\\\\@/@g' -e 's@//@/@g' -e 's@/$@@' -e 's@/;@;@g'`"
duke@1 309
duke@1 310 # For windows, it's hard to know where the system is, so we just add this
duke@1 311 # to PATH.
duke@1 312 path4sdk="${slash_path};${PATH}"
duke@1 313
duke@1 314 # Convert path4sdk to cygwin style
duke@1 315 if [ "${unix_toolset}" = CYGWIN ] ; then
duke@1 316 path4sdk="`/usr/bin/cygpath -p ${path4sdk}`"
duke@1 317 fi
duke@1 318
duke@1 319 fi
duke@1 320
duke@1 321 # Export PATH setting
duke@1 322 PATH="${path4sdk}"
duke@1 323 export PATH
duke@1 324
duke@1 325 # Things we need to unset
duke@1 326 unset LD_LIBRARY_PATH
duke@1 327 unset LD_LIBRARY_PATH_32
duke@1 328 unset LD_LIBRARY_PATH_64
duke@1 329 unset JAVA_HOME
duke@1 330

mercurial