common/autoconf/generated-configure.sh

changeset 2223
01cc48ed67f3
parent 2222
7129b977c4af
child 2224
20daa32eec6f
     1.1 --- a/common/autoconf/generated-configure.sh	Fri May 04 11:00:26 2018 +0100
     1.2 +++ b/common/autoconf/generated-configure.sh	Wed May 16 15:52:51 2018 -0700
     1.3 @@ -640,6 +640,7 @@
     1.4  ENABLE_INTREE_EC
     1.5  SALIB_NAME
     1.6  HOTSPOT_MAKE_ARGS
     1.7 +MSVCP_DLL
     1.8  MSVCR_DLL
     1.9  LIBCXX
    1.10  LLVM_LIBS
    1.11 @@ -1065,6 +1066,7 @@
    1.12  with_override_jdk
    1.13  with_import_hotspot
    1.14  with_toolchain_type
    1.15 +with_toolchain_version
    1.16  with_jtreg
    1.17  with_extra_cflags
    1.18  with_extra_cxxflags
    1.19 @@ -1087,6 +1089,7 @@
    1.20  with_zlib
    1.21  with_stdc__lib
    1.22  with_msvcr_dll
    1.23 +with_msvcp_dll
    1.24  with_dxsdk
    1.25  with_dxsdk_lib
    1.26  with_dxsdk_include
    1.27 @@ -1908,6 +1911,10 @@
    1.28                            source
    1.29    --with-toolchain-type   the toolchain type (or family) to use, use '--help'
    1.30                            to show possible values [platform dependent]
    1.31 +  --with-toolchain-version
    1.32 +                          the version of the toolchain to look for, use
    1.33 +                          '--help' to show possible values [platform
    1.34 +                          dependent]
    1.35    --with-jtreg            Regression Test Harness [probed]
    1.36    --with-extra-cflags     extra flags to be used when compiling jdk c-files
    1.37    --with-extra-cxxflags   extra flags to be used when compiling jdk c++-files
    1.38 @@ -1937,8 +1944,10 @@
    1.39                            force linking of the C++ runtime on Linux to either
    1.40                            static or dynamic, default is static with dynamic as
    1.41                            fallback
    1.42 -  --with-msvcr-dll        copy this msvcr100.dll into the built JDK (Windows
    1.43 -                          only) [probed]
    1.44 +  --with-msvcr-dll        path to microsoft C runtime dll (msvcr*.dll)
    1.45 +                          (Windows only) [probed]
    1.46 +  --with-msvcp-dll        path to microsoft C++ runtime dll (msvcp*.dll)
    1.47 +                          (Windows only) [probed]
    1.48    --with-dxsdk            Deprecated. Option is kept for backwards
    1.49                            compatibility and is ignored
    1.50    --with-dxsdk-lib        Deprecated. Option is kept for backwards
    1.51 @@ -4192,7 +4201,7 @@
    1.52  
    1.53  
    1.54  #
    1.55 -# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
    1.56 +# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
    1.57  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    1.58  #
    1.59  # This code is free software; you can redistribute it and/or modify it
    1.60 @@ -4216,12 +4225,59 @@
    1.61  # questions.
    1.62  #
    1.63  
    1.64 -
    1.65 -
    1.66 -
    1.67 -
    1.68 -
    1.69 -
    1.70 +################################################################################
    1.71 +
    1.72 +VALID_VS_VERSIONS="2010 2012 2013"
    1.73 +
    1.74 +VS_DESCRIPTION_2010="Microsoft Visual Studio 2010"
    1.75 +VS_VERSION_INTERNAL_2010=100
    1.76 +VS_MSVCR_2010=msvcr100.dll
    1.77 +# We don't use msvcp on Visual Studio 2010
    1.78 +#VS_MSVCP_2010=msvcp100.dll
    1.79 +VS_ENVVAR_2010="VS100COMNTOOLS"
    1.80 +VS_VS_INSTALLDIR_2010="Microsoft Visual Studio 10.0"
    1.81 +VS_SDK_INSTALLDIR_2010="Microsoft SDKs/Windows/v7.1"
    1.82 +VS_VS_PLATFORM_NAME_2010="v100"
    1.83 +VS_SDK_PLATFORM_NAME_2010="Windows7.1SDK"
    1.84 +
    1.85 +VS_DESCRIPTION_2012="Microsoft Visual Studio 2012"
    1.86 +VS_VERSION_INTERNAL_2012=110
    1.87 +VS_MSVCR_2012=msvcr110.dll
    1.88 +VS_MSVCP_2012=msvcp110.dll
    1.89 +VS_ENVVAR_2012="VS110COMNTOOLS"
    1.90 +VS_VS_INSTALLDIR_2012="Microsoft Visual Studio 11.0"
    1.91 +VS_SDK_INSTALLDIR_2012=
    1.92 +VS_VS_PLATFORM_NAME_2012="v110"
    1.93 +VS_SDK_PLATFORM_NAME_2012=
    1.94 +
    1.95 +VS_DESCRIPTION_2013="Microsoft Visual Studio 2013"
    1.96 +VS_VERSION_INTERNAL_2013=120
    1.97 +VS_MSVCR_2013=msvcr120.dll
    1.98 +VS_MSVCP_2013=msvcp120.dll
    1.99 +VS_ENVVAR_2013="VS120COMNTOOLS"
   1.100 +VS_VS_INSTALLDIR_2013="Microsoft Visual Studio 12.0"
   1.101 +VS_SDK_INSTALLDIR_2013=
   1.102 +VS_VS_PLATFORM_NAME_2013="v120"
   1.103 +VS_SDK_PLATFORM_NAME_2013=
   1.104 +
   1.105 +################################################################################
   1.106 +
   1.107 +
   1.108 +
   1.109 +################################################################################
   1.110 +
   1.111 +
   1.112 +
   1.113 +################################################################################
   1.114 +# Finds the bat or cmd file in Visual Studio or the SDK that sets up a proper
   1.115 +# build environment and assigns it to VS_ENV_CMD
   1.116 +
   1.117 +
   1.118 +################################################################################
   1.119 +
   1.120 +
   1.121 +
   1.122 +################################################################################
   1.123  # Check if the VS env variables were setup prior to running configure.
   1.124  # If not, then find vcvarsall.bat and run it automatically, and integrate
   1.125  # the set env variables into the spec file.
   1.126 @@ -4236,13 +4292,16 @@
   1.127  
   1.128  
   1.129  
   1.130 +
   1.131 +
   1.132 +
   1.133  # This line needs to be here, verbatim, after all includes and the dummy hook
   1.134  # definitions. It is replaced with custom functionality when building
   1.135  # custom sources.
   1.136  #CUSTOM_AUTOCONF_INCLUDE
   1.137  
   1.138  # Do not change or remove the following line, it is needed for consistency checks:
   1.139 -DATE_WHEN_GENERATED=1525371284
   1.140 +DATE_WHEN_GENERATED=1526507291
   1.141  
   1.142  ###############################################################################
   1.143  #
   1.144 @@ -25217,41 +25276,177 @@
   1.145  
   1.146    # First-hand choice is to locate and run the vsvars bat file.
   1.147  
   1.148 -  if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
   1.149 -    VCVARSFILE="vc/bin/vcvars32.bat"
   1.150 -  else
   1.151 -    VCVARSFILE="vc/bin/amd64/vcvars64.bat"
   1.152 +
   1.153 +# Check whether --with-toolchain-version was given.
   1.154 +if test "${with_toolchain_version+set}" = set; then :
   1.155 +  withval=$with_toolchain_version;
   1.156 +fi
   1.157 +
   1.158 +
   1.159 +  if test "x$with_toolchain_version" = xlist; then
   1.160 +    # List all toolchains
   1.161 +    { $as_echo "$as_me:${as_lineno-$LINENO}: The following toolchain versions are valid on this platform:" >&5
   1.162 +$as_echo "$as_me: The following toolchain versions are valid on this platform:" >&6;}
   1.163 +    for version in $VALID_VS_VERSIONS; do
   1.164 +      eval VS_DESCRIPTION=\${VS_DESCRIPTION_$version}
   1.165 +      $PRINTF "  %-10s  %s\n" $version "$VS_DESCRIPTION"
   1.166 +    done
   1.167 +
   1.168 +    exit 0
   1.169 +  elif test "x$with_toolchain_version" != x; then
   1.170 +    # User override; check that it is valid
   1.171 +    if test "x${VALID_VS_VERSIONS/$with_toolchain_version/}" = "x${VALID_VS_VERSIONS}"; then
   1.172 +      { $as_echo "$as_me:${as_lineno-$LINENO}: Visual Studio version $with_toolchain_version is not valid." >&5
   1.173 +$as_echo "$as_me: Visual Studio version $with_toolchain_version is not valid." >&6;}
   1.174 +      { $as_echo "$as_me:${as_lineno-$LINENO}: Valid Visual Studio versions: $VALID_VS_VERSIONS." >&5
   1.175 +$as_echo "$as_me: Valid Visual Studio versions: $VALID_VS_VERSIONS." >&6;}
   1.176 +      as_fn_error $? "Cannot continue." "$LINENO" 5
   1.177 +    fi
   1.178 +    VS_VERSIONS_PROBE_LIST="$with_toolchain_version"
   1.179 +  else
   1.180 +    # No flag given, use default
   1.181 +    VS_VERSIONS_PROBE_LIST="$VALID_VS_VERSIONS"
   1.182 +  fi
   1.183 +
   1.184 +  for VS_VERSION in $VS_VERSIONS_PROBE_LIST; do
   1.185 +
   1.186 +  VS_VERSION="$VS_VERSION"
   1.187 +  eval VS_COMNTOOLS_VAR="\${VS_ENVVAR_${VS_VERSION}}"
   1.188 +  eval VS_COMNTOOLS="\$${VS_COMNTOOLS_VAR}"
   1.189 +  eval VS_INSTALL_DIR="\${VS_VS_INSTALLDIR_${VS_VERSION}}"
   1.190 +  eval SDK_INSTALL_DIR="\${VS_SDK_INSTALLDIR_${VS_VERSION}}"
   1.191 +
   1.192 +  # When using --with-tools-dir, assume it points to the correct and default
   1.193 +  # version of Visual Studio or that --with-toolchain-version was also set.
   1.194 +  if test "x$with_tools_dir" != x; then
   1.195 +
   1.196 +  if test "x$VS_ENV_CMD" = x; then
   1.197 +    VS_VERSION="${VS_VERSION}"
   1.198 +    VS_BASE="$with_tools_dir/../.."
   1.199 +    METHOD="--with-tools-dir"
   1.200 +
   1.201 +    if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
   1.202 +      VCVARSFILE="vc/bin/vcvars32.bat"
   1.203 +    else
   1.204 +      VCVARSFILE="vc/bin/amd64/vcvars64.bat"
   1.205 +    fi
   1.206 +
   1.207 +
   1.208 +  windows_path="$VS_BASE"
   1.209 +  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
   1.210 +    unix_path=`$CYGPATH -u "$windows_path"`
   1.211 +    VS_BASE="$unix_path"
   1.212 +  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
   1.213 +    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
   1.214 +    VS_BASE="$unix_path"
   1.215 +  fi
   1.216 +
   1.217 +    if test -d "$VS_BASE"; then
   1.218 +      if test -f "$VS_BASE/$VCVARSFILE"; then
   1.219 +        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
   1.220 +$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;}
   1.221 +        VS_ENV_CMD="$VS_BASE/$VCVARSFILE"
   1.222 +        # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
   1.223 +        # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013
   1.224 +        eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}"
   1.225 +      else
   1.226 +        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
   1.227 +$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;}
   1.228 +        { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5
   1.229 +$as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;}
   1.230 +      fi
   1.231 +    fi
   1.232 +  fi
   1.233 +
   1.234 +
   1.235 +  if test "x$VS_ENV_CMD" = x; then
   1.236 +    VS_VERSION="${VS_VERSION}"
   1.237 +    VS_BASE="$with_tools_dir/../../.."
   1.238 +    METHOD="--with-tools-dir"
   1.239 +
   1.240 +    if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
   1.241 +      VCVARSFILE="vc/bin/vcvars32.bat"
   1.242 +    else
   1.243 +      VCVARSFILE="vc/bin/amd64/vcvars64.bat"
   1.244 +    fi
   1.245 +
   1.246 +
   1.247 +  windows_path="$VS_BASE"
   1.248 +  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
   1.249 +    unix_path=`$CYGPATH -u "$windows_path"`
   1.250 +    VS_BASE="$unix_path"
   1.251 +  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
   1.252 +    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
   1.253 +    VS_BASE="$unix_path"
   1.254 +  fi
   1.255 +
   1.256 +    if test -d "$VS_BASE"; then
   1.257 +      if test -f "$VS_BASE/$VCVARSFILE"; then
   1.258 +        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
   1.259 +$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;}
   1.260 +        VS_ENV_CMD="$VS_BASE/$VCVARSFILE"
   1.261 +        # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
   1.262 +        # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013
   1.263 +        eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}"
   1.264 +      else
   1.265 +        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
   1.266 +$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;}
   1.267 +        { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5
   1.268 +$as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;}
   1.269 +      fi
   1.270 +    fi
   1.271 +  fi
   1.272 +
   1.273 +    if test "x$VS_ENV_CMD" = x; then
   1.274 +      # Having specified an argument which is incorrect will produce an instant failure;
   1.275 +      # we should not go on looking
   1.276 +      { $as_echo "$as_me:${as_lineno-$LINENO}: The path given by --with-tools-dir does not contain a valid" >&5
   1.277 +$as_echo "$as_me: The path given by --with-tools-dir does not contain a valid" >&6;}
   1.278 +      { $as_echo "$as_me:${as_lineno-$LINENO}: Visual Studio installation. Please point to the VC/bin or VC/bin/amd64" >&5
   1.279 +$as_echo "$as_me: Visual Studio installation. Please point to the VC/bin or VC/bin/amd64" >&6;}
   1.280 +      { $as_echo "$as_me:${as_lineno-$LINENO}: directory within the Visual Studio installation" >&5
   1.281 +$as_echo "$as_me: directory within the Visual Studio installation" >&6;}
   1.282 +      as_fn_error $? "Cannot locate a valid Visual Studio installation" "$LINENO" 5
   1.283 +    fi
   1.284    fi
   1.285  
   1.286    VS_ENV_CMD=""
   1.287    VS_ENV_ARGS=""
   1.288 -  if test "x$with_toolsdir" != x; then
   1.289 +
   1.290 +  if test "x$VS_COMNTOOLS" != x; then
   1.291  
   1.292    if test "x$VS_ENV_CMD" = x; then
   1.293 -    VS100BASE="$with_toolsdir/../.."
   1.294 -    METHOD="--with-tools-dir"
   1.295 -
   1.296 -  windows_path="$VS100BASE"
   1.297 -  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
   1.298 -    unix_path=`$CYGPATH -u "$windows_path"`
   1.299 -    VS100BASE="$unix_path"
   1.300 -  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
   1.301 -    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
   1.302 -    VS100BASE="$unix_path"
   1.303 -  fi
   1.304 -
   1.305 -    if test -d "$VS100BASE"; then
   1.306 -      if test -f "$VS100BASE/$VCVARSFILE"; then
   1.307 -        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
   1.308 -$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
   1.309 -        VS_ENV_CMD="$VS100BASE/$VCVARSFILE"
   1.310 +    VS_VERSION="${VS_VERSION}"
   1.311 +    VS_BASE="$VS_COMNTOOLS/../.."
   1.312 +    METHOD="$VS_COMNTOOLS_VAR variable"
   1.313 +
   1.314 +    if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
   1.315 +      VCVARSFILE="vc/bin/vcvars32.bat"
   1.316 +    else
   1.317 +      VCVARSFILE="vc/bin/amd64/vcvars64.bat"
   1.318 +    fi
   1.319 +
   1.320 +
   1.321 +  windows_path="$VS_BASE"
   1.322 +  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
   1.323 +    unix_path=`$CYGPATH -u "$windows_path"`
   1.324 +    VS_BASE="$unix_path"
   1.325 +  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
   1.326 +    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
   1.327 +    VS_BASE="$unix_path"
   1.328 +  fi
   1.329 +
   1.330 +    if test -d "$VS_BASE"; then
   1.331 +      if test -f "$VS_BASE/$VCVARSFILE"; then
   1.332 +        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
   1.333 +$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;}
   1.334 +        VS_ENV_CMD="$VS_BASE/$VCVARSFILE"
   1.335          # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
   1.336          # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013
   1.337 -        # TODO: improve detection for other versions of VS
   1.338 -        PLATFORM_TOOLSET="v100"
   1.339 -      else
   1.340 -        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
   1.341 -$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
   1.342 +        eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}"
   1.343 +      else
   1.344 +        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
   1.345 +$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;}
   1.346          { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5
   1.347  $as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;}
   1.348        fi
   1.349 @@ -25259,44 +25454,40 @@
   1.350    fi
   1.351  
   1.352    fi
   1.353 -
   1.354 -  if test "x$with_toolsdir" != x && test "x$VS_ENV_CMD" = x; then
   1.355 -    # Having specified an argument which is incorrect will produce an instant failure;
   1.356 -    # we should not go on looking
   1.357 -    { $as_echo "$as_me:${as_lineno-$LINENO}: The path given by --with-tools-dir does not contain a valid Visual Studio installation" >&5
   1.358 -$as_echo "$as_me: The path given by --with-tools-dir does not contain a valid Visual Studio installation" >&6;}
   1.359 -    { $as_echo "$as_me:${as_lineno-$LINENO}: Please point to the VC/bin directory within the Visual Studio installation" >&5
   1.360 -$as_echo "$as_me: Please point to the VC/bin directory within the Visual Studio installation" >&6;}
   1.361 -    as_fn_error $? "Cannot locate a valid Visual Studio installation" "$LINENO" 5
   1.362 -  fi
   1.363 -
   1.364 -  if test "x$VS100COMNTOOLS" != x; then
   1.365 +  if test "x$PROGRAMFILES" != x; then
   1.366  
   1.367    if test "x$VS_ENV_CMD" = x; then
   1.368 -    VS100BASE="$VS100COMNTOOLS/../.."
   1.369 -    METHOD="VS100COMNTOOLS variable"
   1.370 -
   1.371 -  windows_path="$VS100BASE"
   1.372 -  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
   1.373 -    unix_path=`$CYGPATH -u "$windows_path"`
   1.374 -    VS100BASE="$unix_path"
   1.375 -  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
   1.376 -    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
   1.377 -    VS100BASE="$unix_path"
   1.378 -  fi
   1.379 -
   1.380 -    if test -d "$VS100BASE"; then
   1.381 -      if test -f "$VS100BASE/$VCVARSFILE"; then
   1.382 -        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
   1.383 -$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
   1.384 -        VS_ENV_CMD="$VS100BASE/$VCVARSFILE"
   1.385 +    VS_VERSION="${VS_VERSION}"
   1.386 +    VS_BASE="$PROGRAMFILES/$VS_INSTALL_DIR"
   1.387 +    METHOD="well-known name"
   1.388 +
   1.389 +    if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
   1.390 +      VCVARSFILE="vc/bin/vcvars32.bat"
   1.391 +    else
   1.392 +      VCVARSFILE="vc/bin/amd64/vcvars64.bat"
   1.393 +    fi
   1.394 +
   1.395 +
   1.396 +  windows_path="$VS_BASE"
   1.397 +  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
   1.398 +    unix_path=`$CYGPATH -u "$windows_path"`
   1.399 +    VS_BASE="$unix_path"
   1.400 +  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
   1.401 +    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
   1.402 +    VS_BASE="$unix_path"
   1.403 +  fi
   1.404 +
   1.405 +    if test -d "$VS_BASE"; then
   1.406 +      if test -f "$VS_BASE/$VCVARSFILE"; then
   1.407 +        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
   1.408 +$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;}
   1.409 +        VS_ENV_CMD="$VS_BASE/$VCVARSFILE"
   1.410          # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
   1.411          # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013
   1.412 -        # TODO: improve detection for other versions of VS
   1.413 -        PLATFORM_TOOLSET="v100"
   1.414 -      else
   1.415 -        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
   1.416 -$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
   1.417 +        eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}"
   1.418 +      else
   1.419 +        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
   1.420 +$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;}
   1.421          { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5
   1.422  $as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;}
   1.423        fi
   1.424 @@ -25304,33 +25495,42 @@
   1.425    fi
   1.426  
   1.427    fi
   1.428 -  if test "x$PROGRAMFILES" != x; then
   1.429 +  # Work around the insanely named ProgramFiles(x86) env variable
   1.430 +  PROGRAMFILES_X86="`env | $SED -n 's/^ProgramFiles(x86)=//p'`"
   1.431 +  if test "x$PROGRAMFILES_X86" != x; then
   1.432  
   1.433    if test "x$VS_ENV_CMD" = x; then
   1.434 -    VS100BASE="$PROGRAMFILES/Microsoft Visual Studio 10.0"
   1.435 +    VS_VERSION="${VS_VERSION}"
   1.436 +    VS_BASE="$PROGRAMFILES_X86/$VS_INSTALL_DIR"
   1.437      METHOD="well-known name"
   1.438  
   1.439 -  windows_path="$VS100BASE"
   1.440 -  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
   1.441 -    unix_path=`$CYGPATH -u "$windows_path"`
   1.442 -    VS100BASE="$unix_path"
   1.443 -  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
   1.444 -    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
   1.445 -    VS100BASE="$unix_path"
   1.446 -  fi
   1.447 -
   1.448 -    if test -d "$VS100BASE"; then
   1.449 -      if test -f "$VS100BASE/$VCVARSFILE"; then
   1.450 -        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
   1.451 -$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
   1.452 -        VS_ENV_CMD="$VS100BASE/$VCVARSFILE"
   1.453 +    if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
   1.454 +      VCVARSFILE="vc/bin/vcvars32.bat"
   1.455 +    else
   1.456 +      VCVARSFILE="vc/bin/amd64/vcvars64.bat"
   1.457 +    fi
   1.458 +
   1.459 +
   1.460 +  windows_path="$VS_BASE"
   1.461 +  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
   1.462 +    unix_path=`$CYGPATH -u "$windows_path"`
   1.463 +    VS_BASE="$unix_path"
   1.464 +  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
   1.465 +    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
   1.466 +    VS_BASE="$unix_path"
   1.467 +  fi
   1.468 +
   1.469 +    if test -d "$VS_BASE"; then
   1.470 +      if test -f "$VS_BASE/$VCVARSFILE"; then
   1.471 +        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
   1.472 +$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;}
   1.473 +        VS_ENV_CMD="$VS_BASE/$VCVARSFILE"
   1.474          # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
   1.475          # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013
   1.476 -        # TODO: improve detection for other versions of VS
   1.477 -        PLATFORM_TOOLSET="v100"
   1.478 -      else
   1.479 -        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
   1.480 -$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
   1.481 +        eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}"
   1.482 +      else
   1.483 +        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
   1.484 +$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;}
   1.485          { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5
   1.486  $as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;}
   1.487        fi
   1.488 @@ -25340,30 +25540,37 @@
   1.489    fi
   1.490  
   1.491    if test "x$VS_ENV_CMD" = x; then
   1.492 -    VS100BASE="C:/Program Files/Microsoft Visual Studio 10.0"
   1.493 +    VS_VERSION="${VS_VERSION}"
   1.494 +    VS_BASE="C:/Program Files/$VS_INSTALL_DIR"
   1.495      METHOD="well-known name"
   1.496  
   1.497 -  windows_path="$VS100BASE"
   1.498 -  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
   1.499 -    unix_path=`$CYGPATH -u "$windows_path"`
   1.500 -    VS100BASE="$unix_path"
   1.501 -  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
   1.502 -    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
   1.503 -    VS100BASE="$unix_path"
   1.504 -  fi
   1.505 -
   1.506 -    if test -d "$VS100BASE"; then
   1.507 -      if test -f "$VS100BASE/$VCVARSFILE"; then
   1.508 -        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
   1.509 -$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
   1.510 -        VS_ENV_CMD="$VS100BASE/$VCVARSFILE"
   1.511 +    if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
   1.512 +      VCVARSFILE="vc/bin/vcvars32.bat"
   1.513 +    else
   1.514 +      VCVARSFILE="vc/bin/amd64/vcvars64.bat"
   1.515 +    fi
   1.516 +
   1.517 +
   1.518 +  windows_path="$VS_BASE"
   1.519 +  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
   1.520 +    unix_path=`$CYGPATH -u "$windows_path"`
   1.521 +    VS_BASE="$unix_path"
   1.522 +  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
   1.523 +    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
   1.524 +    VS_BASE="$unix_path"
   1.525 +  fi
   1.526 +
   1.527 +    if test -d "$VS_BASE"; then
   1.528 +      if test -f "$VS_BASE/$VCVARSFILE"; then
   1.529 +        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
   1.530 +$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;}
   1.531 +        VS_ENV_CMD="$VS_BASE/$VCVARSFILE"
   1.532          # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
   1.533          # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013
   1.534 -        # TODO: improve detection for other versions of VS
   1.535 -        PLATFORM_TOOLSET="v100"
   1.536 -      else
   1.537 -        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
   1.538 -$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
   1.539 +        eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}"
   1.540 +      else
   1.541 +        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
   1.542 +$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;}
   1.543          { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5
   1.544  $as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;}
   1.545        fi
   1.546 @@ -25372,30 +25579,37 @@
   1.547  
   1.548  
   1.549    if test "x$VS_ENV_CMD" = x; then
   1.550 -    VS100BASE="C:/Program Files (x86)/Microsoft Visual Studio 10.0"
   1.551 +    VS_VERSION="${VS_VERSION}"
   1.552 +    VS_BASE="C:/Program Files (x86)/$VS_INSTALL_DIR"
   1.553      METHOD="well-known name"
   1.554  
   1.555 -  windows_path="$VS100BASE"
   1.556 -  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
   1.557 -    unix_path=`$CYGPATH -u "$windows_path"`
   1.558 -    VS100BASE="$unix_path"
   1.559 -  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
   1.560 -    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
   1.561 -    VS100BASE="$unix_path"
   1.562 -  fi
   1.563 -
   1.564 -    if test -d "$VS100BASE"; then
   1.565 -      if test -f "$VS100BASE/$VCVARSFILE"; then
   1.566 -        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
   1.567 -$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
   1.568 -        VS_ENV_CMD="$VS100BASE/$VCVARSFILE"
   1.569 +    if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
   1.570 +      VCVARSFILE="vc/bin/vcvars32.bat"
   1.571 +    else
   1.572 +      VCVARSFILE="vc/bin/amd64/vcvars64.bat"
   1.573 +    fi
   1.574 +
   1.575 +
   1.576 +  windows_path="$VS_BASE"
   1.577 +  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
   1.578 +    unix_path=`$CYGPATH -u "$windows_path"`
   1.579 +    VS_BASE="$unix_path"
   1.580 +  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
   1.581 +    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
   1.582 +    VS_BASE="$unix_path"
   1.583 +  fi
   1.584 +
   1.585 +    if test -d "$VS_BASE"; then
   1.586 +      if test -f "$VS_BASE/$VCVARSFILE"; then
   1.587 +        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
   1.588 +$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;}
   1.589 +        VS_ENV_CMD="$VS_BASE/$VCVARSFILE"
   1.590          # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
   1.591          # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', 'v110' or 'v120' for VS 2010, 2012 or VS2013
   1.592 -        # TODO: improve detection for other versions of VS
   1.593 -        PLATFORM_TOOLSET="v100"
   1.594 -      else
   1.595 -        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
   1.596 -$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
   1.597 +        eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}"
   1.598 +      else
   1.599 +        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS_BASE using $METHOD" >&5
   1.600 +$as_echo "$as_me: Found Visual Studio installation at $VS_BASE using $METHOD" >&6;}
   1.601          { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5
   1.602  $as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;}
   1.603        fi
   1.604 @@ -25403,10 +25617,12 @@
   1.605    fi
   1.606  
   1.607  
   1.608 -  if test "x$ProgramW6432" != x; then
   1.609 +  if test "x$SDK_INSTALL_DIR" != x; then
   1.610 +    if test "x$ProgramW6432" != x; then
   1.611  
   1.612    if test "x$VS_ENV_CMD" = x; then
   1.613 -    WIN_SDK_BASE="$ProgramW6432/Microsoft SDKs/Windows/v7.1/Bin"
   1.614 +    VS_VERSION="${VS_VERSION}"
   1.615 +    WIN_SDK_BASE="$ProgramW6432/$SDK_INSTALL_DIR"
   1.616      METHOD="well-known name"
   1.617  
   1.618    windows_path="$WIN_SDK_BASE"
   1.619 @@ -25421,15 +25637,15 @@
   1.620      if test -d "$WIN_SDK_BASE"; then
   1.621        # There have been cases of partial or broken SDK installations. A missing
   1.622        # lib dir is not going to work.
   1.623 -      if test ! -d "$WIN_SDK_BASE/../lib"; then
   1.624 +      if test ! -d "$WIN_SDK_BASE/lib"; then
   1.625          { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
   1.626  $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;}
   1.627          { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: Installation is broken, lib dir is missing. Ignoring" >&5
   1.628  $as_echo "$as_me: Warning: Installation is broken, lib dir is missing. Ignoring" >&6;}
   1.629 -      elif test -f "$WIN_SDK_BASE/SetEnv.Cmd"; then
   1.630 +      elif test -f "$WIN_SDK_BASE/Bin/SetEnv.Cmd"; then
   1.631          { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
   1.632  $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;}
   1.633 -        VS_ENV_CMD="$WIN_SDK_BASE/SetEnv.Cmd"
   1.634 +        VS_ENV_CMD="$WIN_SDK_BASE/Bin/SetEnv.Cmd"
   1.635          if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
   1.636            VS_ENV_ARGS="/x86"
   1.637          else
   1.638 @@ -25438,7 +25654,7 @@
   1.639          # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
   1.640          # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be 'Windows7.1SDK' for Windows7.1SDK
   1.641          # TODO: improve detection for other versions of SDK
   1.642 -        PLATFORM_TOOLSET="Windows7.1SDK"
   1.643 +        eval PLATFORM_TOOLSET="\${VS_SDK_PLATFORM_NAME_${VS_VERSION}}"
   1.644        else
   1.645          { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
   1.646  $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;}
   1.647 @@ -25448,11 +25664,12 @@
   1.648      fi
   1.649    fi
   1.650  
   1.651 -  fi
   1.652 -  if test "x$PROGRAMW6432" != x; then
   1.653 +    fi
   1.654 +    if test "x$PROGRAMW6432" != x; then
   1.655  
   1.656    if test "x$VS_ENV_CMD" = x; then
   1.657 -    WIN_SDK_BASE="$PROGRAMW6432/Microsoft SDKs/Windows/v7.1/Bin"
   1.658 +    VS_VERSION="${VS_VERSION}"
   1.659 +    WIN_SDK_BASE="$PROGRAMW6432/$SDK_INSTALL_DIR"
   1.660      METHOD="well-known name"
   1.661  
   1.662    windows_path="$WIN_SDK_BASE"
   1.663 @@ -25467,15 +25684,15 @@
   1.664      if test -d "$WIN_SDK_BASE"; then
   1.665        # There have been cases of partial or broken SDK installations. A missing
   1.666        # lib dir is not going to work.
   1.667 -      if test ! -d "$WIN_SDK_BASE/../lib"; then
   1.668 +      if test ! -d "$WIN_SDK_BASE/lib"; then
   1.669          { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
   1.670  $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;}
   1.671          { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: Installation is broken, lib dir is missing. Ignoring" >&5
   1.672  $as_echo "$as_me: Warning: Installation is broken, lib dir is missing. Ignoring" >&6;}
   1.673 -      elif test -f "$WIN_SDK_BASE/SetEnv.Cmd"; then
   1.674 +      elif test -f "$WIN_SDK_BASE/Bin/SetEnv.Cmd"; then
   1.675          { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
   1.676  $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;}
   1.677 -        VS_ENV_CMD="$WIN_SDK_BASE/SetEnv.Cmd"
   1.678 +        VS_ENV_CMD="$WIN_SDK_BASE/Bin/SetEnv.Cmd"
   1.679          if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
   1.680            VS_ENV_ARGS="/x86"
   1.681          else
   1.682 @@ -25484,7 +25701,7 @@
   1.683          # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
   1.684          # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be 'Windows7.1SDK' for Windows7.1SDK
   1.685          # TODO: improve detection for other versions of SDK
   1.686 -        PLATFORM_TOOLSET="Windows7.1SDK"
   1.687 +        eval PLATFORM_TOOLSET="\${VS_SDK_PLATFORM_NAME_${VS_VERSION}}"
   1.688        else
   1.689          { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
   1.690  $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;}
   1.691 @@ -25494,11 +25711,12 @@
   1.692      fi
   1.693    fi
   1.694  
   1.695 -  fi
   1.696 -  if test "x$PROGRAMFILES" != x; then
   1.697 +    fi
   1.698 +    if test "x$PROGRAMFILES" != x; then
   1.699  
   1.700    if test "x$VS_ENV_CMD" = x; then
   1.701 -    WIN_SDK_BASE="$PROGRAMFILES/Microsoft SDKs/Windows/v7.1/Bin"
   1.702 +    VS_VERSION="${VS_VERSION}"
   1.703 +    WIN_SDK_BASE="$PROGRAMFILES/$SDK_INSTALL_DIR"
   1.704      METHOD="well-known name"
   1.705  
   1.706    windows_path="$WIN_SDK_BASE"
   1.707 @@ -25513,15 +25731,15 @@
   1.708      if test -d "$WIN_SDK_BASE"; then
   1.709        # There have been cases of partial or broken SDK installations. A missing
   1.710        # lib dir is not going to work.
   1.711 -      if test ! -d "$WIN_SDK_BASE/../lib"; then
   1.712 +      if test ! -d "$WIN_SDK_BASE/lib"; then
   1.713          { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
   1.714  $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;}
   1.715          { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: Installation is broken, lib dir is missing. Ignoring" >&5
   1.716  $as_echo "$as_me: Warning: Installation is broken, lib dir is missing. Ignoring" >&6;}
   1.717 -      elif test -f "$WIN_SDK_BASE/SetEnv.Cmd"; then
   1.718 +      elif test -f "$WIN_SDK_BASE/Bin/SetEnv.Cmd"; then
   1.719          { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
   1.720  $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;}
   1.721 -        VS_ENV_CMD="$WIN_SDK_BASE/SetEnv.Cmd"
   1.722 +        VS_ENV_CMD="$WIN_SDK_BASE/Bin/SetEnv.Cmd"
   1.723          if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
   1.724            VS_ENV_ARGS="/x86"
   1.725          else
   1.726 @@ -25530,7 +25748,7 @@
   1.727          # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
   1.728          # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be 'Windows7.1SDK' for Windows7.1SDK
   1.729          # TODO: improve detection for other versions of SDK
   1.730 -        PLATFORM_TOOLSET="Windows7.1SDK"
   1.731 +        eval PLATFORM_TOOLSET="\${VS_SDK_PLATFORM_NAME_${VS_VERSION}}"
   1.732        else
   1.733          { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
   1.734  $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;}
   1.735 @@ -25540,10 +25758,11 @@
   1.736      fi
   1.737    fi
   1.738  
   1.739 -  fi
   1.740 +    fi
   1.741  
   1.742    if test "x$VS_ENV_CMD" = x; then
   1.743 -    WIN_SDK_BASE="C:/Program Files/Microsoft SDKs/Windows/v7.1/Bin"
   1.744 +    VS_VERSION="${VS_VERSION}"
   1.745 +    WIN_SDK_BASE="C:/Program Files/$SDK_INSTALL_DIR"
   1.746      METHOD="well-known name"
   1.747  
   1.748    windows_path="$WIN_SDK_BASE"
   1.749 @@ -25558,15 +25777,15 @@
   1.750      if test -d "$WIN_SDK_BASE"; then
   1.751        # There have been cases of partial or broken SDK installations. A missing
   1.752        # lib dir is not going to work.
   1.753 -      if test ! -d "$WIN_SDK_BASE/../lib"; then
   1.754 +      if test ! -d "$WIN_SDK_BASE/lib"; then
   1.755          { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
   1.756  $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;}
   1.757          { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: Installation is broken, lib dir is missing. Ignoring" >&5
   1.758  $as_echo "$as_me: Warning: Installation is broken, lib dir is missing. Ignoring" >&6;}
   1.759 -      elif test -f "$WIN_SDK_BASE/SetEnv.Cmd"; then
   1.760 +      elif test -f "$WIN_SDK_BASE/Bin/SetEnv.Cmd"; then
   1.761          { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
   1.762  $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;}
   1.763 -        VS_ENV_CMD="$WIN_SDK_BASE/SetEnv.Cmd"
   1.764 +        VS_ENV_CMD="$WIN_SDK_BASE/Bin/SetEnv.Cmd"
   1.765          if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
   1.766            VS_ENV_ARGS="/x86"
   1.767          else
   1.768 @@ -25575,7 +25794,7 @@
   1.769          # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
   1.770          # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be 'Windows7.1SDK' for Windows7.1SDK
   1.771          # TODO: improve detection for other versions of SDK
   1.772 -        PLATFORM_TOOLSET="Windows7.1SDK"
   1.773 +        eval PLATFORM_TOOLSET="\${VS_SDK_PLATFORM_NAME_${VS_VERSION}}"
   1.774        else
   1.775          { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
   1.776  $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;}
   1.777 @@ -25587,7 +25806,8 @@
   1.778  
   1.779  
   1.780    if test "x$VS_ENV_CMD" = x; then
   1.781 -    WIN_SDK_BASE="C:/Program Files (x86)/Microsoft SDKs/Windows/v7.1/Bin"
   1.782 +    VS_VERSION="${VS_VERSION}"
   1.783 +    WIN_SDK_BASE="C:/Program Files (x86)/$SDK_INSTALL_DIR"
   1.784      METHOD="well-known name"
   1.785  
   1.786    windows_path="$WIN_SDK_BASE"
   1.787 @@ -25602,15 +25822,15 @@
   1.788      if test -d "$WIN_SDK_BASE"; then
   1.789        # There have been cases of partial or broken SDK installations. A missing
   1.790        # lib dir is not going to work.
   1.791 -      if test ! -d "$WIN_SDK_BASE/../lib"; then
   1.792 +      if test ! -d "$WIN_SDK_BASE/lib"; then
   1.793          { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
   1.794  $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;}
   1.795          { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: Installation is broken, lib dir is missing. Ignoring" >&5
   1.796  $as_echo "$as_me: Warning: Installation is broken, lib dir is missing. Ignoring" >&6;}
   1.797 -      elif test -f "$WIN_SDK_BASE/SetEnv.Cmd"; then
   1.798 +      elif test -f "$WIN_SDK_BASE/Bin/SetEnv.Cmd"; then
   1.799          { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
   1.800  $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;}
   1.801 -        VS_ENV_CMD="$WIN_SDK_BASE/SetEnv.Cmd"
   1.802 +        VS_ENV_CMD="$WIN_SDK_BASE/Bin/SetEnv.Cmd"
   1.803          if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
   1.804            VS_ENV_ARGS="/x86"
   1.805          else
   1.806 @@ -25619,7 +25839,7 @@
   1.807          # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see
   1.808          # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be 'Windows7.1SDK' for Windows7.1SDK
   1.809          # TODO: improve detection for other versions of SDK
   1.810 -        PLATFORM_TOOLSET="Windows7.1SDK"
   1.811 +        eval PLATFORM_TOOLSET="\${VS_SDK_PLATFORM_NAME_${VS_VERSION}}"
   1.812        else
   1.813          { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
   1.814  $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;}
   1.815 @@ -25629,6 +25849,21 @@
   1.816      fi
   1.817    fi
   1.818  
   1.819 +  fi
   1.820 +
   1.821 +    if test "x$VS_ENV_CMD" != x; then
   1.822 +      TOOLCHAIN_VERSION=$VS_VERSION
   1.823 +      eval VS_DESCRIPTION="\${VS_DESCRIPTION_${VS_VERSION}}"
   1.824 +      eval VS_VERSION_INTERNAL="\${VS_VERSION_INTERNAL_${VS_VERSION}}"
   1.825 +      eval MSVCR_NAME="\${VS_MSVCR_${VS_VERSION}}"
   1.826 +      eval MSVCP_NAME="\${VS_MSVCP_${VS_VERSION}}"
   1.827 +      # The rest of the variables are already evaled while probing
   1.828 +      { $as_echo "$as_me:${as_lineno-$LINENO}: Found $VS_DESCRIPTION" >&5
   1.829 +$as_echo "$as_me: Found $VS_DESCRIPTION" >&6;}
   1.830 +      break
   1.831 +    fi
   1.832 +  done
   1.833 +
   1.834  
   1.835    if test "x$VS_ENV_CMD" != x; then
   1.836      # We have found a Visual Studio environment on disk, let's extract variables from the vsvars bat file.
   1.837 @@ -39483,8 +39718,8 @@
   1.838      CC_VERSION_OUTPUT=`$CC 2>&1 | $HEAD -n 1 | $TR -d '\r'`
   1.839      COMPILER_CPU_TEST=`$ECHO $CC_VERSION_OUTPUT | $SED -n "s/^.* \(.*\)$/\1/p"`
   1.840      if test "x$OPENJDK_TARGET_CPU" = "xx86"; then
   1.841 -      if test "x$COMPILER_CPU_TEST" != "x80x86"; then
   1.842 -        as_fn_error $? "Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for \"$COMPILER_CPU_TEST\"; expected \"80x86\"." "$LINENO" 5
   1.843 +      if test "x$COMPILER_CPU_TEST" != "x80x86" -a "x$COMPILER_CPU_TEST" != "xx86"; then
   1.844 +        as_fn_error $? "Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for \"$COMPILER_CPU_TEST\"; expected \"80x86\" or \"x86\"." "$LINENO" 5
   1.845        fi
   1.846      elif test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then
   1.847        if test "x$COMPILER_CPU_TEST" != "xx64"; then
   1.848 @@ -41123,15 +41358,23 @@
   1.849      CFLAGS_JDK="$CFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC"
   1.850      CXXFLAGS_JDK="$CXXFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC"
   1.851    elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
   1.852 -    CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -Zi -MD -Zc:wchar_t- -W3 -wd4800 \
   1.853 -    -D_STATIC_CPPLIB -D_DISABLE_DEPRECATE_STATIC_CPPLIB -DWIN32_LEAN_AND_MEAN \
   1.854 -    -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \
   1.855 -    -DWIN32 -DIAL"
   1.856 +    CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK \
   1.857 +        -Zi -MD -Zc:wchar_t- -W3 -wd4800 \
   1.858 +        -DWIN32_LEAN_AND_MEAN \
   1.859 +        -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \
   1.860 +        -DWIN32 -DIAL"
   1.861      if test "x$OPENJDK_TARGET_CPU" = xx86_64; then
   1.862        CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_AMD64_ -Damd64"
   1.863      else
   1.864        CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_X86_ -Dx86"
   1.865      fi
   1.866 +    # If building with Visual Studio 2010, we can still use _STATIC_CPPLIB to
   1.867 +    # avoid bundling msvcpNNN.dll. Doesn't work with newer versions of visual
   1.868 +    # studio.
   1.869 +    if test "x$TOOLCHAIN_VERSION" = "x2010"; then
   1.870 +      CXXFLAGS_JDK="$CXXFLAGS_JDK \
   1.871 +          -D_STATIC_CPPLIB -D_DISABLE_DEPRECATE_STATIC_CPPLIB"
   1.872 +    fi
   1.873    fi
   1.874  
   1.875    ###############################################################################
   1.876 @@ -47772,16 +48015,17 @@
   1.877    if test "x$with_msvcr_dll" != x; then
   1.878      # If given explicitely by user, do not probe. If not present, fail directly.
   1.879  
   1.880 -  POSSIBLE_MSVCR_DLL="$with_msvcr_dll"
   1.881 +  DLL_NAME="$DLL_NAME"
   1.882 +  POSSIBLE_MSVC_DLL="$with_msvcr_dll"
   1.883    METHOD="--with-msvcr-dll"
   1.884 -  if test -e "$POSSIBLE_MSVCR_DLL"; then
   1.885 -    { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5
   1.886 -$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;}
   1.887 +  if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then
   1.888 +    { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5
   1.889 +$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;}
   1.890  
   1.891      # Need to check if the found msvcr is correct architecture
   1.892 -    { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5
   1.893 -$as_echo_n "checking found msvcr100.dll architecture... " >&6; }
   1.894 -    MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"`
   1.895 +    { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5
   1.896 +$as_echo_n "checking found $DLL_NAME architecture... " >&6; }
   1.897 +    MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"`
   1.898      if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
   1.899        # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit"
   1.900        # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems.
   1.901 @@ -47797,28 +48041,32 @@
   1.902          CORRECT_MSVCR_ARCH=x86-64
   1.903        fi
   1.904      fi
   1.905 -    if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then
   1.906 +    if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then
   1.907        { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
   1.908  $as_echo "ok" >&6; }
   1.909 -      MSVCR_DLL="$POSSIBLE_MSVCR_DLL"
   1.910 -      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5
   1.911 -$as_echo_n "checking for msvcr100.dll... " >&6; }
   1.912 -      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5
   1.913 -$as_echo "$MSVCR_DLL" >&6; }
   1.914 +      MSVC_DLL="$POSSIBLE_MSVC_DLL"
   1.915 +      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5
   1.916 +$as_echo_n "checking for $DLL_NAME... " >&6; }
   1.917 +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5
   1.918 +$as_echo "$MSVC_DLL" >&6; }
   1.919      else
   1.920        { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5
   1.921  $as_echo "incorrect, ignoring" >&6; }
   1.922 -      { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5
   1.923 -$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;}
   1.924 -    fi
   1.925 -  fi
   1.926 -
   1.927 -    if test "x$MSVCR_DLL" = x; then
   1.928 -      as_fn_error $? "Could not find a proper msvcr100.dll as specified by --with-msvcr-dll" "$LINENO" 5
   1.929 -    fi
   1.930 -  fi
   1.931 -
   1.932 -  if test "x$MSVCR_DLL" = x; then
   1.933 +      { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5
   1.934 +$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;}
   1.935 +    fi
   1.936 +  fi
   1.937 +
   1.938 +    if test "x$MSVC_DLL" = x; then
   1.939 +      as_fn_error $? "Could not find a proper $MSVCR_NAME as specified by --with-msvcr-dll" "$LINENO" 5
   1.940 +    fi
   1.941 +  else
   1.942 +
   1.943 +  VAR_NAME="MSVCR_DLL"
   1.944 +  DLL_NAME="${MSVCR_NAME}"
   1.945 +  MSVC_DLL=
   1.946 +
   1.947 +  if test "x$MSVC_DLL" = x; then
   1.948      # Probe: Using well-known location from Visual Studio 10.0
   1.949      if test "x$VCINSTALLDIR" != x; then
   1.950        CYGWIN_VC_INSTALL_DIR="$VCINSTALLDIR"
   1.951 @@ -47833,21 +48081,23 @@
   1.952    fi
   1.953  
   1.954        if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
   1.955 -        POSSIBLE_MSVCR_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x64/Microsoft.VC100.CRT/msvcr100.dll"
   1.956 -      else
   1.957 -        POSSIBLE_MSVCR_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x86/Microsoft.VC100.CRT/msvcr100.dll"
   1.958 -      fi
   1.959 -
   1.960 -  POSSIBLE_MSVCR_DLL="$POSSIBLE_MSVCR_DLL"
   1.961 +        POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x64/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME"
   1.962 +      else
   1.963 +        POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x86/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME"
   1.964 +      fi
   1.965 +      $ECHO "POSSIBLE_MSVC_DLL $POSSIBLEMSVC_DLL"
   1.966 +
   1.967 +  DLL_NAME="$DLL_NAME"
   1.968 +  POSSIBLE_MSVC_DLL="$POSSIBLE_MSVC_DLL"
   1.969    METHOD="well-known location in VCINSTALLDIR"
   1.970 -  if test -e "$POSSIBLE_MSVCR_DLL"; then
   1.971 -    { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5
   1.972 -$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;}
   1.973 +  if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then
   1.974 +    { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5
   1.975 +$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;}
   1.976  
   1.977      # Need to check if the found msvcr is correct architecture
   1.978 -    { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5
   1.979 -$as_echo_n "checking found msvcr100.dll architecture... " >&6; }
   1.980 -    MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"`
   1.981 +    { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5
   1.982 +$as_echo_n "checking found $DLL_NAME architecture... " >&6; }
   1.983 +    MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"`
   1.984      if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
   1.985        # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit"
   1.986        # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems.
   1.987 @@ -47863,39 +48113,40 @@
   1.988          CORRECT_MSVCR_ARCH=x86-64
   1.989        fi
   1.990      fi
   1.991 -    if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then
   1.992 +    if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then
   1.993        { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
   1.994  $as_echo "ok" >&6; }
   1.995 -      MSVCR_DLL="$POSSIBLE_MSVCR_DLL"
   1.996 -      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5
   1.997 -$as_echo_n "checking for msvcr100.dll... " >&6; }
   1.998 -      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5
   1.999 -$as_echo "$MSVCR_DLL" >&6; }
  1.1000 +      MSVC_DLL="$POSSIBLE_MSVC_DLL"
  1.1001 +      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5
  1.1002 +$as_echo_n "checking for $DLL_NAME... " >&6; }
  1.1003 +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5
  1.1004 +$as_echo "$MSVC_DLL" >&6; }
  1.1005      else
  1.1006        { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5
  1.1007  $as_echo "incorrect, ignoring" >&6; }
  1.1008 -      { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5
  1.1009 -$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;}
  1.1010 -    fi
  1.1011 -  fi
  1.1012 -
  1.1013 -    fi
  1.1014 -  fi
  1.1015 -
  1.1016 -  if test "x$MSVCR_DLL" = x; then
  1.1017 +      { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5
  1.1018 +$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;}
  1.1019 +    fi
  1.1020 +  fi
  1.1021 +
  1.1022 +    fi
  1.1023 +  fi
  1.1024 +
  1.1025 +  if test "x$MSVC_DLL" = x; then
  1.1026      # Probe: Check in the Boot JDK directory.
  1.1027 -    POSSIBLE_MSVCR_DLL="$BOOT_JDK/bin/msvcr100.dll"
  1.1028 -
  1.1029 -  POSSIBLE_MSVCR_DLL="$POSSIBLE_MSVCR_DLL"
  1.1030 +    POSSIBLE_MSVC_DLL="$BOOT_JDK/bin/$DLL_NAME"
  1.1031 +
  1.1032 +  DLL_NAME="$DLL_NAME"
  1.1033 +  POSSIBLE_MSVC_DLL="$POSSIBLE_MSVC_DLL"
  1.1034    METHOD="well-known location in Boot JDK"
  1.1035 -  if test -e "$POSSIBLE_MSVCR_DLL"; then
  1.1036 -    { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5
  1.1037 -$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;}
  1.1038 +  if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then
  1.1039 +    { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5
  1.1040 +$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;}
  1.1041  
  1.1042      # Need to check if the found msvcr is correct architecture
  1.1043 -    { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5
  1.1044 -$as_echo_n "checking found msvcr100.dll architecture... " >&6; }
  1.1045 -    MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"`
  1.1046 +    { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5
  1.1047 +$as_echo_n "checking found $DLL_NAME architecture... " >&6; }
  1.1048 +    MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"`
  1.1049      if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
  1.1050        # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit"
  1.1051        # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems.
  1.1052 @@ -47911,25 +48162,25 @@
  1.1053          CORRECT_MSVCR_ARCH=x86-64
  1.1054        fi
  1.1055      fi
  1.1056 -    if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then
  1.1057 +    if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then
  1.1058        { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
  1.1059  $as_echo "ok" >&6; }
  1.1060 -      MSVCR_DLL="$POSSIBLE_MSVCR_DLL"
  1.1061 -      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5
  1.1062 -$as_echo_n "checking for msvcr100.dll... " >&6; }
  1.1063 -      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5
  1.1064 -$as_echo "$MSVCR_DLL" >&6; }
  1.1065 +      MSVC_DLL="$POSSIBLE_MSVC_DLL"
  1.1066 +      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5
  1.1067 +$as_echo_n "checking for $DLL_NAME... " >&6; }
  1.1068 +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5
  1.1069 +$as_echo "$MSVC_DLL" >&6; }
  1.1070      else
  1.1071        { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5
  1.1072  $as_echo "incorrect, ignoring" >&6; }
  1.1073 -      { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5
  1.1074 -$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;}
  1.1075 -    fi
  1.1076 -  fi
  1.1077 -
  1.1078 -  fi
  1.1079 -
  1.1080 -  if test "x$MSVCR_DLL" = x; then
  1.1081 +      { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5
  1.1082 +$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;}
  1.1083 +    fi
  1.1084 +  fi
  1.1085 +
  1.1086 +  fi
  1.1087 +
  1.1088 +  if test "x$MSVC_DLL" = x; then
  1.1089      # Probe: Look in the Windows system32 directory
  1.1090      CYGWIN_SYSTEMROOT="$SYSTEMROOT"
  1.1091  
  1.1092 @@ -47942,18 +48193,19 @@
  1.1093      CYGWIN_SYSTEMROOT="$unix_path"
  1.1094    fi
  1.1095  
  1.1096 -    POSSIBLE_MSVCR_DLL="$CYGWIN_SYSTEMROOT/system32/msvcr100.dll"
  1.1097 -
  1.1098 -  POSSIBLE_MSVCR_DLL="$POSSIBLE_MSVCR_DLL"
  1.1099 +    POSSIBLE_MSVC_DLL="$CYGWIN_SYSTEMROOT/system32/$DLL_NAME"
  1.1100 +
  1.1101 +  DLL_NAME="$DLL_NAME"
  1.1102 +  POSSIBLE_MSVC_DLL="$POSSIBLE_MSVC_DLL"
  1.1103    METHOD="well-known location in SYSTEMROOT"
  1.1104 -  if test -e "$POSSIBLE_MSVCR_DLL"; then
  1.1105 -    { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5
  1.1106 -$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;}
  1.1107 +  if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then
  1.1108 +    { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5
  1.1109 +$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;}
  1.1110  
  1.1111      # Need to check if the found msvcr is correct architecture
  1.1112 -    { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5
  1.1113 -$as_echo_n "checking found msvcr100.dll architecture... " >&6; }
  1.1114 -    MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"`
  1.1115 +    { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5
  1.1116 +$as_echo_n "checking found $DLL_NAME architecture... " >&6; }
  1.1117 +    MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"`
  1.1118      if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
  1.1119        # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit"
  1.1120        # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems.
  1.1121 @@ -47969,25 +48221,25 @@
  1.1122          CORRECT_MSVCR_ARCH=x86-64
  1.1123        fi
  1.1124      fi
  1.1125 -    if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then
  1.1126 +    if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then
  1.1127        { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
  1.1128  $as_echo "ok" >&6; }
  1.1129 -      MSVCR_DLL="$POSSIBLE_MSVCR_DLL"
  1.1130 -      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5
  1.1131 -$as_echo_n "checking for msvcr100.dll... " >&6; }
  1.1132 -      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5
  1.1133 -$as_echo "$MSVCR_DLL" >&6; }
  1.1134 +      MSVC_DLL="$POSSIBLE_MSVC_DLL"
  1.1135 +      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5
  1.1136 +$as_echo_n "checking for $DLL_NAME... " >&6; }
  1.1137 +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5
  1.1138 +$as_echo "$MSVC_DLL" >&6; }
  1.1139      else
  1.1140        { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5
  1.1141  $as_echo "incorrect, ignoring" >&6; }
  1.1142 -      { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5
  1.1143 -$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;}
  1.1144 -    fi
  1.1145 -  fi
  1.1146 -
  1.1147 -  fi
  1.1148 -
  1.1149 -  if test "x$MSVCR_DLL" = x; then
  1.1150 +      { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5
  1.1151 +$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;}
  1.1152 +    fi
  1.1153 +  fi
  1.1154 +
  1.1155 +  fi
  1.1156 +
  1.1157 +  if test "x$MSVC_DLL" = x; then
  1.1158      # Probe: If Visual Studio Express is installed, there is usually one with the debugger
  1.1159      if test "x$VS100COMNTOOLS" != x; then
  1.1160        CYGWIN_VS_TOOLS_DIR="$VS100COMNTOOLS/.."
  1.1161 @@ -48002,21 +48254,24 @@
  1.1162    fi
  1.1163  
  1.1164        if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
  1.1165 -        POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name msvcr100.dll | $GREP -i /x64/ | $HEAD --lines 1`
  1.1166 -      else
  1.1167 -        POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name msvcr100.dll | $GREP -i /x86/ | $HEAD --lines 1`
  1.1168 -      fi
  1.1169 -
  1.1170 -  POSSIBLE_MSVCR_DLL="$POSSIBLE_MSVCR_DLL"
  1.1171 +        POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name $DLL_NAME \
  1.1172 +            | $GREP -i /x64/ | $HEAD --lines 1`
  1.1173 +      else
  1.1174 +        POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name $DLL_NAME \
  1.1175 +            | $GREP -i /x86/ | $HEAD --lines 1`
  1.1176 +      fi
  1.1177 +
  1.1178 +  DLL_NAME="$DLL_NAME"
  1.1179 +  POSSIBLE_MSVC_DLL="$POSSIBLE_MSVC_DLL"
  1.1180    METHOD="search of VS100COMNTOOLS"
  1.1181 -  if test -e "$POSSIBLE_MSVCR_DLL"; then
  1.1182 -    { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5
  1.1183 -$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;}
  1.1184 +  if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then
  1.1185 +    { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5
  1.1186 +$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;}
  1.1187  
  1.1188      # Need to check if the found msvcr is correct architecture
  1.1189 -    { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5
  1.1190 -$as_echo_n "checking found msvcr100.dll architecture... " >&6; }
  1.1191 -    MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"`
  1.1192 +    { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5
  1.1193 +$as_echo_n "checking found $DLL_NAME architecture... " >&6; }
  1.1194 +    MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"`
  1.1195      if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
  1.1196        # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit"
  1.1197        # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems.
  1.1198 @@ -48032,50 +48287,54 @@
  1.1199          CORRECT_MSVCR_ARCH=x86-64
  1.1200        fi
  1.1201      fi
  1.1202 -    if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then
  1.1203 +    if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then
  1.1204        { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
  1.1205  $as_echo "ok" >&6; }
  1.1206 -      MSVCR_DLL="$POSSIBLE_MSVCR_DLL"
  1.1207 -      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5
  1.1208 -$as_echo_n "checking for msvcr100.dll... " >&6; }
  1.1209 -      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5
  1.1210 -$as_echo "$MSVCR_DLL" >&6; }
  1.1211 +      MSVC_DLL="$POSSIBLE_MSVC_DLL"
  1.1212 +      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5
  1.1213 +$as_echo_n "checking for $DLL_NAME... " >&6; }
  1.1214 +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5
  1.1215 +$as_echo "$MSVC_DLL" >&6; }
  1.1216      else
  1.1217        { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5
  1.1218  $as_echo "incorrect, ignoring" >&6; }
  1.1219 -      { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5
  1.1220 -$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;}
  1.1221 -    fi
  1.1222 -  fi
  1.1223 -
  1.1224 -    fi
  1.1225 -  fi
  1.1226 -
  1.1227 -  if test "x$MSVCR_DLL" = x; then
  1.1228 +      { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5
  1.1229 +$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;}
  1.1230 +    fi
  1.1231 +  fi
  1.1232 +
  1.1233 +    fi
  1.1234 +  fi
  1.1235 +
  1.1236 +  if test "x$MSVC_DLL" = x; then
  1.1237      # Probe: Search wildly in the VCINSTALLDIR. We've probably lost by now.
  1.1238 -    # (This was the original behaviour; kept since it might turn up something)
  1.1239 +    # (This was the original behaviour; kept since it might turn something up)
  1.1240      if test "x$CYGWIN_VC_INSTALL_DIR" != x; then
  1.1241        if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
  1.1242 -        POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $GREP x64 | $HEAD --lines 1`
  1.1243 -      else
  1.1244 -        POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $GREP x86 | $GREP -v ia64 | $GREP -v x64 | $HEAD --lines 1`
  1.1245 -        if test "x$POSSIBLE_MSVCR_DLL" = x; then
  1.1246 +        POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name $DLL_NAME \
  1.1247 +          | $GREP x64 | $HEAD --lines 1`
  1.1248 +      else
  1.1249 +        POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name $DLL_NAME \
  1.1250 +          | $GREP x86 | $GREP -v ia64 | $GREP -v x64 | $HEAD --lines 1`
  1.1251 +        if test "x$POSSIBLE_MSVC_DLL" = x; then
  1.1252            # We're grasping at straws now...
  1.1253 -          POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $HEAD --lines 1`
  1.1254 -        fi
  1.1255 -      fi
  1.1256 -
  1.1257 -
  1.1258 -  POSSIBLE_MSVCR_DLL="$POSSIBLE_MSVCR_DLL"
  1.1259 +          POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name $DLL_NAME \
  1.1260 +              | $HEAD --lines 1`
  1.1261 +        fi
  1.1262 +      fi
  1.1263 +
  1.1264 +
  1.1265 +  DLL_NAME="$DLL_NAME"
  1.1266 +  POSSIBLE_MSVC_DLL="$POSSIBLE_MSVC_DLL"
  1.1267    METHOD="search of VCINSTALLDIR"
  1.1268 -  if test -e "$POSSIBLE_MSVCR_DLL"; then
  1.1269 -    { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5
  1.1270 -$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;}
  1.1271 +  if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then
  1.1272 +    { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5
  1.1273 +$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;}
  1.1274  
  1.1275      # Need to check if the found msvcr is correct architecture
  1.1276 -    { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5
  1.1277 -$as_echo_n "checking found msvcr100.dll architecture... " >&6; }
  1.1278 -    MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"`
  1.1279 +    { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5
  1.1280 +$as_echo_n "checking found $DLL_NAME architecture... " >&6; }
  1.1281 +    MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"`
  1.1282      if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
  1.1283        # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit"
  1.1284        # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems.
  1.1285 @@ -48091,33 +48350,34 @@
  1.1286          CORRECT_MSVCR_ARCH=x86-64
  1.1287        fi
  1.1288      fi
  1.1289 -    if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then
  1.1290 +    if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then
  1.1291        { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
  1.1292  $as_echo "ok" >&6; }
  1.1293 -      MSVCR_DLL="$POSSIBLE_MSVCR_DLL"
  1.1294 -      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5
  1.1295 -$as_echo_n "checking for msvcr100.dll... " >&6; }
  1.1296 -      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5
  1.1297 -$as_echo "$MSVCR_DLL" >&6; }
  1.1298 +      MSVC_DLL="$POSSIBLE_MSVC_DLL"
  1.1299 +      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5
  1.1300 +$as_echo_n "checking for $DLL_NAME... " >&6; }
  1.1301 +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5
  1.1302 +$as_echo "$MSVC_DLL" >&6; }
  1.1303      else
  1.1304        { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5
  1.1305  $as_echo "incorrect, ignoring" >&6; }
  1.1306 -      { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5
  1.1307 -$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;}
  1.1308 -    fi
  1.1309 -  fi
  1.1310 -
  1.1311 -    fi
  1.1312 -  fi
  1.1313 -
  1.1314 -  if test "x$MSVCR_DLL" = x; then
  1.1315 -    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5
  1.1316 -$as_echo_n "checking for msvcr100.dll... " >&6; }
  1.1317 +      { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5
  1.1318 +$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;}
  1.1319 +    fi
  1.1320 +  fi
  1.1321 +
  1.1322 +    fi
  1.1323 +  fi
  1.1324 +
  1.1325 +  if test "x$MSVC_DLL" = x; then
  1.1326 +    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5
  1.1327 +$as_echo_n "checking for $DLL_NAME... " >&6; }
  1.1328      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
  1.1329  $as_echo "no" >&6; }
  1.1330 -    as_fn_error $? "Could not find msvcr100.dll. Please specify using --with-msvcr-dll." "$LINENO" 5
  1.1331 -  fi
  1.1332 -
  1.1333 +    as_fn_error $? "Could not find $DLL_NAME. Please specify using --with-msvcr-dll." "$LINENO" 5
  1.1334 +  fi
  1.1335 +
  1.1336 +  MSVCR_DLL=$MSVC_DLL
  1.1337  
  1.1338    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
  1.1339  
  1.1340 @@ -48240,6 +48500,512 @@
  1.1341      MSVCR_DLL="`cd "$path"; $THEPWDCMD -L`"
  1.1342    fi
  1.1343  
  1.1344 +  MSVCR_DLL=$MSVCR_DLL
  1.1345 +
  1.1346 +
  1.1347 +  fi
  1.1348 +
  1.1349 +
  1.1350 +# Check whether --with-msvcp-dll was given.
  1.1351 +if test "${with_msvcp_dll+set}" = set; then :
  1.1352 +  withval=$with_msvcp_dll;
  1.1353 +fi
  1.1354 +
  1.1355 +
  1.1356 +  if test "x$MSVCP_NAME" != "x"; then
  1.1357 +    if test "x$with_msvcp_dll" != x; then
  1.1358 +      # If given explicitely by user, do not probe. If not present, fail directly.
  1.1359 +
  1.1360 +  DLL_NAME="$DLL_NAME"
  1.1361 +  POSSIBLE_MSVC_DLL="$with_msvcp_dll"
  1.1362 +  METHOD="--with-msvcp-dll"
  1.1363 +  if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then
  1.1364 +    { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5
  1.1365 +$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;}
  1.1366 +
  1.1367 +    # Need to check if the found msvcr is correct architecture
  1.1368 +    { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5
  1.1369 +$as_echo_n "checking found $DLL_NAME architecture... " >&6; }
  1.1370 +    MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"`
  1.1371 +    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
  1.1372 +      # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit"
  1.1373 +      # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems.
  1.1374 +      if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
  1.1375 +        CORRECT_MSVCR_ARCH="PE32 executable"
  1.1376 +      else
  1.1377 +        CORRECT_MSVCR_ARCH="PE32+ executable"
  1.1378 +      fi
  1.1379 +    else
  1.1380 +      if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
  1.1381 +        CORRECT_MSVCR_ARCH=386
  1.1382 +      else
  1.1383 +        CORRECT_MSVCR_ARCH=x86-64
  1.1384 +      fi
  1.1385 +    fi
  1.1386 +    if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then
  1.1387 +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
  1.1388 +$as_echo "ok" >&6; }
  1.1389 +      MSVC_DLL="$POSSIBLE_MSVC_DLL"
  1.1390 +      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5
  1.1391 +$as_echo_n "checking for $DLL_NAME... " >&6; }
  1.1392 +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5
  1.1393 +$as_echo "$MSVC_DLL" >&6; }
  1.1394 +    else
  1.1395 +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5
  1.1396 +$as_echo "incorrect, ignoring" >&6; }
  1.1397 +      { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5
  1.1398 +$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;}
  1.1399 +    fi
  1.1400 +  fi
  1.1401 +
  1.1402 +      if test "x$MSVC_DLL" = x; then
  1.1403 +        as_fn_error $? "Could not find a proper $MSVCP_NAME as specified by --with-msvcp-dll" "$LINENO" 5
  1.1404 +      fi
  1.1405 +    else
  1.1406 +
  1.1407 +  VAR_NAME="MSVCP_DLL"
  1.1408 +  DLL_NAME="${MSVCP_NAME}"
  1.1409 +  MSVC_DLL=
  1.1410 +
  1.1411 +  if test "x$MSVC_DLL" = x; then
  1.1412 +    # Probe: Using well-known location from Visual Studio 10.0
  1.1413 +    if test "x$VCINSTALLDIR" != x; then
  1.1414 +      CYGWIN_VC_INSTALL_DIR="$VCINSTALLDIR"
  1.1415 +
  1.1416 +  windows_path="$CYGWIN_VC_INSTALL_DIR"
  1.1417 +  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
  1.1418 +    unix_path=`$CYGPATH -u "$windows_path"`
  1.1419 +    CYGWIN_VC_INSTALL_DIR="$unix_path"
  1.1420 +  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
  1.1421 +    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
  1.1422 +    CYGWIN_VC_INSTALL_DIR="$unix_path"
  1.1423 +  fi
  1.1424 +
  1.1425 +      if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
  1.1426 +        POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x64/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME"
  1.1427 +      else
  1.1428 +        POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x86/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME"
  1.1429 +      fi
  1.1430 +      $ECHO "POSSIBLE_MSVC_DLL $POSSIBLEMSVC_DLL"
  1.1431 +
  1.1432 +  DLL_NAME="$DLL_NAME"
  1.1433 +  POSSIBLE_MSVC_DLL="$POSSIBLE_MSVC_DLL"
  1.1434 +  METHOD="well-known location in VCINSTALLDIR"
  1.1435 +  if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then
  1.1436 +    { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5
  1.1437 +$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;}
  1.1438 +
  1.1439 +    # Need to check if the found msvcr is correct architecture
  1.1440 +    { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5
  1.1441 +$as_echo_n "checking found $DLL_NAME architecture... " >&6; }
  1.1442 +    MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"`
  1.1443 +    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
  1.1444 +      # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit"
  1.1445 +      # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems.
  1.1446 +      if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
  1.1447 +        CORRECT_MSVCR_ARCH="PE32 executable"
  1.1448 +      else
  1.1449 +        CORRECT_MSVCR_ARCH="PE32+ executable"
  1.1450 +      fi
  1.1451 +    else
  1.1452 +      if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
  1.1453 +        CORRECT_MSVCR_ARCH=386
  1.1454 +      else
  1.1455 +        CORRECT_MSVCR_ARCH=x86-64
  1.1456 +      fi
  1.1457 +    fi
  1.1458 +    if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then
  1.1459 +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
  1.1460 +$as_echo "ok" >&6; }
  1.1461 +      MSVC_DLL="$POSSIBLE_MSVC_DLL"
  1.1462 +      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5
  1.1463 +$as_echo_n "checking for $DLL_NAME... " >&6; }
  1.1464 +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5
  1.1465 +$as_echo "$MSVC_DLL" >&6; }
  1.1466 +    else
  1.1467 +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5
  1.1468 +$as_echo "incorrect, ignoring" >&6; }
  1.1469 +      { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5
  1.1470 +$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;}
  1.1471 +    fi
  1.1472 +  fi
  1.1473 +
  1.1474 +    fi
  1.1475 +  fi
  1.1476 +
  1.1477 +  if test "x$MSVC_DLL" = x; then
  1.1478 +    # Probe: Check in the Boot JDK directory.
  1.1479 +    POSSIBLE_MSVC_DLL="$BOOT_JDK/bin/$DLL_NAME"
  1.1480 +
  1.1481 +  DLL_NAME="$DLL_NAME"
  1.1482 +  POSSIBLE_MSVC_DLL="$POSSIBLE_MSVC_DLL"
  1.1483 +  METHOD="well-known location in Boot JDK"
  1.1484 +  if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then
  1.1485 +    { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5
  1.1486 +$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;}
  1.1487 +
  1.1488 +    # Need to check if the found msvcr is correct architecture
  1.1489 +    { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5
  1.1490 +$as_echo_n "checking found $DLL_NAME architecture... " >&6; }
  1.1491 +    MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"`
  1.1492 +    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
  1.1493 +      # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit"
  1.1494 +      # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems.
  1.1495 +      if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
  1.1496 +        CORRECT_MSVCR_ARCH="PE32 executable"
  1.1497 +      else
  1.1498 +        CORRECT_MSVCR_ARCH="PE32+ executable"
  1.1499 +      fi
  1.1500 +    else
  1.1501 +      if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
  1.1502 +        CORRECT_MSVCR_ARCH=386
  1.1503 +      else
  1.1504 +        CORRECT_MSVCR_ARCH=x86-64
  1.1505 +      fi
  1.1506 +    fi
  1.1507 +    if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then
  1.1508 +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
  1.1509 +$as_echo "ok" >&6; }
  1.1510 +      MSVC_DLL="$POSSIBLE_MSVC_DLL"
  1.1511 +      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5
  1.1512 +$as_echo_n "checking for $DLL_NAME... " >&6; }
  1.1513 +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5
  1.1514 +$as_echo "$MSVC_DLL" >&6; }
  1.1515 +    else
  1.1516 +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5
  1.1517 +$as_echo "incorrect, ignoring" >&6; }
  1.1518 +      { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5
  1.1519 +$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;}
  1.1520 +    fi
  1.1521 +  fi
  1.1522 +
  1.1523 +  fi
  1.1524 +
  1.1525 +  if test "x$MSVC_DLL" = x; then
  1.1526 +    # Probe: Look in the Windows system32 directory
  1.1527 +    CYGWIN_SYSTEMROOT="$SYSTEMROOT"
  1.1528 +
  1.1529 +  windows_path="$CYGWIN_SYSTEMROOT"
  1.1530 +  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
  1.1531 +    unix_path=`$CYGPATH -u "$windows_path"`
  1.1532 +    CYGWIN_SYSTEMROOT="$unix_path"
  1.1533 +  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
  1.1534 +    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
  1.1535 +    CYGWIN_SYSTEMROOT="$unix_path"
  1.1536 +  fi
  1.1537 +
  1.1538 +    POSSIBLE_MSVC_DLL="$CYGWIN_SYSTEMROOT/system32/$DLL_NAME"
  1.1539 +
  1.1540 +  DLL_NAME="$DLL_NAME"
  1.1541 +  POSSIBLE_MSVC_DLL="$POSSIBLE_MSVC_DLL"
  1.1542 +  METHOD="well-known location in SYSTEMROOT"
  1.1543 +  if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then
  1.1544 +    { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5
  1.1545 +$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;}
  1.1546 +
  1.1547 +    # Need to check if the found msvcr is correct architecture
  1.1548 +    { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5
  1.1549 +$as_echo_n "checking found $DLL_NAME architecture... " >&6; }
  1.1550 +    MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"`
  1.1551 +    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
  1.1552 +      # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit"
  1.1553 +      # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems.
  1.1554 +      if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
  1.1555 +        CORRECT_MSVCR_ARCH="PE32 executable"
  1.1556 +      else
  1.1557 +        CORRECT_MSVCR_ARCH="PE32+ executable"
  1.1558 +      fi
  1.1559 +    else
  1.1560 +      if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
  1.1561 +        CORRECT_MSVCR_ARCH=386
  1.1562 +      else
  1.1563 +        CORRECT_MSVCR_ARCH=x86-64
  1.1564 +      fi
  1.1565 +    fi
  1.1566 +    if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then
  1.1567 +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
  1.1568 +$as_echo "ok" >&6; }
  1.1569 +      MSVC_DLL="$POSSIBLE_MSVC_DLL"
  1.1570 +      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5
  1.1571 +$as_echo_n "checking for $DLL_NAME... " >&6; }
  1.1572 +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5
  1.1573 +$as_echo "$MSVC_DLL" >&6; }
  1.1574 +    else
  1.1575 +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5
  1.1576 +$as_echo "incorrect, ignoring" >&6; }
  1.1577 +      { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5
  1.1578 +$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;}
  1.1579 +    fi
  1.1580 +  fi
  1.1581 +
  1.1582 +  fi
  1.1583 +
  1.1584 +  if test "x$MSVC_DLL" = x; then
  1.1585 +    # Probe: If Visual Studio Express is installed, there is usually one with the debugger
  1.1586 +    if test "x$VS100COMNTOOLS" != x; then
  1.1587 +      CYGWIN_VS_TOOLS_DIR="$VS100COMNTOOLS/.."
  1.1588 +
  1.1589 +  windows_path="$CYGWIN_VS_TOOLS_DIR"
  1.1590 +  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
  1.1591 +    unix_path=`$CYGPATH -u "$windows_path"`
  1.1592 +    CYGWIN_VS_TOOLS_DIR="$unix_path"
  1.1593 +  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
  1.1594 +    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
  1.1595 +    CYGWIN_VS_TOOLS_DIR="$unix_path"
  1.1596 +  fi
  1.1597 +
  1.1598 +      if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
  1.1599 +        POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name $DLL_NAME \
  1.1600 +            | $GREP -i /x64/ | $HEAD --lines 1`
  1.1601 +      else
  1.1602 +        POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name $DLL_NAME \
  1.1603 +            | $GREP -i /x86/ | $HEAD --lines 1`
  1.1604 +      fi
  1.1605 +
  1.1606 +  DLL_NAME="$DLL_NAME"
  1.1607 +  POSSIBLE_MSVC_DLL="$POSSIBLE_MSVC_DLL"
  1.1608 +  METHOD="search of VS100COMNTOOLS"
  1.1609 +  if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then
  1.1610 +    { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5
  1.1611 +$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;}
  1.1612 +
  1.1613 +    # Need to check if the found msvcr is correct architecture
  1.1614 +    { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5
  1.1615 +$as_echo_n "checking found $DLL_NAME architecture... " >&6; }
  1.1616 +    MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"`
  1.1617 +    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
  1.1618 +      # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit"
  1.1619 +      # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems.
  1.1620 +      if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
  1.1621 +        CORRECT_MSVCR_ARCH="PE32 executable"
  1.1622 +      else
  1.1623 +        CORRECT_MSVCR_ARCH="PE32+ executable"
  1.1624 +      fi
  1.1625 +    else
  1.1626 +      if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
  1.1627 +        CORRECT_MSVCR_ARCH=386
  1.1628 +      else
  1.1629 +        CORRECT_MSVCR_ARCH=x86-64
  1.1630 +      fi
  1.1631 +    fi
  1.1632 +    if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then
  1.1633 +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
  1.1634 +$as_echo "ok" >&6; }
  1.1635 +      MSVC_DLL="$POSSIBLE_MSVC_DLL"
  1.1636 +      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5
  1.1637 +$as_echo_n "checking for $DLL_NAME... " >&6; }
  1.1638 +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5
  1.1639 +$as_echo "$MSVC_DLL" >&6; }
  1.1640 +    else
  1.1641 +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5
  1.1642 +$as_echo "incorrect, ignoring" >&6; }
  1.1643 +      { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5
  1.1644 +$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;}
  1.1645 +    fi
  1.1646 +  fi
  1.1647 +
  1.1648 +    fi
  1.1649 +  fi
  1.1650 +
  1.1651 +  if test "x$MSVC_DLL" = x; then
  1.1652 +    # Probe: Search wildly in the VCINSTALLDIR. We've probably lost by now.
  1.1653 +    # (This was the original behaviour; kept since it might turn something up)
  1.1654 +    if test "x$CYGWIN_VC_INSTALL_DIR" != x; then
  1.1655 +      if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
  1.1656 +        POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name $DLL_NAME \
  1.1657 +          | $GREP x64 | $HEAD --lines 1`
  1.1658 +      else
  1.1659 +        POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name $DLL_NAME \
  1.1660 +          | $GREP x86 | $GREP -v ia64 | $GREP -v x64 | $HEAD --lines 1`
  1.1661 +        if test "x$POSSIBLE_MSVC_DLL" = x; then
  1.1662 +          # We're grasping at straws now...
  1.1663 +          POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name $DLL_NAME \
  1.1664 +              | $HEAD --lines 1`
  1.1665 +        fi
  1.1666 +      fi
  1.1667 +
  1.1668 +
  1.1669 +  DLL_NAME="$DLL_NAME"
  1.1670 +  POSSIBLE_MSVC_DLL="$POSSIBLE_MSVC_DLL"
  1.1671 +  METHOD="search of VCINSTALLDIR"
  1.1672 +  if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then
  1.1673 +    { $as_echo "$as_me:${as_lineno-$LINENO}: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&5
  1.1674 +$as_echo "$as_me: Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD" >&6;}
  1.1675 +
  1.1676 +    # Need to check if the found msvcr is correct architecture
  1.1677 +    { $as_echo "$as_me:${as_lineno-$LINENO}: checking found $DLL_NAME architecture" >&5
  1.1678 +$as_echo_n "checking found $DLL_NAME architecture... " >&6; }
  1.1679 +    MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"`
  1.1680 +    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
  1.1681 +      # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit"
  1.1682 +      # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems.
  1.1683 +      if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
  1.1684 +        CORRECT_MSVCR_ARCH="PE32 executable"
  1.1685 +      else
  1.1686 +        CORRECT_MSVCR_ARCH="PE32+ executable"
  1.1687 +      fi
  1.1688 +    else
  1.1689 +      if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
  1.1690 +        CORRECT_MSVCR_ARCH=386
  1.1691 +      else
  1.1692 +        CORRECT_MSVCR_ARCH=x86-64
  1.1693 +      fi
  1.1694 +    fi
  1.1695 +    if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then
  1.1696 +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
  1.1697 +$as_echo "ok" >&6; }
  1.1698 +      MSVC_DLL="$POSSIBLE_MSVC_DLL"
  1.1699 +      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5
  1.1700 +$as_echo_n "checking for $DLL_NAME... " >&6; }
  1.1701 +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVC_DLL" >&5
  1.1702 +$as_echo "$MSVC_DLL" >&6; }
  1.1703 +    else
  1.1704 +      { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5
  1.1705 +$as_echo "incorrect, ignoring" >&6; }
  1.1706 +      { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&5
  1.1707 +$as_echo "$as_me: The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE" >&6;}
  1.1708 +    fi
  1.1709 +  fi
  1.1710 +
  1.1711 +    fi
  1.1712 +  fi
  1.1713 +
  1.1714 +  if test "x$MSVC_DLL" = x; then
  1.1715 +    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $DLL_NAME" >&5
  1.1716 +$as_echo_n "checking for $DLL_NAME... " >&6; }
  1.1717 +    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
  1.1718 +$as_echo "no" >&6; }
  1.1719 +    as_fn_error $? "Could not find $DLL_NAME. Please specify using --with-msvcr-dll." "$LINENO" 5
  1.1720 +  fi
  1.1721 +
  1.1722 +  MSVCP_DLL=$MSVC_DLL
  1.1723 +
  1.1724 +  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
  1.1725 +
  1.1726 +  # Input might be given as Windows format, start by converting to
  1.1727 +  # unix format.
  1.1728 +  path="$MSVCP_DLL"
  1.1729 +  new_path=`$CYGPATH -u "$path"`
  1.1730 +
  1.1731 +  # Cygwin tries to hide some aspects of the Windows file system, such that binaries are
  1.1732 +  # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered
  1.1733 +  # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then
  1.1734 +  # "foo.exe" is OK but "foo" is an error.
  1.1735 +  #
  1.1736 +  # This test is therefore slightly more accurate than "test -f" to check for file precense.
  1.1737 +  # It is also a way to make sure we got the proper file name for the real test later on.
  1.1738 +  test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null`
  1.1739 +  if test "x$test_shortpath" = x; then
  1.1740 +    { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVCP_DLL, which resolves as \"$path\", is invalid." >&5
  1.1741 +$as_echo "$as_me: The path of MSVCP_DLL, which resolves as \"$path\", is invalid." >&6;}
  1.1742 +    as_fn_error $? "Cannot locate the the path of MSVCP_DLL" "$LINENO" 5
  1.1743 +  fi
  1.1744 +
  1.1745 +  # Call helper function which possibly converts this using DOS-style short mode.
  1.1746 +  # If so, the updated path is stored in $new_path.
  1.1747 +
  1.1748 +  input_path="$new_path"
  1.1749 +  # Check if we need to convert this using DOS-style short mode. If the path
  1.1750 +  # contains just simple characters, use it. Otherwise (spaces, weird characters),
  1.1751 +  # take no chances and rewrite it.
  1.1752 +  # Note: m4 eats our [], so we need to use [ and ] instead.
  1.1753 +  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]`
  1.1754 +  if test "x$has_forbidden_chars" != x; then
  1.1755 +    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
  1.1756 +    shortmode_path=`$CYGPATH -s -m -a "$input_path"`
  1.1757 +    path_after_shortmode=`$CYGPATH -u "$shortmode_path"`
  1.1758 +    if test "x$path_after_shortmode" != "x$input_to_shortpath"; then
  1.1759 +      # Going to short mode and back again did indeed matter. Since short mode is
  1.1760 +      # case insensitive, let's make it lowercase to improve readability.
  1.1761 +      shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
  1.1762 +      # Now convert it back to Unix-stile (cygpath)
  1.1763 +      input_path=`$CYGPATH -u "$shortmode_path"`
  1.1764 +      new_path="$input_path"
  1.1765 +    fi
  1.1766 +  fi
  1.1767 +
  1.1768 +  test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/`
  1.1769 +  if test "x$test_cygdrive_prefix" = x; then
  1.1770 +    # As a simple fix, exclude /usr/bin since it's not a real path.
  1.1771 +    if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then
  1.1772 +      # The path is in a Cygwin special directory (e.g. /home). We need this converted to
  1.1773 +      # a path prefixed by /cygdrive for fixpath to work.
  1.1774 +      new_path="$CYGWIN_ROOT_PATH$input_path"
  1.1775 +    fi
  1.1776 +  fi
  1.1777 +
  1.1778 +
  1.1779 +  if test "x$path" != "x$new_path"; then
  1.1780 +    MSVCP_DLL="$new_path"
  1.1781 +    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MSVCP_DLL to \"$new_path\"" >&5
  1.1782 +$as_echo "$as_me: Rewriting MSVCP_DLL to \"$new_path\"" >&6;}
  1.1783 +  fi
  1.1784 +
  1.1785 +  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
  1.1786 +
  1.1787 +  path="$MSVCP_DLL"
  1.1788 +  has_colon=`$ECHO $path | $GREP ^.:`
  1.1789 +  new_path="$path"
  1.1790 +  if test "x$has_colon" = x; then
  1.1791 +    # Not in mixed or Windows style, start by that.
  1.1792 +    new_path=`cmd //c echo $path`
  1.1793 +  fi
  1.1794 +
  1.1795 +
  1.1796 +  input_path="$new_path"
  1.1797 +  # Check if we need to convert this using DOS-style short mode. If the path
  1.1798 +  # contains just simple characters, use it. Otherwise (spaces, weird characters),
  1.1799 +  # take no chances and rewrite it.
  1.1800 +  # Note: m4 eats our [], so we need to use [ and ] instead.
  1.1801 +  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]`
  1.1802 +  if test "x$has_forbidden_chars" != x; then
  1.1803 +    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
  1.1804 +    new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
  1.1805 +  fi
  1.1806 +
  1.1807 +
  1.1808 +  windows_path="$new_path"
  1.1809 +  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
  1.1810 +    unix_path=`$CYGPATH -u "$windows_path"`
  1.1811 +    new_path="$unix_path"
  1.1812 +  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
  1.1813 +    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
  1.1814 +    new_path="$unix_path"
  1.1815 +  fi
  1.1816 +
  1.1817 +  if test "x$path" != "x$new_path"; then
  1.1818 +    MSVCP_DLL="$new_path"
  1.1819 +    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MSVCP_DLL to \"$new_path\"" >&5
  1.1820 +$as_echo "$as_me: Rewriting MSVCP_DLL to \"$new_path\"" >&6;}
  1.1821 +  fi
  1.1822 +
  1.1823 +  # Save the first 10 bytes of this path to the storage, so fixpath can work.
  1.1824 +  all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
  1.1825 +
  1.1826 +  else
  1.1827 +    # We're on a posix platform. Hooray! :)
  1.1828 +    path="$MSVCP_DLL"
  1.1829 +    has_space=`$ECHO "$path" | $GREP " "`
  1.1830 +    if test "x$has_space" != x; then
  1.1831 +      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVCP_DLL, which resolves as \"$path\", is invalid." >&5
  1.1832 +$as_echo "$as_me: The path of MSVCP_DLL, which resolves as \"$path\", is invalid." >&6;}
  1.1833 +      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
  1.1834 +    fi
  1.1835 +
  1.1836 +    # Use eval to expand a potential ~
  1.1837 +    eval path="$path"
  1.1838 +    if test ! -f "$path" && test ! -d "$path"; then
  1.1839 +      as_fn_error $? "The path of MSVCP_DLL, which resolves as \"$path\", is not found." "$LINENO" 5
  1.1840 +    fi
  1.1841 +
  1.1842 +    MSVCP_DLL="`cd "$path"; $THEPWDCMD -L`"
  1.1843 +  fi
  1.1844 +
  1.1845 +  MSVCP_DLL=$MSVCP_DLL
  1.1846 +
  1.1847 +
  1.1848 +    fi
  1.1849 +  fi
  1.1850  
  1.1851  
  1.1852  
  1.1853 @@ -48271,7 +49037,6 @@
  1.1854    fi
  1.1855  
  1.1856  
  1.1857 -
  1.1858  ###############################################################################
  1.1859  #
  1.1860  # We need to do some final tweaking, when everything else is done.
  1.1861 @@ -50419,7 +51184,10 @@
  1.1862      printf "* Environment:    $WINDOWS_ENV_VENDOR version $WINDOWS_ENV_VERSION (root at $WINDOWS_ENV_ROOT_PATH)\n"
  1.1863    fi
  1.1864    printf "* Boot JDK:       $BOOT_JDK_VERSION (at $BOOT_JDK)\n"
  1.1865 -  printf "* Toolchain:      $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION)\n"
  1.1866 +  if test "x$TOOLCHAIN_VERSION" != "x"; then
  1.1867 +    print_version=" $TOOLCHAIN_VERSION"
  1.1868 +  fi
  1.1869 +  printf "* Toolchain:      $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION$print_version)\n"
  1.1870    printf "* C Compiler:     Version $CC_VERSION_NUMBER (at $CC)\n"
  1.1871    printf "* C++ Compiler:   Version $CXX_VERSION_NUMBER (at $CXX)\n"
  1.1872  

mercurial