annotate make/jdk_generic_profile.sh @ 755:06a02adcba4e

6733718: test /java/awt/FullScreen/UninitializedDisplayModeChangeTest/ fails Reviewed-by: igor
author tdv
date Tue, 05 Aug 2008 09:37:03 -0700
parents
children f9467b4496dc
rev   line source
duke@0 1 #!/bin/sh
duke@0 2
duke@0 3 #
duke@0 4 # Copyright 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 #############################################################################
duke@0 30 #
duke@0 31 # Generic build profile.sh for all platforms, works in bash, sh, and ksh.
duke@0 32 #
duke@0 33 # Copy this file to your own area, and edit it to suit your needs.
duke@0 34 #
duke@0 35 # Ideally you either won't need to set the ALT_* variables because the
duke@0 36 # build system will find what it needs through system provided paths
duke@0 37 # or environment variables, or you have installed the component in the
duke@0 38 # recommended default path.
duke@0 39 #
duke@0 40 # If you find yourself forced to set an ALT_* environment variable and
duke@0 41 # suspect we could have figured it out automatically, please let us know.
duke@0 42 #
duke@0 43 # Most ALT_* directory defaults are based on being in the parent directory in
duke@0 44 # ALT_SLASH_JAVA, so it's possible to create for example a "C:/jdk6"
duke@0 45 # directory, assign that to ALT_SLASH_JAVA, and place all the components
duke@0 46 # in that directory. This could also minimize the ALT_* environment
duke@0 47 # variables you need to set.
duke@0 48 #
duke@0 49 ########
duke@0 50 #
duke@0 51 # Assumes basic unix utilities are in the PATH already (uname, hostname, etc.).
duke@0 52 #
duke@0 53 # On Windows, assumes PROCESSOR_IDENTIFIER, VS71COMNTOOLS,
duke@0 54 # SYSTEMROOT (or SystemRoot), COMPUTERNAME (or hostname works), and
duke@0 55 # USERNAME is defined in the environment.
duke@0 56 # This profile does not rely on using vcvars32.bat and 64bit Setup.bat.
duke@0 57 # Uses CYGWIN cygpath to make sure paths are space-free.
duke@0 58 #
duke@0 59 # The JDK Makefiles may change in the future, making some of these
duke@0 60 # settings unnecessary or redundant.
duke@0 61 #
duke@0 62 # This is a working example, but may or may not work on all systems.
duke@0 63 #
duke@0 64 #############################################################################
duke@0 65 #
duke@0 66 # WARNING: This file will clobber the value of some environment variables.
duke@0 67 #
duke@0 68 # Sets up these environment variables for doing JDK builds:
duke@0 69 # USERNAME
duke@0 70 # COMPUTERNAME
duke@0 71 # PATH
duke@0 72 # Windows Only:
duke@0 73 # LIB
duke@0 74 # INCLUDE
duke@0 75 # PS1
duke@0 76 # SHELL
duke@0 77 #
duke@0 78 # Attempts to set these variables for the JDK builds:
duke@0 79 # ALT_COMPILER_PATH
duke@0 80 # ALT_BOOTDIR
duke@0 81 # ALT_BINARY_PLUGS_PATH
duke@0 82 # ALT_CLOSED_JDK_IMPORT_PATH
duke@0 83 # Windows Only:
duke@0 84 # ALT_UNIXCOMMAND_PATH
duke@0 85 # ALT_MSDEVTOOLS_PATH
duke@0 86 # ALT_DXSDK_PATH
duke@0 87 # ALT_MSVCRT_DLL_PATH
duke@0 88 # ALT_MSVCR71_DLL_PATH
duke@0 89 #
duke@0 90 #############################################################################
duke@0 91 #
duke@0 92 # Keep in mind that at this point, we are running in some kind of shell
duke@0 93 # (sh, ksh, or bash). We don't know if it's solaris, linux, or windows
duke@0 94 # CYGWIN. We need to figure that out.
duke@0 95
duke@0 96 # Find user name
duke@0 97 if [ "${USERNAME}" = "" ] ; then
duke@0 98 USERNAME="${LOGNAME}"
duke@0 99 fi
duke@0 100 if [ "${USERNAME}" = "" ] ; then
duke@0 101 USERNAME="${USER}"
duke@0 102 fi
duke@0 103 export USERNAME
duke@0 104
duke@0 105 # Find machine name
duke@0 106 if [ "${COMPUTERNAME}" = "" ] ; then
duke@0 107 COMPUTERNAME="$(hostname)"
duke@0 108 fi
duke@0 109 export COMPUTERNAME
duke@0 110
duke@0 111 # Boot jdk
duke@0 112 bootjdk=jdk1.6.0
duke@0 113 importjdk=jdk1.7.0
duke@0 114
duke@0 115 # Uses 'uname -s', but only expect SunOS or Linux, assume Windows otherwise.
duke@0 116 osname=$(uname -s)
duke@0 117 if [ "${osname}" = SunOS ] ; then
duke@0 118
duke@0 119 # System place where JDK installed images are stored?
duke@0 120 jdk_instances=/usr/jdk/instances
duke@0 121
duke@0 122 # Get the SS11 compilers (and latest patches for them too)
duke@0 123 if [ "${ALT_COMPILER_PATH}" = "" ] ; then
duke@0 124 ALT_COMPILER_PATH=/opt/SUNWspro/bin
duke@0 125 export ALT_COMPILER_PATH
duke@0 126 fi
duke@0 127 if [ ! -d ${ALT_COMPILER_PATH} ] ; then
duke@0 128 echo "WARNING: Cannot access ALT_COMPILER_PATH=${ALT_COMPILER_PATH}"
duke@0 129 fi
duke@0 130
duke@0 131 # Place compiler path early in PATH to avoid 'cc' conflicts.
duke@0 132 path4sdk=${ALT_COMPILER_PATH}:/usr/ccs/bin:/usr/ccs/lib:/usr/bin:/bin:/usr/sfw/bin
duke@0 133
duke@0 134 # Make sure these are unset
duke@0 135 unset JAVA_HOME
duke@0 136 unset LD_LIBRARY_PATH
duke@0 137
duke@0 138 # Build in C locale
duke@0 139 LANG=C
duke@0 140 export LANG
duke@0 141 LC_ALL=C
duke@0 142 export LC_ALL
duke@0 143
duke@0 144 umask 002
duke@0 145
duke@0 146 elif [ "${osname}" = Linux ] ; then
duke@0 147
duke@0 148 # System place where JDK installed images are stored?
duke@0 149 jdk_instances=/opt/java
duke@0 150
duke@0 151 # Use compilers from /usr/bin
duke@0 152 path4sdk=/usr/bin:/bin:/usr/sbin:/sbin
duke@0 153
duke@0 154 # Make sure these are unset
duke@0 155 unset JAVA_HOME
duke@0 156 unset LD_LIBRARY_PATH
duke@0 157
duke@0 158 # Build in C locale
duke@0 159 LANG=C
duke@0 160 export LANG
duke@0 161 LC_ALL=C
duke@0 162 export LC_ALL
duke@0 163
duke@0 164 umask 002
duke@0 165
duke@0 166 else
duke@0 167
duke@0 168 # System place where JDK installed images are stored?
duke@0 169 jdk_instances="C:"
duke@0 170
duke@0 171 # Windows: Differs on CYGWIN and the compiler available.
duke@0 172 # Also, blanks in pathnames gives make headaches, so anything placed
duke@0 173 # in any ALT_* variable should be the short windows DOS names.
duke@0 174
duke@0 175 # Check CYGWIN (should have already been done)
duke@0 176 # Assumption here is that you are in a shell window via cygwin.
duke@0 177 if [ "$(echo ${PROCESSOR_IDENTIFIER} | fgrep AMD64)" != "" ] ; then
duke@0 178 windows_arch=amd64
duke@0 179 else
duke@0 180 windows_arch=i586
duke@0 181 fi
duke@0 182 # We need to check if we are running a CYGWIN shell
duke@0 183 if [ "$(uname -a | fgrep Cygwin)" != "" -a -f /bin/cygpath ] ; then
duke@0 184 # For CYGWIN, uname will have "Cygwin" in it, and /bin/cygpath should exist
duke@0 185 # Utility to convert to short pathnames without spaces
duke@0 186 cygpath="/usr/bin/cygpath -a -m -s"
duke@0 187 # Most unix utilities are in the /usr/bin
duke@0 188 unixcommand_path="/usr/bin"
duke@0 189 # Make the prompt tell you CYGWIN
duke@0 190 export PS1="CYGWIN:${COMPUTERNAME}:${USERNAME}[\!] "
duke@0 191 else
duke@0 192 echo "ERROR: Cannot find CYGWIN on this machine"
duke@0 193 exit 1
duke@0 194 fi
duke@0 195 if [ "${ALT_UNIXCOMMAND_PATH}" != "" ] ; then
duke@0 196 unixcommand_path=${ALT_UNIXCOMMAND_PATH}
duke@0 197 fi
duke@0 198
duke@0 199 # Default shell
duke@0 200 export SHELL="${unixcommand_path}/sh"
duke@0 201
duke@0 202 # Setup path system (verify this is right)
duke@0 203 if [ "${SystemRoot}" != "" ] ; then
duke@0 204 sys_root=$(${cygpath} "${SystemRoot}")
duke@0 205 elif [ "${SYSTEMROOT}" != "" ] ; then
duke@0 206 sys_root=$(${cygpath} "${SYSTEMROOT}")
duke@0 207 else
duke@0 208 sys_root=$(${cygpath} "C:/WINNT")
duke@0 209 fi
duke@0 210 path4sdk="${unixcommand_path};${sys_root}/system32;${sys_root};${sys_root}/System32/Wbem"
duke@0 211 if [ ! -d "${sys_root}" ] ; then
duke@0 212 echo "WARNING: No system root found at: ${sys_root}"
duke@0 213 fi
duke@0 214
duke@0 215 # Compiler setup (nasty part)
duke@0 216 # NOTE: You can use vcvars32.bat to set PATH, LIB, and INCLUDE.
duke@0 217 # NOTE: CYGWIN has a link.exe too, make sure the compilers are first
duke@0 218 if [ "${windows_arch}" = i586 ] ; then
duke@0 219 # 32bit Windows compiler settings
duke@0 220 # VisualStudio .NET 2003 VC++ 7.1 (VS71COMNTOOLS should be defined)
duke@0 221 vs_root=$(${cygpath} "${VS71COMNTOOLS}/../..")
duke@0 222 # Fill in PATH, LIB, and INCLUDE (unset all others to make sure)
duke@0 223 msdev_root="${vs_root}/Common7/Tools"
duke@0 224 msdevtools_path="${msdev_root}/bin"
duke@0 225 vc7_root="${vs_root}/Vc7"
duke@0 226 compiler_path="${vc7_root}/bin"
duke@0 227 platform_sdk="${vc7_root}/PlatformSDK"
duke@0 228
duke@0 229 # LIB and INCLUDE must use ; as a separator
duke@0 230 include4sdk="${vc7_root}/atlmfc/include"
duke@0 231 include4sdk="${include4sdk};${vc7_root}/include"
duke@0 232 include4sdk="${include4sdk};${platform_sdk}/include/prerelease"
duke@0 233 include4sdk="${include4sdk};${platform_sdk}/include"
duke@0 234 include4sdk="${include4sdk};${vs_root}/SDK/v1.1/include"
duke@0 235 lib4sdk="${lib4sdk};${vc7_root}/lib"
duke@0 236 lib4sdk="${lib4sdk};${platform_sdk}/lib/prerelease"
duke@0 237 lib4sdk="${lib4sdk};${platform_sdk}/lib"
duke@0 238 lib4sdk="${lib4sdk};${vs_root}/SDK/v1.1/lib"
duke@0 239 # Search path and DLL locating path
duke@0 240 # WARNING: CYGWIN has a link.exe too, make sure compilers are first
duke@0 241 path4sdk="${vs_root}/Common7/Tools/bin;${path4sdk}"
duke@0 242 path4sdk="${vs_root}/SDK/v1.1/bin;${path4sdk}"
duke@0 243 path4sdk="${vs_root}/Common7/Tools;${path4sdk}"
duke@0 244 path4sdk="${vs_root}/Common7/Tools/bin/prerelease;${path4sdk}"
duke@0 245 path4sdk="${vs_root}/Common7/IDE;${path4sdk}"
duke@0 246 path4sdk="${compiler_path};${path4sdk}"
duke@0 247 elif [ "${windows_arch}" = amd64 ] ; then
duke@0 248 # AMD64 64bit Windows compiler settings
duke@0 249 if [ "${ALT_DEPLOY_MSSDK}" != "" ] ; then
duke@0 250 platform_sdk=${ALT_DEPLOY_MSSDK}
duke@0 251 else
duke@0 252 platform_sdk=$(${cygpath} "C:/Program Files/Microsoft Platform SDK/")
duke@0 253 fi
duke@0 254 if [ "${ALT_COMPILER_PATH}" != "" ] ; then
duke@0 255 compiler_path=${ALT_COMPILER_PATH}
duke@0 256 if [ "${ALT_DEPLOY_MSSDK}" = "" ] ; then
duke@0 257 platform_sdk=${ALT_COMPILER_PATH}/../../../..
duke@0 258 fi
duke@0 259 else
duke@0 260 compiler_path="${platform_sdk}/Bin/win64/x86/AMD64"
duke@0 261 fi
duke@0 262 if [ "${ALT_MSDEVTOOLS_PATH}" != "" ] ; then
duke@0 263 msdevtools_path=${ALT_MSDEVTOOLS_PATH}
duke@0 264 else
duke@0 265 msdevtools_path="${platform_sdk}/Bin/win64/x86/AMD64"
duke@0 266 fi
duke@0 267 msdevtools_path="${compiler_path}"
duke@0 268 # LIB and INCLUDE must use ; as a separator
duke@0 269 include4sdk="${platform_sdk}/Include"
duke@0 270 include4sdk="${include4sdk};${platform_sdk}/Include/crt/sys"
duke@0 271 include4sdk="${include4sdk};${platform_sdk}/Include/mfc"
duke@0 272 include4sdk="${include4sdk};${platform_sdk}/Include/atl"
duke@0 273 include4sdk="${include4sdk};${platform_sdk}/Include/crt"
duke@0 274 lib4sdk="${platform_sdk}/Lib/AMD64"
duke@0 275 lib4sdk="${lib4sdk};${platform_sdk}/Lib/AMD64/atlmfc"
duke@0 276 # Search path and DLL locating path
duke@0 277 # WARNING: CYGWIN has a link.exe too, make sure compilers are first
duke@0 278 path4sdk="${platform_sdk}/bin;${path4sdk}"
duke@0 279 path4sdk="${compiler_path};${path4sdk}"
duke@0 280 fi
duke@0 281 # Export LIB and INCLUDE
duke@0 282 unset lib
duke@0 283 unset Lib
duke@0 284 LIB="${lib4sdk}"
duke@0 285 export LIB
duke@0 286 unset include
duke@0 287 unset Include
duke@0 288 INCLUDE="${include4sdk}"
duke@0 289 export INCLUDE
duke@0 290
duke@0 291 # Turn all \\ into /, remove duplicates and trailing /
duke@0 292 slash_path="$(echo ${path4sdk} | sed -e 's@\\\\@/@g' -e 's@//@/@g' -e 's@/$@@' -e 's@/;@;@g')"
duke@0 293 path4sdk="${slash_path}"
duke@0 294
duke@0 295 # Convert path4sdk to cygwin style
duke@0 296 path4sdk="$(/usr/bin/cygpath -p ${path4sdk})"
duke@0 297
duke@0 298 fi
duke@0 299
duke@0 300 # Get the previous JDK to be used to bootstrap the build
duke@0 301 if [ "${ALT_BOOTDIR}" = "" ] ; then
duke@0 302 ALT_BOOTDIR=${jdk_instances}/${bootjdk}
duke@0 303 export ALT_BOOTDIR
duke@0 304 fi
duke@0 305 if [ ! -d ${ALT_BOOTDIR} ] ; then
duke@0 306 echo "WARNING: Cannot access ALT_BOOTDIR=${ALT_BOOTDIR}"
duke@0 307 fi
duke@0 308
duke@0 309 # Get the import JDK to be used to get hotspot VM if not built
duke@0 310 if [ "${ALT_JDK_IMPORT_PATH}" = "" -a -d ${jdk_instances}/${importjdk} ] ; then
duke@0 311 ALT_JDK_IMPORT_PATH=${jdk_instances}/${importjdk}
duke@0 312 export ALT_JDK_IMPORT_PATH
duke@0 313 fi
duke@0 314
duke@0 315 # Get the latest JDK binary plugs or build to import pre-built binaries
duke@0 316 if [ "${ALT_BINARY_PLUGS_PATH}" = "" ] ; then
duke@0 317 binplugs=${jdk_instances}/openjdk-binary-plugs
duke@0 318 jdkplugs=${jdk_instances}/${importjdk}
duke@0 319 if [ -d ${binplugs} ] ; then
duke@0 320 ALT_BINARY_PLUGS_PATH=${binplugs}
duke@0 321 export ALT_BINARY_PLUGS_PATH
duke@0 322 elif [ "${ALT_CLOSED_JDK_IMPORT_PATH}" = "" -a -d ${jdkplugs} ] ; then
duke@0 323 ALT_CLOSED_JDK_IMPORT_PATH=${jdkplugs}
duke@0 324 export ALT_CLOSED_JDK_IMPORT_PATH
duke@0 325 fi
duke@0 326 if [ "${ALT_BINARY_PLUGS_PATH}" = "" ] ; then
duke@0 327 echo "WARNING: Missing ALT_BINARY_PLUGS_PATH: ${binplugs}"
duke@0 328 fi
duke@0 329 fi
duke@0 330 if [ "${ALT_BINARY_PLUGS_PATH}" != "" -a ! -d "${ALT_BINARY_PLUGS_PATH}" ] ; then
duke@0 331 echo "WARNING: Cannot access ALT_BINARY_PLUGS_PATH=${ALT_BINARY_PLUGS_PATH}"
duke@0 332 fi
duke@0 333 if [ "${ALT_CLOSED_JDK_IMPORT_PATH}" != "" -a ! -d "${ALT_CLOSED_JDK_IMPORT_PATH}" ] ; then
duke@0 334 echo "WARNING: Cannot access ALT_CLOSED_JDK_IMPORT_PATH=${ALT_CLOSED_JDK_IMPORT_PATH}"
duke@0 335 fi
duke@0 336
duke@0 337 # Export PATH setting
duke@0 338 PATH="${path4sdk}"
duke@0 339 export PATH
duke@0 340