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