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