make/scripts/vsvars.sh
author anthony
Tue, 30 Oct 2012 15:04:15 +0400
changeset 14276 50c4a858cb40
parent 7361 f412b1d9549b
child 14277 e03d509a553e
permissions -rw-r--r--
8001764: vsvars.sh should support VS2012 Summary: Update the vsvars.sh script to support VS2012 Reviewed-by: ohair, tbell
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7361
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
     1
#!/bin/sh
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
     2
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
     3
#
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
     4
# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
     5
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
     6
#
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
     7
# This code is free software; you can redistribute it and/or modify it
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
     8
# under the terms of the GNU General Public License version 2 only, as
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
     9
# published by the Free Software Foundation.
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    10
#
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    15
# accompanied this code).
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    16
#
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    20
#
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    23
# questions.
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    24
#
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    25
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    26
# This file should be used to set the Visual Studio environment
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    27
#   variables normally set by the vcvars32.bat or vcvars64.bat file or
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    28
#   SetEnv.cmd for older SDKs.
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    29
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    30
# Use cygpath?
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    31
isCygwin="`uname -s | grep CYGWIN`"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    32
if [ "${isCygwin}" != "" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    33
  cygpath="/usr/bin/cygpath"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    34
  cygpath_short="${cygpath} -m -s"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    35
  cygpath_windows="${cygpath} -w -s"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    36
  cygpath_path="${cygpath} -p"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    37
  pathsep=':'
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    38
else
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    39
  cygpath="dosname"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    40
  cygpath_short="${cygpath} -s"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    41
  cygpath_windows="${cygpath} -s"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    42
  cygpath_path="echo"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    43
  pathsep=';'
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    44
fi
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    45
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    46
########################################################################
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    47
# Error functions
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    48
msg() # message
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    49
{
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    50
  echo "$1" 1>&2
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    51
}
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    52
error() # message
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    53
{
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    54
  msg "ERROR: $1"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    55
  exit 1
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    56
}
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    57
warning() # message
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    58
{
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    59
  msg "WARNING: $1"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    60
}
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    61
envpath() # path
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    62
{
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    63
  if [ "${cygpath_short}" != "" -a -d "$1" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    64
    ${cygpath_short} "$1"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    65
  else
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    66
    echo "$1"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    67
  fi
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    68
}
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    69
########################################################################
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    70
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    71
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    72
# Defaults settings
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    73
debug="false"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    74
verbose="false"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    75
shellStyle="sh"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    76
parentCsh="` ps -p ${PPID} 2> /dev/null | grep csh `"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    77
if [ "${parentCsh}" != "" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    78
  shellStyle="csh"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    79
fi
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    80
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    81
set -e
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    82
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    83
# Check environment first
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    84
if [ "${PROGRAMFILES}" != "" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    85
  progfiles=`envpath "${PROGRAMFILES}"`
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    86
elif [ "${ProgramFiles}" != "" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    87
  progfiles=`envpath "${ProgramFiles}"`
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    88
elif [ "${SYSTEMDRIVE}" != "" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    89
  progfiles=`envpath "${SYSTEMDRIVE}/Program Files"`
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    90
elif [ "${SystemDrive}" != "" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    91
  progfiles=`envpath "${SystemDrive}/Program Files"`
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    92
else
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    93
  error "No PROGRAMFILES or SYSTEMDRIVE defined in environment"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    94
fi
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    95
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    96
# Arch data model
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    97
if [ "${PROCESSOR_IDENTIFIER}" != "" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    98
  arch=`echo "${PROCESSOR_IDENTIFIER}" | cut -d' ' -f1`
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
    99
elif [ "${MACHTYPE}" != "" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   100
  if [ "`echo ${MACHTYPE} | grep 64`" != "" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   101
    # Assume this is X64, not IA64
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   102
    arch="x64"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   103
  else
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   104
    arch="x86"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   105
  fi
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   106
else
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   107
 arch="`uname -m`"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   108
fi
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   109
if [ "${arch}" = "X86" -o \
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   110
     "${arch}" = "386" -o "${arch}" = "i386" -o \
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   111
     "${arch}" = "486" -o "${arch}" = "i486" -o \
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   112
     "${arch}" = "586" -o "${arch}" = "i586" -o \
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   113
     "${arch}" = "686" -o "${arch}" = "i686" -o \
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   114
     "${arch}" = "86" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   115
  arch="x86"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   116
fi
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   117
if [ "${arch}" = "X64"     -o \
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   118
     "${arch}" = "8664"    -o "${arch}" = "i8664"   -o \
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   119
     "${arch}" = "amd64"   -o "${arch}" = "AMD64"   -o \
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   120
     "${arch}" = "EM64T"   -o "${arch}" = "emt64t"  -o \
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   121
     "${arch}" = "intel64" -o "${arch}" = "Intel64" -o \
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   122
     "${arch}" = "64" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   123
  arch="x64"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   124
  binarch64="/amd64"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   125
fi
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   126
if [ "${arch}" = "IA64" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   127
  arch="ia64"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   128
  binarch64="/ia64"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   129
fi
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   130
if [ "${arch}" != "x86" -a "${arch}" != "x64" -a "${arch}" != "ia64" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   131
 error "No PROCESSOR_IDENTIFIER or MACHTYPE environment variables and uname -m is not helping"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   132
fi
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   133
if [ "${arch}" = "x86" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   134
  arch_data_model=32
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   135
  progfiles32="${progfiles}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   136
  progfiles64="${progfiles}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   137
else
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   138
  arch_data_model=64
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   139
  progfiles32="${progfiles}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   140
  if [ "${PROGRAMW6432}" != "" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   141
    progfiles64=`envpath "${PROGRAMW6432}"`
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   142
  else
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   143
    progfiles64=`envpath "C:/Program Files"`
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   144
  fi
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   145
fi
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   146
14276
50c4a858cb40 8001764: vsvars.sh should support VS2012
anthony
parents: 7361
diff changeset
   147
# VS2012 (VC11)
50c4a858cb40 8001764: vsvars.sh should support VS2012
anthony
parents: 7361
diff changeset
   148
if [ "${VS110COMNTOOLS}" = "" ] ; then
50c4a858cb40 8001764: vsvars.sh should support VS2012
anthony
parents: 7361
diff changeset
   149
  VS110COMNTOOLS="${progfiles32}/Microsoft Visual Studio 11.0/Common7/Tools/"
50c4a858cb40 8001764: vsvars.sh should support VS2012
anthony
parents: 7361
diff changeset
   150
  export VS110COMNTOOLS
50c4a858cb40 8001764: vsvars.sh should support VS2012
anthony
parents: 7361
diff changeset
   151
fi
50c4a858cb40 8001764: vsvars.sh should support VS2012
anthony
parents: 7361
diff changeset
   152
vc11Bin32Dir=`envpath "${VS110COMNTOOLS}"`/../../VC/Bin
50c4a858cb40 8001764: vsvars.sh should support VS2012
anthony
parents: 7361
diff changeset
   153
vc11Bin64Dir="${vc11Bin32Dir}"
50c4a858cb40 8001764: vsvars.sh should support VS2012
anthony
parents: 7361
diff changeset
   154
vc11vars32Bat="vcvars32.bat"
50c4a858cb40 8001764: vsvars.sh should support VS2012
anthony
parents: 7361
diff changeset
   155
vc11vars64Bat="vcvars64.bat"
50c4a858cb40 8001764: vsvars.sh should support VS2012
anthony
parents: 7361
diff changeset
   156
7361
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   157
# VS2010 (VC10)
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   158
if [ "${VS100COMNTOOLS}" = "" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   159
  VS100COMNTOOLS="${progfiles32}/Microsoft Visual Studio 10.0/Common7/Tools/"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   160
  export VS100COMNTOOLS
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   161
fi
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   162
vc10Bin32Dir=`envpath "${VS100COMNTOOLS}"`/../../VC/Bin
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   163
vc10Bin64Dir="${vc10Bin32Dir}${binarch64}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   164
vc10vars32Bat="vcvars32.bat"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   165
vc10vars64Bat="vcvars64.bat"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   166
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   167
# VS2008 (VC9)
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   168
if [ "${VS90COMNTOOLS}" = "" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   169
  VS90COMNTOOLS="${progfiles32}/Microsoft Visual Studio 9.0/Common7/Tools/"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   170
  export VS90COMNTOOLS
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   171
fi
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   172
vc9Bin32Dir=`envpath "${VS90COMNTOOLS}"`/../../VC/Bin
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   173
vc9Bin64Dir="${vc9Bin32Dir}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   174
vc9vars32Bat="vcvars32.bat"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   175
vc9vars64Bat="vcvars64.bat"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   176
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   177
# VS2005 (VC8)
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   178
if [ "${VS80COMNTOOLS}" = "" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   179
  VS80COMNTOOLS="${progfiles32}/Microsoft Visual Studio 8.0/Common7/Tools/"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   180
  export VS80COMNTOOLS
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   181
fi
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   182
vc8Bin32Dir=`envpath "${VS80COMNTOOLS}"`/../../VC/Bin
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   183
vc8Bin64Dir="${progfiles64}/Microsoft Platform SDK"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   184
vc8vars32Bat="vcvars32.bat"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   185
vc8vars64Bat="SetEnv.cmd /X64"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   186
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   187
# VS2003 (VC7)
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   188
if [ "${VS71COMNTOOLS}" = "" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   189
  VS71COMNTOOLS="${progfiles32}/Microsoft Visual Studio .NET 2003/Common7/Tools/"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   190
  export VS71COMNTOOLS
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   191
fi
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   192
vc7Bin32Dir=`envpath "${VS71COMNTOOLS}"`/../../VC7/Bin
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   193
vc7Bin64Dir="${progfiles64}/Microsoft Platform SDK"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   194
vc7vars32Bat="vcvars32.bat"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   195
vc7vars64Bat="SetEnv.cmd /X64"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   196
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   197
# Force user to select
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   198
vcSelection=""
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   199
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   200
# Parse options
14276
50c4a858cb40 8001764: vsvars.sh should support VS2012
anthony
parents: 7361
diff changeset
   201
usage="Usage: $0 [-help] [-debug] [-v] [-c] [-s] [-p] [-v11] [-v10] [-v9] [-v8] [-v7] [-32] [-64]"
7361
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   202
while [ $# -gt 0 ] ; do
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   203
  if [ "$1" = "-help" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   204
    msg "${usage}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   205
    msg "  -help    Print out this help message"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   206
    msg "  -debug   Print out extra env variables to help debug this script"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   207
    msg "  -v       Verbose output warns about missing directories"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   208
    msg "  -c       Print out csh style output"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   209
    msg "  -s       Print out sh style output"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   210
    msg "  -p       Print out properties style output"
14276
50c4a858cb40 8001764: vsvars.sh should support VS2012
anthony
parents: 7361
diff changeset
   211
    msg "  -v11     Use Visual Studio 11 VS2012"
7361
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   212
    msg "  -v10     Use Visual Studio 10 VS2010"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   213
    msg "  -v9      Use Visual Studio 9 VS2008"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   214
    msg "  -v8      Use Visual Studio 8 VS2005"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   215
    msg "  -v7      Use Visual Studio 7 VS2003"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   216
    msg "  -32      Force 32bit"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   217
    msg "  -64      Force 64bit"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   218
    exit 0
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   219
  elif [ "$1" = "-debug" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   220
    debug="true"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   221
    shift
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   222
  elif [ "$1" = "-v" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   223
    verbose="true"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   224
    shift
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   225
  elif [ "$1" = "-c" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   226
    shellStyle="csh"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   227
    shift
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   228
  elif [ "$1" = "-s" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   229
    shellStyle="sh"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   230
    shift
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   231
  elif [ "$1" = "-p" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   232
    shellStyle="props"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   233
    shift
14276
50c4a858cb40 8001764: vsvars.sh should support VS2012
anthony
parents: 7361
diff changeset
   234
  elif [ "$1" = "-v11" ] ; then
50c4a858cb40 8001764: vsvars.sh should support VS2012
anthony
parents: 7361
diff changeset
   235
    vcBin32Dir="${vc11Bin32Dir}"
50c4a858cb40 8001764: vsvars.sh should support VS2012
anthony
parents: 7361
diff changeset
   236
    vcBin64Dir="${vc11Bin64Dir}"
50c4a858cb40 8001764: vsvars.sh should support VS2012
anthony
parents: 7361
diff changeset
   237
    vcvars32Bat="${vc11vars32Bat}"
50c4a858cb40 8001764: vsvars.sh should support VS2012
anthony
parents: 7361
diff changeset
   238
    vcvars64Bat="${vc11vars64Bat}"
50c4a858cb40 8001764: vsvars.sh should support VS2012
anthony
parents: 7361
diff changeset
   239
    vcSelection="11"
50c4a858cb40 8001764: vsvars.sh should support VS2012
anthony
parents: 7361
diff changeset
   240
    shift
7361
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   241
  elif [ "$1" = "-v10" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   242
    vcBin32Dir="${vc10Bin32Dir}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   243
    vcBin64Dir="${vc10Bin64Dir}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   244
    vcvars32Bat="${vc10vars32Bat}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   245
    vcvars64Bat="${vc10vars64Bat}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   246
    vcSelection="10"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   247
    shift
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   248
  elif [ "$1" = "-v9" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   249
    vcBin32Dir="${vc9Bin32Dir}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   250
    vcBin64Dir="${vc9Bin64Dir}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   251
    vcvars32Bat="${vc9vars32Bat}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   252
    vcvars64Bat="${vc9vars64Bat}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   253
    vcSelection="9"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   254
    shift
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   255
  elif [ "$1" = "-v8" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   256
    vcBin32Dir="${vc8Bin32Dir}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   257
    vcBin64Dir="${vc8Bin64Dir}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   258
    vcvars32Bat="${vc8vars32Bat}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   259
    vcvars64Bat="${vc8vars64Bat}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   260
    vcSelection="8"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   261
    shift
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   262
  elif [ "$1" = "-v7" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   263
    vcBin32Dir="${vc7Bin32Dir}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   264
    vcBin64Dir="${vc7Bin64Dir}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   265
    vcvars32Bat="${vc7vars32Bat}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   266
    vcvars64Bat="${vc7vars64Bat}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   267
    vcSelection="7"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   268
    shift
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   269
  elif [ "$1" = "-32" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   270
    arch_data_model=32
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   271
    shift
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   272
  elif [ "$1" = "-64" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   273
    arch_data_model=64
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   274
    shift
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   275
  else
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   276
    msg "${usage}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   277
    error "Unknown option: $1"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   278
  fi
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   279
done
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   280
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   281
# Need to pick
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   282
if [ "${vcSelection}" = "" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   283
  msg "${usage}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   284
  error "You must pick the version"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   285
fi
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   286
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   287
# Which vcvars bat file to run
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   288
if [ "${arch_data_model}" = "32" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   289
  vcBinDir="${vcBin32Dir}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   290
  vcvarsBat="${vcvars32Bat}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   291
fi
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   292
if [ "${arch_data_model}" = "64" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   293
  vcBinDir="${vcBin64Dir}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   294
  vcvarsBat="${vcvars64Bat}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   295
fi
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   296
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   297
# Do not allow any error returns
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   298
set -e
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   299
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   300
# Different systems have different awk's
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   301
if [ -f /usr/bin/nawk ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   302
  awk="nawk"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   303
elif [ -f /usr/bin/gawk ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   304
  awk="gawk"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   305
else
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   306
  awk="awk"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   307
fi
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   308
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   309
if [ "${verbose}" = "true" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   310
  echo "# Welcome to verbose mode"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   311
  set -x
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   312
fi
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   313
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   314
if [ "${debug}" = "true" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   315
  echo "# Welcome to debug mode"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   316
  set -x
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   317
fi
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   318
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   319
# Temp file area
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   320
tmp="/tmp/vsvars.$$"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   321
rm -f -r ${tmp}
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   322
mkdir -p ${tmp}
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   323
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   324
# Check paths
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   325
checkPaths() # var path sep
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   326
{
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   327
  set -e
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   328
  sep="$3"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   329
  checklist="${tmp}/checklist"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   330
  printf "%s\n" "$2" | \
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   331
    sed -e 's@\\@/@g' | \
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   332
    sed -e 's@//@/@g' | \
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   333
    ${awk} -F"${sep}" '{for(i=1;i<=NF;i++){printf "%s\n",$i;}}'  \
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   334
      > ${checklist}
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   335
  cat ${checklist} | while read orig; do
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   336
    if [ "${orig}" != "" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   337
      if [ ! -d "${orig}" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   338
        warning "Directory in $1 does not exist: ${orig}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   339
      fi
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   340
    fi
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   341
  done
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   342
}
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   343
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   344
# Remove all duplicate entries
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   345
removeDeadDups() # string sep
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   346
{
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   347
  set -e
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   348
  sep="$2"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   349
  pathlist="${tmp}/pathlist"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   350
  printf "%s\n" "$1" | \
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   351
    sed -e 's@\\@/@g' | \
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   352
    sed -e 's@//@/@g' | \
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   353
    ${awk} -F"${sep}" '{for(i=1;i<=NF;i++){printf "%s\n",$i;}}'  \
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   354
      > ${pathlist}
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   355
  upaths="${tmp}/upaths"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   356
  cat ${pathlist} | while read orig; do
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   357
    p="${orig}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   358
    if [ "${cygpath_short}" != "" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   359
      if [ "${p}" != "" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   360
        if [ -d "${p}" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   361
          short=`${cygpath_short} "${p}"`
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   362
          if [ "${short}" != "" -a -d "${short}" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   363
            p=`${cygpath} "${short}"`
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   364
          fi
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   365
          echo "${p}" >> ${upaths}
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   366
        fi
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   367
      fi
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   368
    fi
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   369
  done
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   370
  newpaths=""
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   371
  for i in  `cat ${upaths}` ; do
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   372
    # For some reason, \r characters can get into this
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   373
    i=`echo "${i}" | tr -d '\r' | sed -e 's@/$@@'`
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   374
    if [ "${newpaths}" = "" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   375
      newpaths="${i}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   376
    else
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   377
      newpaths="${newpaths}${sep}${i}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   378
    fi
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   379
  done
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   380
  printf "%s\n" "${newpaths}" | \
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   381
    ${awk} -F"${sep}" \
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   382
       '{a[$1];printf "%s",$1;for(i=2;i<=NF;i++){if(!($i in a)){a[$i];printf "%s%s",FS,$i;}};printf "\n";}'
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   383
}
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   384
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   385
# Create bat file to process Visual Studio vcvars*.bat files
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   386
createBat() # batfile bindir command
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   387
{
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   388
  bat="$1"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   389
  bindir="$2"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   390
  command="$3"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   391
  stdout="${bat}.stdout"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   392
  rm -f ${bat} ${stdout}
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   393
  echo "Output from: ${command}" > ${stdout}
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   394
  bdir=`envpath "${bindir}"`
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   395
  cat > ${bat} << EOF  
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   396
REM Pick the right vcvars bat file
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   397
REM Empty these out so we only get the additions we want
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   398
set INCLUDE=
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   399
set LIB=
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   400
set LIBPATH=
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   401
set MSVCDIR=
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   402
set MSSdk=
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   403
set Mstools=
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   404
set DevEnvDir=
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   405
set VCINSTALLDIR=
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   406
set VSINSTALLDIR=
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   407
set WindowsSdkDir=
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   408
REM Run the vcvars bat file, send all output to stderr
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   409
call `${cygpath_windows} ${bdir}`\\${command} > `${cygpath_windows} "${stdout}"`
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   410
REM Echo out env var settings
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   411
echo VS_VS71COMNTOOLS="%VS71COMNTOOLS%"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   412
echo export VS_VS71COMNTOOLS
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   413
echo VS_VS80COMNTOOLS="%VS80COMNTOOLS%"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   414
echo export VS_VS80COMNTOOLS
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   415
echo VS_VS90COMNTOOLS="%VS90COMNTOOLS%"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   416
echo export VS_VS90COMNTOOLS
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   417
echo VS_VS100COMNTOOLS="%VS100COMNTOOLS%"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   418
echo export VS_VS100COMNTOOLS
14276
50c4a858cb40 8001764: vsvars.sh should support VS2012
anthony
parents: 7361
diff changeset
   419
echo VS_VS110COMNTOOLS="%VS110COMNTOOLS%"
50c4a858cb40 8001764: vsvars.sh should support VS2012
anthony
parents: 7361
diff changeset
   420
echo export VS_VS110COMNTOOLS
7361
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   421
echo VS_VCINSTALLDIR="%VCINSTALLDIR%"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   422
echo export VS_VCINSTALLDIR
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   423
echo VS_VSINSTALLDIR="%VSINSTALLDIR%"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   424
echo export VS_VSINSTALLDIR
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   425
echo VS_DEVENVDIR="%DevEnvDir%"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   426
echo export VS_DEVENVDIR
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   427
echo VS_MSVCDIR="%MSVCDIR%"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   428
echo export VS_MSVCDIR
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   429
echo VS_MSSDK="%MSSdk%"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   430
echo export VS_MSSDK
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   431
echo VS_MSTOOLS="%Mstools%"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   432
echo export VS_MSTOOLS
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   433
echo VS_WINDOWSSDKDIR="%WindowsSdkDir%"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   434
echo export VS_WINDOWSSDKDIR
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   435
echo VS_INCLUDE="%INCLUDE%"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   436
echo export VS_INCLUDE
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   437
echo VS_LIB="%LIB%"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   438
echo export VS_LIB
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   439
echo VS_LIBPATH="%LIBPATH%"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   440
echo export VS_LIBPATH
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   441
echo VS_WPATH="%PATH%"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   442
echo export VS_WPATH
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   443
EOF
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   444
  chmod a+x ${bat}
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   445
}
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   446
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   447
# Create env file
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   448
createEnv() # batfile envfile
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   449
{
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   450
  rm -f ${1}.stdout
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   451
  cmd.exe /Q /C `${cygpath_short} $1` | \
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   452
    sed -e 's@\\@/@g' | \
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   453
    sed -e 's@//@/@g' > $2
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   454
  if [ -f "${1}.stdout" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   455
    cat ${1}.stdout 1>&2
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   456
  fi
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   457
  chmod a+x $2
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   458
}
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   459
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   460
printEnv() # name pname vsname val
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   461
{
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   462
  name="$1"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   463
  pname="$2"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   464
  vsname="$3"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   465
  val="$4"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   466
  if [ "${val}" != "" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   467
    if [ "${shellStyle}" = "csh" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   468
      if [ "${debug}" = "true" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   469
        echo "setenv ${vsname} \"${val}\";"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   470
      fi
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   471
      echo "setenv ${name} \"${val}\";"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   472
    elif [ "${shellStyle}" = "sh" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   473
      if [ "${debug}" = "true" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   474
        echo "${vsname}=\"${val}\";"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   475
        echo "export ${vsname};"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   476
      fi
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   477
      echo "${name}=\"${val}\";"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   478
      echo "export ${name};"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   479
    elif [ "${shellStyle}" = "props" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   480
      echo "vs.${pname}=${val}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   481
    fi
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   482
  fi
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   483
}
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   484
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   485
#############################################################################
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   486
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   487
# Get Visual Studio settings
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   488
if [ "${cygpath}" != "" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   489
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   490
  # Create bat file to run
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   491
  batfile="${tmp}/vs-to-env.bat"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   492
  if [ ! -d "${vcBinDir}" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   493
    error "Does not exist: ${vcBinDir}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   494
  elif [ "${vcvarsBat}" = "" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   495
    error "No vcvars script: ${vcvarsBat}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   496
  else
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   497
    createBat "${batfile}" "${vcBinDir}" "${vcvarsBat}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   498
  fi
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   499
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   500
  # Run bat file to create environment variable settings
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   501
  envfile="${tmp}/env.sh"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   502
  createEnv "${batfile}" "${envfile}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   503
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   504
  # Read in the VS_* settings
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   505
  . ${envfile}
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   506
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   507
  # Derive unix style path, save old, and define new (remove dups)
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   508
  VS_UPATH=`${cygpath_path} "${VS_WPATH}"`
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   509
  export VS_UPATH
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   510
  VS_OPATH=`printf "%s" "${PATH}" | sed -e 's@\\\\@/@g'`
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   511
  export VS_OPATH
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   512
  VS_PATH=`removeDeadDups "${VS_UPATH}${pathsep}${VS_OPATH}" "${pathsep}"`
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   513
  export VS_PATH
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   514
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   515
fi
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   516
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   517
# Adjustments due to differences in vcvars*bat files
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   518
if [ "${VS_MSVCDIR}" = "" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   519
  VS_MSVCDIR="${VS_VCINSTALLDIR}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   520
fi
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   521
if [ "${VS_DEVENVDIR}" = "" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   522
  VS_DEVENVDIR="${VS_VSINSTALLDIR}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   523
fi
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   524
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   525
# Print env settings
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   526
#        env           vs.prop       vs env           value
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   527
#        -------       -------       ----------       -----
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   528
printEnv INCLUDE       include       VS_INCLUDE       "${VS_INCLUDE}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   529
printEnv LIB           lib           VS_LIB           "${VS_LIB}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   530
printEnv LIBPATH       libpath       VS_LIBPATH       "${VS_LIBPATH}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   531
if [ "${debug}" = "true" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   532
  printEnv UPATH         upath         VS_UPATH         "${VS_UPATH}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   533
  printEnv WPATH         wpath         VS_WPATH         "${VS_WPATH}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   534
  printEnv OPATH         opath         VS_OPATH         "${VS_OPATH}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   535
fi
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   536
printEnv PATH          path          VS_PATH          "${VS_PATH}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   537
printEnv VCINSTALLDIR  vcinstalldir  VS_VCINSTALLDIR  "${VS_VCINSTALLDIR}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   538
printEnv VSINSTALLDIR  vsinstalldir  VS_VSINSTALLDIR  "${VS_VSINSTALLDIR}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   539
printEnv MSVCDIR       msvcdir       VS_MSVCDIR       "${VS_MSVCDIR}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   540
printEnv MSSDK         mssdk         VS_MSSDK         "${VS_MSSDK}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   541
printEnv MSTOOLS       mstools       VS_MSTOOLS       "${VS_MSTOOLS}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   542
printEnv DEVENVDIR     devenvdir     VS_DEVENVDIR     "${VS_DEVENVDIR}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   543
printEnv WINDOWSSDKDIR windowssdkdir VS_WINDOWSSDKDIR "${VS_WINDOWSSDKDIR}"
14276
50c4a858cb40 8001764: vsvars.sh should support VS2012
anthony
parents: 7361
diff changeset
   544
if [ "${vcSelection}" = "11" ] ; then
50c4a858cb40 8001764: vsvars.sh should support VS2012
anthony
parents: 7361
diff changeset
   545
  printEnv VS110COMNTOOLS vs110comntools VS_VS110COMNTOOLS "${VS_VS110COMNTOOLS}"
50c4a858cb40 8001764: vsvars.sh should support VS2012
anthony
parents: 7361
diff changeset
   546
elif [ "${vcSelection}" = "10" ] ; then
7361
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   547
  printEnv VS100COMNTOOLS vs100comntools VS_VS100COMNTOOLS "${VS_VS100COMNTOOLS}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   548
elif [ "${vcSelection}" = "9" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   549
  printEnv VS90COMNTOOLS vs90comntools VS_VS90COMNTOOLS "${VS_VS90COMNTOOLS}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   550
elif [ "${vcSelection}" = "7" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   551
  printEnv VS71COMNTOOLS vs71comntools VS_VS71COMNTOOLS "${VS_VS71COMNTOOLS}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   552
elif [ "${vcSelection}" = "8" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   553
  printEnv VS80COMNTOOLS vs80comntools VS_VS80COMNTOOLS "${VS_VS80COMNTOOLS}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   554
fi
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   555
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   556
# Check final settings
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   557
if [ "${verbose}" = "true" ] ; then
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   558
  checkPaths "Windows PATH" "${VS_WPATH}" ";"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   559
  checkPaths LIB "${VS_LIB}" ";"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   560
  checkPaths INCLUDE "${VS_INCLUDE}" ";"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   561
  checkPaths PATH "${VS_PATH}" "${pathsep}"
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   562
fi
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   563
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   564
# Remove all temp files
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   565
rm -f -r ${tmp}
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   566
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   567
exit 0
f412b1d9549b 6909331: Add vsvars.sh to the jdk repository (handy cygwin way to get vcvars32.bat run)
ohair
parents:
diff changeset
   568