common/autoconf/toolchain_windows.m4

Wed, 18 Apr 2018 02:21:14 -0700

author
kevinw
date
Wed, 18 Apr 2018 02:21:14 -0700
changeset 2220
47fda751abb6
parent 2219
cb1203f48728
child 2223
01cc48ed67f3
permissions
-rw-r--r--

8057538: Build the freetype library during configure on Windows
Reviewed-by: simonis, erikj, ihse

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

mercurial