Thu, 26 Mar 2009 16:47:41 -0700
6822374: Windows: detect X64 when PROCESSOR_IDENTIFIER contains EM64T or Intel64
6822913: Consolidate make/jprt.config files, let JPRT manage this file make it optional in repos
Reviewed-by: tbell
make/common/shared/Platform.gmk | file | annotate | diff | comparison | revisions | |
make/jprt.config | file | annotate | diff | comparison | revisions |
1.1 --- a/make/common/shared/Platform.gmk Mon Mar 16 16:18:10 2009 -0700 1.2 +++ b/make/common/shared/Platform.gmk Thu Mar 26 16:47:41 2009 -0700 1.3 @@ -288,11 +288,22 @@ 1.4 TEMP_DISK=C:/temp 1.5 # GNU Make or MKS overrides $(PROCESSOR_ARCHITECTURE) to always 1.6 # return "x86". Use the first word of $(PROCESSOR_IDENTIFIER) instead. 1.7 + PROC_ARCH:=$(word 1, $(PROCESSOR_IDENTIFIER)) 1.8 + PROC_ARCH:=$(subst x86,X86,$(PROC_ARCH)) 1.9 + PROC_ARCH:=$(subst x64,X64,$(PROC_ARCH)) 1.10 + PROC_ARCH:=$(subst intel64,X64,$(PROC_ARCH)) 1.11 + PROC_ARCH:=$(subst Intel64,X64,$(PROC_ARCH)) 1.12 + PROC_ARCH:=$(subst INTEL64,X64,$(PROC_ARCH)) 1.13 + PROC_ARCH:=$(subst em64t,X64,$(PROC_ARCH)) 1.14 + PROC_ARCH:=$(subst EM64T,X64,$(PROC_ARCH)) 1.15 + PROC_ARCH:=$(subst amd64,X64,$(PROC_ARCH)) 1.16 + PROC_ARCH:=$(subst AMD64,X64,$(PROC_ARCH)) 1.17 + PROC_ARCH:=$(subst ia64,IA64,$(PROC_ARCH)) 1.18 ifndef ARCH_DATA_MODEL 1.19 - ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),ia64) 1.20 + ifeq ($(PROC_ARCH),IA64) 1.21 ARCH_DATA_MODEL=64 1.22 else 1.23 - ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),AMD64) 1.24 + ifeq ($(PROC_ARCH),X64) 1.25 ARCH_DATA_MODEL=64 1.26 else 1.27 ARCH_DATA_MODEL=32 1.28 @@ -313,10 +324,12 @@ 1.29 # + set ARCH to ia64 or amd64, or 1.30 REQUIRED_WINDOWS_NAME=Windows Server 2003 1.31 REQUIRED_WINDOWS_VERSION=5 2 Service Pack 1 1.32 - ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)), AMD64) 1.33 + ifeq ($(PROC_ARCH),X64) 1.34 ARCH=amd64 1.35 else 1.36 - ARCH=ia64 1.37 + ifeq ($(PROC_ARCH),IA64) 1.38 + ARCH=ia64 1.39 + endif 1.40 endif 1.41 LIBARCH=$(ARCH) 1.42 # Value of Java os.arch property
2.1 --- a/make/jprt.config Mon Mar 16 16:18:10 2009 -0700 2.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 2.3 @@ -1,330 +0,0 @@ 2.4 -#!echo "This is not a shell script" 2.5 -############################################################################# 2.6 -# 2.7 -# Copyright 2006-2009 Sun Microsystems, Inc. All Rights Reserved. 2.8 -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 2.9 -# 2.10 -# This code is free software; you can redistribute it and/or modify it 2.11 -# under the terms of the GNU General Public License version 2 only, as 2.12 -# published by the Free Software Foundation. Sun designates this 2.13 -# particular file as subject to the "Classpath" exception as provided 2.14 -# by Sun in the LICENSE file that accompanied this code. 2.15 -# 2.16 -# This code is distributed in the hope that it will be useful, but WITHOUT 2.17 -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 2.18 -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 2.19 -# version 2 for more details (a copy is included in the LICENSE file that 2.20 -# accompanied this code). 2.21 -# 2.22 -# You should have received a copy of the GNU General Public License version 2.23 -# 2 along with this work; if not, write to the Free Software Foundation, 2.24 -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2.25 -# 2.26 -# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 2.27 -# CA 95054 USA or visit www.sun.com if you need additional information or 2.28 -# have any questions. 2.29 -# 2.30 -############################################################################# 2.31 -# 2.32 -# JPRT shell configuration for building. 2.33 -# 2.34 -# Input environment variables: 2.35 -# ALT_BOOTDIR 2.36 -# ALT_SLASH_JAVA 2.37 -# ALT_JDK_IMPORT_PATH 2.38 -# Windows Only: 2.39 -# PATH 2.40 -# VS71COMNTOOLS 2.41 -# PROCESSOR_IDENTIFIER 2.42 -# ROOTDIR 2.43 -# 2.44 -# Output variable settings: 2.45 -# make Full path to GNU make 2.46 -# compiler_path Path to compiler bin directory 2.47 -# compiler_name Unique name of this compiler 2.48 -# 2.49 -# Output environment variables: 2.50 -# PATH 2.51 -# ALT_COMPILER_PATH 2.52 -# Windows Only: 2.53 -# ALT_MSDEVTOOLS_PATH 2.54 -# ALT_DEVTOOLS_PATH (To avoid the C:/UTILS default) 2.55 -# LIB 2.56 -# INCLUDE 2.57 -# 2.58 -# After JDK6, most settings will be found via ALT_SLASH_JAVA or 2.59 -# by way of other system environment variables. If this was JDK5 2.60 -# or an older JDK, you might need to export more ALT_* variables. 2.61 -# 2.62 -# On Windows AMD64, if MSSDK is not set, assumes Platform SDK is installed at: 2.63 -# C:/Program Files/Microsoft Platform SDK 2.64 -# 2.65 -############################################################################# 2.66 - 2.67 -############################################################################# 2.68 -# Error 2.69 -error() # message 2.70 -{ 2.71 - echo "ERROR: $1" 2.72 - exit 6 2.73 -} 2.74 -# Directory must exist 2.75 -dirMustExist() # dir name 2.76 -{ 2.77 - if [ ! -d "$1" ] ; then 2.78 - error "Directory for $2 does not exist: $1" 2.79 - fi 2.80 -} 2.81 -# File must exist 2.82 -fileMustExist() # dir name 2.83 -{ 2.84 - if [ ! -f "$1" ] ; then 2.85 - error "File for $2 does not exist: $1" 2.86 - fi 2.87 -} 2.88 -############################################################################# 2.89 - 2.90 -# Should be set by JPRT as the 3 basic inputs 2.91 -bootdir="${ALT_BOOTDIR}" 2.92 -slashjava="${ALT_SLASH_JAVA}" 2.93 -jdk_import="${ALT_JDK_IMPORT_PATH}" 2.94 - 2.95 -# The /java/devtools items 2.96 -jdk_devtools="${slashjava}/devtools" 2.97 -share="${jdk_devtools}/share" 2.98 - 2.99 -# The 3 bin directories in common to all platforms 2.100 -sharebin="${share}/bin" 2.101 - 2.102 -# Check input 2.103 -dirMustExist "${bootdir}" ALT_BOOTDIR 2.104 -dirMustExist "${slashjava}" ALT_SLASH_JAVA 2.105 -dirMustExist "${jdk_import}" ALT_JDK_IMPORT_PATH 2.106 - 2.107 -# Uses 'uname -s', but only expect SunOS or Linux, assume Windows otherwise. 2.108 -osname=`uname -s` 2.109 -if [ "${osname}" = SunOS ] ; then 2.110 - 2.111 - # SOLARIS: Sparc or X86 2.112 - osarch=`uname -p` 2.113 - if [ "${osarch}" = sparc ] ; then 2.114 - solaris_arch=sparc 2.115 - else 2.116 - solaris_arch=i386 2.117 - fi 2.118 - 2.119 - # Get the compilers into path (make sure it matches ALT setting) 2.120 - if [ "${JPRT_SOLARIS_COMPILER_NAME}" != "" ] ; then 2.121 - compiler_name=${JPRT_SOLARIS_COMPILER_NAME} 2.122 - else 2.123 - compiler_name=SS12 2.124 - fi 2.125 - compiler_path=${jdk_devtools}/${solaris_arch}/SUNWspro/${compiler_name}/bin 2.126 - ALT_COMPILER_PATH="${compiler_path}" 2.127 - export ALT_COMPILER_PATH 2.128 - dirMustExist "${compiler_path}" ALT_COMPILER_PATH 2.129 - path4sdk=${compiler_path}:${sharebin} 2.130 - 2.131 - # Add basic solaris system paths 2.132 - path4sdk=${path4sdk}:/usr/ccs/bin:/usr/ccs/lib:/usr/bin:/bin:/usr/sfw/bin 2.133 - 2.134 - # Get the previous JDK to be used to bootstrap the build 2.135 - path4sdk=${bootdir}/bin:${path4sdk} 2.136 - 2.137 - # Find GNU make 2.138 - make=/usr/sfw/bin/gmake 2.139 - if [ ! -f ${make} ] ; then 2.140 - make=/opt/sfw/bin/gmake 2.141 - if [ ! -f ${make} ] ; then 2.142 - make=${jdk_devtools}/${solaris_arch}/bin/gnumake 2.143 - fi 2.144 - fi 2.145 - fileMustExist "${make}" make 2.146 - 2.147 - # File creation mask 2.148 - umask 002 2.149 - 2.150 -elif [ "${osname}" = Linux ] ; then 2.151 - 2.152 - # LINUX: X86, AMD64 2.153 - osarch=`uname -m` 2.154 - if [ "${osarch}" = i686 ] ; then 2.155 - linux_arch=i586 2.156 - elif [ "${osarch}" = x86_64 ] ; then 2.157 - linux_arch=amd64 2.158 - fi 2.159 - 2.160 - # Get the compilers into path (make sure it matches ALT setting) 2.161 - compiler_path=/usr/bin 2.162 - compiler_name=usr_bin 2.163 - ALT_COMPILER_PATH="${compiler_path}" 2.164 - export ALT_COMPILER_PATH 2.165 - dirMustExist "${compiler_path}" ALT_COMPILER_PATH 2.166 - path4sdk=${compiler_path}:${sharebin} 2.167 - 2.168 - # Add basic paths 2.169 - path4sdk=${path4sdk}:/usr/bin:/bin:/usr/sbin:/sbin 2.170 - 2.171 - # Get the previous JDK to be used to bootstrap the build 2.172 - path4sdk=${bootdir}/bin:${path4sdk} 2.173 - 2.174 - # Find GNU make 2.175 - make=/usr/bin/make 2.176 - fileMustExist "${make}" make 2.177 - 2.178 - umask 002 2.179 - 2.180 -else 2.181 - 2.182 - # Windows: Differs on CYGWIN vs. MKS, and the compiler available. 2.183 - # Also, blanks in pathnames gives GNU make headaches, so anything placed 2.184 - # in any ALT_* variable should be the short windows dosname. 2.185 - 2.186 - # WINDOWS: Install and use MKS or CYGWIN (should have already been done) 2.187 - # Assumption here is that you are in a shell window via MKS or cygwin. 2.188 - # MKS install should have defined the environment variable ROOTDIR. 2.189 - # We also need to figure out which one we have: X86, AMD64 2.190 - if [ "`echo ${PROCESSOR_IDENTIFIER} | fgrep AMD64`" != "" ] ; then 2.191 - windows_arch=amd64 2.192 - else 2.193 - windows_arch=i586 2.194 - fi 2.195 - 2.196 - # We need to determine if we are running a CYGWIN shell or an MKS shell 2.197 - # (if uname isn't available, then it will be unix_toolset=unknown) 2.198 - unix_toolset=unknown 2.199 - if [ "`uname -a | fgrep Cygwin`" = "" -a -d "${ROOTDIR}" ] ; then 2.200 - # We kind of assume ROOTDIR is where MKS is and it's ok 2.201 - unix_toolset=MKS 2.202 - mkshome=`dosname -s "${ROOTDIR}"` 2.203 - # Utility to convert to short pathnames without spaces 2.204 - dosname="${mkshome}/mksnt/dosname -s" 2.205 - # Most unix utilities are in the mksnt directory of ROOTDIR 2.206 - unixcommand_path="${mkshome}/mksnt" 2.207 - path4sdk="${sharebin};${unixcommand_path}" 2.208 - dirMustExist "${unixcommand_path}" ALT_UNIXCOMMAND_PATH 2.209 - devtools_path="${jdk_devtools}/win32/bin" 2.210 - path4sdk="${devtools_path};${path4sdk}" 2.211 - # Normally this need not be set, but on Windows it's default is C:/UTILS 2.212 - ALT_DEVTOOLS_PATH="${devtools_path}" 2.213 - export ALT_DEVTOOLS_PATH 2.214 - dirMustExist "${devtools_path}" ALT_DEVTOOLS_PATH 2.215 - # Find GNU make 2.216 - make="${devtools_path}/gnumake.exe" 2.217 - fileMustExist "${make}" make 2.218 - elif [ "`uname -a | fgrep Cygwin`" != "" -a -f /bin/cygpath ] ; then 2.219 - # For CYGWIN, uname will have "Cygwin" in it, and /bin/cygpath should exist 2.220 - unix_toolset=CYGWIN 2.221 - # Utility to convert to short pathnames without spaces 2.222 - dosname="/usr/bin/cygpath -a -m -s" 2.223 - # Most unix utilities are in the /usr/bin 2.224 - unixcommand_path="/usr/bin" 2.225 - path4sdk="${sharebin};${unixcommand_path}" 2.226 - dirMustExist "${unixcommand_path}" ALT_UNIXCOMMAND_PATH 2.227 - # Find GNU make 2.228 - make="${unixcommand_path}/make.exe" 2.229 - fileMustExist "${make}" make 2.230 - else 2.231 - echo "WARNING: Cannot figure out if this is MKS or CYGWIN" 2.232 - fi 2.233 - 2.234 - # WINDOWS: Compiler setup (nasty part) 2.235 - # NOTE: You can use vcvars32.bat to set PATH, LIB, and INCLUDE. 2.236 - # NOTE: CYGWIN has a link.exe too, make sure the compilers are first 2.237 - if [ "${windows_arch}" = i586 ] ; then 2.238 - # 32bit Windows compiler settings 2.239 - # VisualStudio .NET 2003 VC++ 7.1 (VS71COMNTOOLS should be defined) 2.240 - vs_root=`${dosname} "${VS71COMNTOOLS}/../.."` 2.241 - # Fill in PATH, LIB, and INCLUDE (unset all others to make sure) 2.242 - msdev_root="${vs_root}/Common7/Tools" 2.243 - msdevtools_path="${msdev_root}/bin" 2.244 - vc7_root="${vs_root}/Vc7" 2.245 - compiler_path="${vc7_root}/bin" 2.246 - compiler_name=VS2003 2.247 - platform_sdk="${vc7_root}/PlatformSDK" 2.248 - # LIB and INCLUDE must use ; as a separator 2.249 - include4sdk="${vc7_root}/atlmfc/include" 2.250 - include4sdk="${include4sdk};${vc7_root}/include" 2.251 - include4sdk="${include4sdk};${platform_sdk}/include/prerelease" 2.252 - include4sdk="${include4sdk};${platform_sdk}/include" 2.253 - include4sdk="${include4sdk};${vs_root}/SDK/v1.1/include" 2.254 - lib4sdk="${vc7_root}/atlmfc/lib" 2.255 - lib4sdk="${lib4sdk};${vc7_root}/lib" 2.256 - lib4sdk="${lib4sdk};${platform_sdk}/lib/prerelease" 2.257 - lib4sdk="${lib4sdk};${platform_sdk}/lib" 2.258 - lib4sdk="${lib4sdk};${vs_root}/SDK/v1.1/lib" 2.259 - # Search path and DLL locating path 2.260 - # WARNING: CYGWIN has a link.exe too, make sure compilers are first 2.261 - path4sdk="${vs_root}/Common7/Tools/bin;${path4sdk}" 2.262 - path4sdk="${vs_root}/SDK/v1.1/bin;${path4sdk}" 2.263 - path4sdk="${vs_root}/Common7/Tools;${path4sdk}" 2.264 - path4sdk="${vs_root}/Common7/Tools/bin/prerelease;${path4sdk}" 2.265 - path4sdk="${vs_root}/Common7/IDE;${path4sdk}" 2.266 - path4sdk="${compiler_path};${path4sdk}" 2.267 - elif [ "${windows_arch}" = amd64 ] ; then 2.268 - # AMD64 64bit Windows compiler settings 2.269 - if [ "${MSSDK}" != "" ] ; then 2.270 - platform_sdk="${MSSDK}" 2.271 - else 2.272 - platform_sdk=`${dosname} "C:/Program Files/Microsoft Platform SDK/"` 2.273 - fi 2.274 - compiler_path="${platform_sdk}/Bin/win64/x86/AMD64" 2.275 - compiler_name=VS2005_PSDK 2.276 - msdevtools_path="${platform_sdk}/Bin" 2.277 - # LIB and INCLUDE must use ; as a separator 2.278 - include4sdk="${platform_sdk}/Include" 2.279 - include4sdk="${include4sdk};${platform_sdk}/Include/crt/sys" 2.280 - include4sdk="${include4sdk};${platform_sdk}/Include/mfc" 2.281 - include4sdk="${include4sdk};${platform_sdk}/Include/atl" 2.282 - include4sdk="${include4sdk};${platform_sdk}/Include/crt" 2.283 - lib4sdk="${platform_sdk}/Lib/AMD64" 2.284 - lib4sdk="${lib4sdk};${platform_sdk}/Lib/AMD64/atlmfc" 2.285 - # Search path and DLL locating path 2.286 - # WARNING: CYGWIN has a link.exe too, make sure compilers are first 2.287 - path4sdk="${platform_sdk}/bin;${path4sdk}" 2.288 - path4sdk="${compiler_path};${path4sdk}" 2.289 - fi 2.290 - # Export LIB and INCLUDE 2.291 - unset lib 2.292 - unset Lib 2.293 - LIB="${lib4sdk}" 2.294 - export LIB 2.295 - unset include 2.296 - unset Include 2.297 - INCLUDE="${include4sdk}" 2.298 - export INCLUDE 2.299 - # Set the ALT variable 2.300 - ALT_COMPILER_PATH=`${dosname} "${compiler_path}"` 2.301 - export ALT_COMPILER_PATH 2.302 - dirMustExist "${compiler_path}" ALT_COMPILER_PATH 2.303 - ALT_MSDEVTOOLS_PATH=`${dosname} "${msdevtools_path}"` 2.304 - export ALT_MSDEVTOOLS_PATH 2.305 - dirMustExist "${msdevtools_path}" ALT_MSDEVTOOLS_PATH 2.306 - 2.307 - # WINDOWS: Get the previous JDK to be used to bootstrap the build 2.308 - path4sdk="${bootdir}/bin;${path4sdk}" 2.309 - 2.310 - # Turn all \\ into /, remove duplicates and trailing / 2.311 - slash_path="`echo ${path4sdk} | sed -e 's@\\\\@/@g' -e 's@//@/@g' -e 's@/$@@' -e 's@/;@;@g'`" 2.312 - 2.313 - # For windows, it's hard to know where the system is, so we just add this 2.314 - # to PATH. 2.315 - path4sdk="${slash_path};${PATH}" 2.316 - 2.317 - # Convert path4sdk to cygwin style 2.318 - if [ "${unix_toolset}" = CYGWIN ] ; then 2.319 - path4sdk="`/usr/bin/cygpath -p ${path4sdk}`" 2.320 - fi 2.321 - 2.322 -fi 2.323 - 2.324 -# Export PATH setting 2.325 -PATH="${path4sdk}" 2.326 -export PATH 2.327 - 2.328 -# Things we need to unset 2.329 -unset LD_LIBRARY_PATH 2.330 -unset LD_LIBRARY_PATH_32 2.331 -unset LD_LIBRARY_PATH_64 2.332 -unset JAVA_HOME 2.333 -