common/autoconf/toolchain_windows.m4

Tue, 17 Apr 2018 09:33:36 -0700

author
kevinw
date
Tue, 17 Apr 2018 09:33:36 -0700
changeset 2219
cb1203f48728
parent 2209
cddffb220808
child 2220
47fda751abb6
permissions
-rw-r--r--

8022177: Windows/MSYS builds broken
Reviewed-by: erikj, tbell, erikj, simonis
Contributed-by: volker.simonis@gmail.com, erik.joelsson@oracle.com

ohair@494 1 #
ohair@494 2 # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
ohair@494 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ohair@494 4 #
ohair@494 5 # This code is free software; you can redistribute it and/or modify it
ohair@494 6 # under the terms of the GNU General Public License version 2 only, as
ohair@494 7 # published by the Free Software Foundation. Oracle designates this
ohair@494 8 # particular file as subject to the "Classpath" exception as provided
ohair@494 9 # by Oracle in the LICENSE file that accompanied this code.
ohair@494 10 #
ohair@494 11 # This code is distributed in the hope that it will be useful, but WITHOUT
ohair@494 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ohair@494 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
ohair@494 14 # version 2 for more details (a copy is included in the LICENSE file that
ohair@494 15 # accompanied this code).
ohair@494 16 #
ohair@494 17 # You should have received a copy of the GNU General Public License version
ohair@494 18 # 2 along with this work; if not, write to the Free Software Foundation,
ohair@494 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ohair@494 20 #
ohair@494 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@494 22 # or visit www.oracle.com if you need additional information or have any
ohair@494 23 # questions.
ohair@494 24 #
ohair@494 25
ohair@494 26 AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT],
ohair@494 27 [
ohair@494 28 if test "x$VS_ENV_CMD" = x; then
ohair@494 29 VS100BASE="$1"
ohair@494 30 METHOD="$2"
ohair@494 31 BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(VS100BASE)
ohair@494 32 if test -d "$VS100BASE"; then
ohair@494 33 if test -f "$VS100BASE/$VCVARSFILE"; then
ohair@494 34 AC_MSG_NOTICE([Found Visual Studio installation at $VS100BASE using $METHOD])
ohair@494 35 VS_ENV_CMD="$VS100BASE/$VCVARSFILE"
ohair@494 36 else
ohair@494 37 AC_MSG_NOTICE([Found Visual Studio installation at $VS100BASE using $METHOD])
ohair@494 38 AC_MSG_NOTICE([Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring])
ohair@494 39 fi
ohair@494 40 fi
ohair@494 41 fi
ohair@494 42 ])
ohair@494 43
ohair@494 44 AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT],
ohair@494 45 [
ohair@494 46 if test "x$VS_ENV_CMD" = x; then
ohair@494 47 WIN_SDK_BASE="$1"
ohair@494 48 METHOD="$2"
ohair@494 49 BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(WIN_SDK_BASE)
ohair@494 50 if test -d "$WIN_SDK_BASE"; then
erikj@525 51 # There have been cases of partial or broken SDK installations. A missing
erikj@525 52 # lib dir is not going to work.
erikj@525 53 if test ! -d "$WIN_SDK_BASE/../lib"; then
erikj@525 54 AC_MSG_NOTICE([Found Windows SDK installation at $WIN_SDK_BASE using $METHOD])
erikj@525 55 AC_MSG_NOTICE([Warning: Installation is broken, lib dir is missing. Ignoring])
erikj@525 56 elif test -f "$WIN_SDK_BASE/SetEnv.Cmd"; then
ohair@494 57 AC_MSG_NOTICE([Found Windows SDK installation at $WIN_SDK_BASE using $METHOD])
ohair@494 58 VS_ENV_CMD="$WIN_SDK_BASE/SetEnv.Cmd"
ohair@494 59 if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
ohair@494 60 VS_ENV_ARGS="/x86"
ohair@494 61 else
ohair@494 62 VS_ENV_ARGS="/x64"
ohair@494 63 fi
ohair@494 64 else
ohair@494 65 AC_MSG_NOTICE([Found Windows SDK installation at $WIN_SDK_BASE using $METHOD])
ohair@494 66 AC_MSG_NOTICE([Warning: Installation is broken, SetEnv.Cmd is missing. Ignoring])
ohair@494 67 fi
ohair@494 68 fi
ohair@494 69 fi
ohair@494 70 ])
ohair@494 71
ohair@494 72 AC_DEFUN([TOOLCHAIN_FIND_VISUAL_STUDIO_BAT_FILE],
ohair@494 73 [
ohair@494 74 if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
ohair@494 75 VCVARSFILE="vc/bin/vcvars32.bat"
ohair@494 76 else
ohair@494 77 VCVARSFILE="vc/bin/amd64/vcvars64.bat"
ihse@839 78 fi
ohair@494 79
ohair@494 80 VS_ENV_CMD=""
ohair@494 81 VS_ENV_ARGS=""
ohair@494 82 if test "x$with_toolsdir" != x; then
ohair@494 83 TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([$with_toolsdir/../..], [--with-tools-dir])
ohair@494 84 fi
ohair@494 85
ohair@494 86 if test "x$with_toolsdir" != x && test "x$VS_ENV_CMD" = x; then
ohair@494 87 # Having specified an argument which is incorrect will produce an instant failure;
ohair@494 88 # we should not go on looking
ohair@494 89 AC_MSG_NOTICE([The path given by --with-tools-dir does not contain a valid Visual Studio installation])
ohair@494 90 AC_MSG_NOTICE([Please point to the VC/bin directory within the Visual Studio installation])
ohair@494 91 AC_MSG_ERROR([Cannot locate a valid Visual Studio installation])
ihse@839 92 fi
ohair@494 93
erikj@733 94 if test "x$VS100COMNTOOLS" != x; then
erikj@733 95 TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([$VS100COMNTOOLS/../..], [VS100COMNTOOLS variable])
erikj@733 96 fi
erikj@733 97 if test "x$PROGRAMFILES" != x; then
erikj@733 98 TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([$PROGRAMFILES/Microsoft Visual Studio 10.0], [well-known name])
erikj@733 99 fi
erikj@733 100 TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([C:/Program Files/Microsoft Visual Studio 10.0], [well-known name])
erikj@733 101 TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([C:/Program Files (x86)/Microsoft Visual Studio 10.0], [well-known name])
erikj@733 102
ohair@494 103 if test "x$ProgramW6432" != x; then
ohair@494 104 TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([$ProgramW6432/Microsoft SDKs/Windows/v7.1/Bin], [well-known name])
ohair@494 105 fi
ohair@494 106 if test "x$PROGRAMW6432" != x; then
ohair@494 107 TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([$PROGRAMW6432/Microsoft SDKs/Windows/v7.1/Bin], [well-known name])
ohair@494 108 fi
ohair@494 109 if test "x$PROGRAMFILES" != x; then
ohair@494 110 TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([$PROGRAMFILES/Microsoft SDKs/Windows/v7.1/Bin], [well-known name])
ohair@494 111 fi
ohair@494 112 TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([C:/Program Files/Microsoft SDKs/Windows/v7.1/Bin], [well-known name])
ohair@494 113 TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([C:/Program Files (x86)/Microsoft SDKs/Windows/v7.1/Bin], [well-known name])
ohair@494 114 ])
ohair@494 115
ohair@494 116 # Check if the VS env variables were setup prior to running configure.
ohair@494 117 # If not, then find vcvarsall.bat and run it automatically, and integrate
ohair@494 118 # the set env variables into the spec file.
ohair@494 119 AC_DEFUN([TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV],
ohair@494 120 [
ihse@839 121 # Store path to cygwin link.exe to help excluding it when searching for
ohair@494 122 # VS linker. This must be done before changing the PATH when looking for VS.
ohair@494 123 AC_PATH_PROG(CYGWIN_LINK, link)
ohair@494 124 if test "x$CYGWIN_LINK" != x; then
ohair@494 125 AC_MSG_CHECKING([if the first found link.exe is actually the Cygwin link tool])
ohair@494 126 "$CYGWIN_LINK" --version > /dev/null
ohair@494 127 if test $? -eq 0 ; then
ohair@494 128 AC_MSG_RESULT([yes])
ohair@494 129 else
ohair@494 130 AC_MSG_RESULT([no])
ohair@494 131 # This might be the VS linker. Don't exclude it later on.
ohair@494 132 CYGWIN_LINK=""
ohair@494 133 fi
ohair@494 134 fi
ohair@494 135
ohair@494 136 # First-hand choice is to locate and run the vsvars bat file.
ohair@494 137 TOOLCHAIN_FIND_VISUAL_STUDIO_BAT_FILE
ohair@494 138 if test "x$VS_ENV_CMD" != x; then
ohair@494 139 # We have found a Visual Studio environment on disk, let's extract variables from the vsvars bat file.
ohair@494 140 BASIC_FIXUP_EXECUTABLE(VS_ENV_CMD)
ohair@494 141
ohair@494 142 # Lets extract the variables that are set by vcvarsall.bat/vsvars32.bat/vsvars64.bat
ohair@494 143 AC_MSG_NOTICE([Trying to extract Visual Studio environment variables])
ohair@494 144
kevinw@2208 145 # We need to create a couple of temporary files.
kevinw@2208 146 VS_ENV_TMP_DIR="$OUTPUT_ROOT/vs-env"
kevinw@2208 147 $MKDIR -p $VS_ENV_TMP_DIR
ohair@494 148
kevinw@2208 149 # Cannot use the VS10 setup script directly (since it only updates the DOS subshell environment).
kevinw@2208 150 # Instead create a shell script which will set the relevant variables when run.
kevinw@2208 151 WINPATH_VS_ENV_CMD="$VS_ENV_CMD"
kevinw@2208 152 BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH([WINPATH_VS_ENV_CMD])
kevinw@2208 153 WINPATH_BASH="$BASH"
kevinw@2208 154 BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH([WINPATH_BASH])
ohair@494 155
kevinw@2208 156 # Generate a DOS batch file which runs $VS_ENV_CMD, and then creates a shell
kevinw@2208 157 # script (executable by bash) that will setup the important variables.
kevinw@2208 158 EXTRACT_VC_ENV_BAT_FILE="$VS_ENV_TMP_DIR/extract-vs-env.bat"
kevinw@2208 159 $ECHO "@echo off" > $EXTRACT_VC_ENV_BAT_FILE
kevinw@2208 160 # This will end up something like:
kevinw@2208 161 # call C:/progra~2/micros~2.0/vc/bin/amd64/vcvars64.bat
kevinw@2208 162 $ECHO "call $WINPATH_VS_ENV_CMD $VS_ENV_ARGS" >> $EXTRACT_VC_ENV_BAT_FILE
kevinw@2208 163 # These will end up something like:
kevinw@2208 164 # C:/CygWin/bin/bash -c 'echo VS_PATH=\"$PATH\" > localdevenv.sh
kevinw@2208 165 # The trailing space for everyone except PATH is no typo, but is needed due
kevinw@2208 166 # to trailing \ in the Windows paths. These will be stripped later.
kevinw@2208 167 $ECHO "$WINPATH_BASH -c 'echo VS_PATH="'\"$PATH\" > set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
kevinw@2208 168 $ECHO "$WINPATH_BASH -c 'echo VS_INCLUDE="'\"$INCLUDE \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
kevinw@2208 169 $ECHO "$WINPATH_BASH -c 'echo VS_LIB="'\"$LIB \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
kevinw@2208 170 $ECHO "$WINPATH_BASH -c 'echo VCINSTALLDIR="'\"$VCINSTALLDIR \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
kevinw@2208 171 $ECHO "$WINPATH_BASH -c 'echo WindowsSdkDir="'\"$WindowsSdkDir \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
kevinw@2208 172 $ECHO "$WINPATH_BASH -c 'echo WINDOWSSDKDIR="'\"$WINDOWSSDKDIR \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
ohair@494 173
ohair@494 174 # Now execute the newly created bat file.
kevinw@2208 175 # The | cat is to stop SetEnv.Cmd to mess with system colors on msys.
kevinw@2208 176 # Change directory so we don't need to mess with Windows paths in redirects.
kevinw@2208 177 cd $VS_ENV_TMP_DIR
kevinw@2208 178 cmd /c extract-vs-env.bat | $CAT
kevinw@2208 179 cd $CURDIR
ohair@494 180
kevinw@2208 181 if test ! -s $VS_ENV_TMP_DIR/set-vs-env.sh; then
ohair@494 182 AC_MSG_NOTICE([Could not succesfully extract the envionment variables needed for the VS setup.])
ohair@494 183 AC_MSG_NOTICE([Try setting --with-tools-dir to the VC/bin directory within the VS installation])
ohair@494 184 AC_MSG_NOTICE([or run "bash.exe -l" from a VS command prompt and then run configure from there.])
ohair@494 185 AC_MSG_ERROR([Cannot continue])
ohair@494 186 fi
ohair@494 187
ihse@839 188 # Now set all paths and other env variables. This will allow the rest of
ohair@494 189 # the configure script to find and run the compiler in the proper way.
ohair@494 190 AC_MSG_NOTICE([Setting extracted environment variables])
kevinw@2208 191 . $VS_ENV_TMP_DIR/set-vs-env.sh
kevinw@2208 192 # Now we have VS_PATH, VS_INCLUDE, VS_LIB. For further checking, we
kevinw@2208 193 # also define VCINSTALLDIR, WindowsSdkDir and WINDOWSSDKDIR.
ohair@494 194 else
ohair@494 195 # We did not find a vsvars bat file, let's hope we are run from a VS command prompt.
ohair@494 196 AC_MSG_NOTICE([Cannot locate a valid Visual Studio installation, checking current environment])
ohair@494 197 fi
ohair@494 198
kevinw@2208 199 # At this point, we should have correct variables in the environment, or we can't continue.
ohair@494 200 AC_MSG_CHECKING([for Visual Studio variables])
ihse@839 201
ohair@494 202 if test "x$VCINSTALLDIR" != x || test "x$WindowsSDKDir" != x || test "x$WINDOWSSDKDIR" != x; then
kevinw@2208 203 if test "x$VS_INCLUDE" = x || test "x$VS_LIB" = x; then
ohair@494 204 AC_MSG_RESULT([present but broken])
ohair@494 205 AC_MSG_ERROR([Your VC command prompt seems broken, INCLUDE and/or LIB is missing.])
ohair@494 206 else
ohair@494 207 AC_MSG_RESULT([ok])
kevinw@2208 208 # Remove any trailing "\" and " " from the variables.
kevinw@2208 209 VS_INCLUDE=`$ECHO "$VS_INCLUDE" | $SED 's/\\\\* *$//'`
kevinw@2208 210 VS_LIB=`$ECHO "$VS_LIB" | $SED 's/\\\\* *$//'`
kevinw@2208 211 VCINSTALLDIR=`$ECHO "$VCINSTALLDIR" | $SED 's/\\\\* *$//'`
kevinw@2208 212 WindowsSDKDir=`$ECHO "$WindowsSDKDir" | $SED 's/\\\\* *$//'`
kevinw@2208 213 WINDOWSSDKDIR=`$ECHO "$WINDOWSSDKDIR" | $SED 's/\\\\* *$//'`
kevinw@2209 214 # Remove any paths containing # (typically F#) as that messes up make. This
kevinw@2209 215 # is needed if visual studio was installed with F# support.
kevinw@2209 216 VS_PATH=`$ECHO "$VS_PATH" | $SED 's/[[^:#]]*#[^:]*://g'`
kevinw@2208 217
kevinw@2208 218 AC_SUBST(VS_PATH)
ohair@494 219 AC_SUBST(VS_INCLUDE)
ohair@494 220 AC_SUBST(VS_LIB)
ohair@494 221 fi
ohair@494 222 else
ohair@494 223 AC_MSG_RESULT([not found])
ohair@494 224
ohair@494 225 if test "x$VS_ENV_CMD" = x; then
ohair@494 226 AC_MSG_NOTICE([Cannot locate a valid Visual Studio or Windows SDK installation on disk,])
ohair@494 227 AC_MSG_NOTICE([nor is this script run from a Visual Studio command prompt.])
ohair@494 228 else
ohair@494 229 AC_MSG_NOTICE([Running the extraction script failed.])
ohair@494 230 fi
ohair@494 231 AC_MSG_NOTICE([Try setting --with-tools-dir to the VC/bin directory within the VS installation])
ohair@494 232 AC_MSG_NOTICE([or run "bash.exe -l" from a VS command prompt and then run configure from there.])
ohair@494 233 AC_MSG_ERROR([Cannot continue])
ohair@494 234 fi
ihse@857 235 ])
ihse@839 236
ihse@857 237 AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL],
ihse@857 238 [
ihse@857 239 POSSIBLE_MSVCR_DLL="$1"
ihse@857 240 METHOD="$2"
ihse@857 241 if test -e "$POSSIBLE_MSVCR_DLL"; then
ihse@857 242 AC_MSG_NOTICE([Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD])
ihse@857 243
ihse@857 244 # Need to check if the found msvcr is correct architecture
ihse@857 245 AC_MSG_CHECKING([found msvcr100.dll architecture])
ihse@857 246 MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"`
kevinw@2219 247 if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
kevinw@2219 248 # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit"
kevinw@2219 249 # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems.
kevinw@2219 250 if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
kevinw@2219 251 CORRECT_MSVCR_ARCH="PE32 executable"
kevinw@2219 252 else
kevinw@2219 253 CORRECT_MSVCR_ARCH="PE32+ executable"
kevinw@2219 254 fi
ihse@857 255 else
kevinw@2219 256 if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
kevinw@2219 257 CORRECT_MSVCR_ARCH=386
kevinw@2219 258 else
kevinw@2219 259 CORRECT_MSVCR_ARCH=x86-64
kevinw@2219 260 fi
ihse@857 261 fi
kevinw@2219 262 if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then
ihse@857 263 AC_MSG_RESULT([ok])
ihse@857 264 MSVCR_DLL="$POSSIBLE_MSVCR_DLL"
ihse@857 265 AC_MSG_CHECKING([for msvcr100.dll])
ihse@857 266 AC_MSG_RESULT([$MSVCR_DLL])
ihse@857 267 else
ihse@857 268 AC_MSG_RESULT([incorrect, ignoring])
ihse@857 269 AC_MSG_NOTICE([The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE])
ihse@857 270 fi
ihse@857 271 fi
ihse@857 272 ])
ihse@857 273
ihse@857 274 AC_DEFUN([TOOLCHAIN_SETUP_MSVCR_DLL],
ihse@857 275 [
ohair@494 276 AC_ARG_WITH(msvcr-dll, [AS_HELP_STRING([--with-msvcr-dll],
ohair@494 277 [copy this msvcr100.dll into the built JDK (Windows only) @<:@probed@:>@])])
ihse@857 278
ohair@494 279 if test "x$with_msvcr_dll" != x; then
ihse@857 280 # If given explicitely by user, do not probe. If not present, fail directly.
ihse@857 281 TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$with_msvcr_dll], [--with-msvcr-dll])
ihse@857 282 if test "x$MSVCR_DLL" = x; then
ihse@857 283 AC_MSG_ERROR([Could not find a proper msvcr100.dll as specified by --with-msvcr-dll])
ihse@857 284 fi
ihse@857 285 fi
ihse@857 286
ihse@857 287 if test "x$MSVCR_DLL" = x; then
ihse@857 288 # Probe: Using well-known location from Visual Studio 10.0
ohair@494 289 if test "x$VCINSTALLDIR" != x; then
ihse@857 290 CYGWIN_VC_INSTALL_DIR="$VCINSTALLDIR"
ihse@857 291 BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(CYGWIN_VC_INSTALL_DIR)
ohair@494 292 if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
ihse@857 293 POSSIBLE_MSVCR_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x64/Microsoft.VC100.CRT/msvcr100.dll"
ohair@494 294 else
ihse@857 295 POSSIBLE_MSVCR_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x86/Microsoft.VC100.CRT/msvcr100.dll"
ihse@857 296 fi
ihse@857 297 TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$POSSIBLE_MSVCR_DLL], [well-known location in VCINSTALLDIR])
ihse@857 298 fi
ihse@857 299 fi
ihse@857 300
ihse@857 301 if test "x$MSVCR_DLL" = x; then
ihse@857 302 # Probe: Check in the Boot JDK directory.
ihse@857 303 POSSIBLE_MSVCR_DLL="$BOOT_JDK/bin/msvcr100.dll"
ihse@857 304 TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$POSSIBLE_MSVCR_DLL], [well-known location in Boot JDK])
ihse@857 305 fi
ihse@857 306
ihse@857 307 if test "x$MSVCR_DLL" = x; then
ihse@857 308 # Probe: Look in the Windows system32 directory
ihse@857 309 CYGWIN_SYSTEMROOT="$SYSTEMROOT"
ihse@857 310 BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(CYGWIN_SYSTEMROOT)
ihse@857 311 POSSIBLE_MSVCR_DLL="$CYGWIN_SYSTEMROOT/system32/msvcr100.dll"
ihse@857 312 TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$POSSIBLE_MSVCR_DLL], [well-known location in SYSTEMROOT])
ihse@857 313 fi
ihse@857 314
ihse@857 315 if test "x$MSVCR_DLL" = x; then
ihse@857 316 # Probe: If Visual Studio Express is installed, there is usually one with the debugger
ihse@857 317 if test "x$VS100COMNTOOLS" != x; then
ihse@857 318 CYGWIN_VS_TOOLS_DIR="$VS100COMNTOOLS/.."
ihse@857 319 BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(CYGWIN_VS_TOOLS_DIR)
ihse@857 320 if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
ihse@857 321 POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name msvcr100.dll | $GREP -i /x64/ | $HEAD --lines 1`
ihse@857 322 else
ihse@857 323 POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name msvcr100.dll | $GREP -i /x86/ | $HEAD --lines 1`
ihse@857 324 fi
ihse@857 325 TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$POSSIBLE_MSVCR_DLL], [search of VS100COMNTOOLS])
ihse@857 326 fi
ihse@857 327 fi
ihse@857 328
ihse@857 329 if test "x$MSVCR_DLL" = x; then
ihse@857 330 # Probe: Search wildly in the VCINSTALLDIR. We've probably lost by now.
ihse@857 331 # (This was the original behaviour; kept since it might turn up something)
ihse@857 332 if test "x$CYGWIN_VC_INSTALL_DIR" != x; then
ihse@857 333 if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
ihse@857 334 POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $GREP x64 | $HEAD --lines 1`
ihse@857 335 else
ihse@857 336 POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $GREP x86 | $GREP -v ia64 | $GREP -v x64 | $HEAD --lines 1`
ihse@857 337 if test "x$POSSIBLE_MSVCR_DLL" = x; then
ihse@857 338 # We're grasping at straws now...
ihse@857 339 POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $HEAD --lines 1`
ohair@494 340 fi
ohair@494 341 fi
ihse@857 342
ihse@857 343 TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$POSSIBLE_MSVCR_DLL], [search of VCINSTALLDIR])
ohair@494 344 fi
ohair@494 345 fi
ihse@857 346
ohair@494 347 if test "x$MSVCR_DLL" = x; then
ihse@857 348 AC_MSG_CHECKING([for msvcr100.dll])
ohair@494 349 AC_MSG_RESULT([no])
ihse@857 350 AC_MSG_ERROR([Could not find msvcr100.dll. Please specify using --with-msvcr-dll.])
ohair@494 351 fi
ihse@857 352
ohair@494 353 BASIC_FIXUP_PATH(MSVCR_DLL)
ohair@494 354 ])

mercurial