Mon, 15 Oct 2018 15:33:48 +0100
Merge
ohair@494 | 1 | # |
kevinw@2223 | 2 | # Copyright (c) 2011, 2018, 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 | |
kevinw@2223 | 26 | ################################################################################ |
kevinw@2228 | 27 | # The order of these defines the priority by which we try to find them. |
kevinw@2228 | 28 | VALID_VS_VERSIONS="2010 2012 2013 2015 2017" |
kevinw@2223 | 29 | |
kevinw@2223 | 30 | VS_DESCRIPTION_2010="Microsoft Visual Studio 2010" |
kevinw@2223 | 31 | VS_VERSION_INTERNAL_2010=100 |
kevinw@2223 | 32 | VS_MSVCR_2010=msvcr100.dll |
kevinw@2223 | 33 | # We don't use msvcp on Visual Studio 2010 |
kevinw@2223 | 34 | #VS_MSVCP_2010=msvcp100.dll |
kevinw@2223 | 35 | VS_ENVVAR_2010="VS100COMNTOOLS" |
kevinw@2223 | 36 | VS_VS_INSTALLDIR_2010="Microsoft Visual Studio 10.0" |
kevinw@2223 | 37 | VS_SDK_INSTALLDIR_2010="Microsoft SDKs/Windows/v7.1" |
kevinw@2223 | 38 | VS_VS_PLATFORM_NAME_2010="v100" |
kevinw@2223 | 39 | VS_SDK_PLATFORM_NAME_2010="Windows7.1SDK" |
kevinw@2223 | 40 | |
kevinw@2223 | 41 | VS_DESCRIPTION_2012="Microsoft Visual Studio 2012" |
kevinw@2223 | 42 | VS_VERSION_INTERNAL_2012=110 |
kevinw@2223 | 43 | VS_MSVCR_2012=msvcr110.dll |
kevinw@2223 | 44 | VS_MSVCP_2012=msvcp110.dll |
kevinw@2223 | 45 | VS_ENVVAR_2012="VS110COMNTOOLS" |
kevinw@2223 | 46 | VS_VS_INSTALLDIR_2012="Microsoft Visual Studio 11.0" |
kevinw@2223 | 47 | VS_SDK_INSTALLDIR_2012= |
kevinw@2223 | 48 | VS_VS_PLATFORM_NAME_2012="v110" |
kevinw@2223 | 49 | VS_SDK_PLATFORM_NAME_2012= |
kevinw@2223 | 50 | |
kevinw@2223 | 51 | VS_DESCRIPTION_2013="Microsoft Visual Studio 2013" |
kevinw@2223 | 52 | VS_VERSION_INTERNAL_2013=120 |
kevinw@2223 | 53 | VS_MSVCR_2013=msvcr120.dll |
kevinw@2223 | 54 | VS_MSVCP_2013=msvcp120.dll |
kevinw@2223 | 55 | VS_ENVVAR_2013="VS120COMNTOOLS" |
kevinw@2223 | 56 | VS_VS_INSTALLDIR_2013="Microsoft Visual Studio 12.0" |
kevinw@2223 | 57 | VS_SDK_INSTALLDIR_2013= |
kevinw@2223 | 58 | VS_VS_PLATFORM_NAME_2013="v120" |
kevinw@2223 | 59 | VS_SDK_PLATFORM_NAME_2013= |
kevinw@2223 | 60 | |
kevinw@2228 | 61 | VS_DESCRIPTION_2015="Microsoft Visual Studio 2015 - CURRENTLY NOT WORKING" |
kevinw@2228 | 62 | VS_VERSION_INTERNAL_2015=140 |
kevinw@2228 | 63 | VS_MSVCR_2015=vcruntime140.dll |
kevinw@2228 | 64 | VS_MSVCP_2015=msvcp140.dll |
kevinw@2228 | 65 | VS_ENVVAR_2015="VS140COMNTOOLS" |
kevinw@2228 | 66 | VS_VS_INSTALLDIR_2015="Microsoft Visual Studio 14.0" |
kevinw@2228 | 67 | VS_SDK_INSTALLDIR_2015= |
kevinw@2228 | 68 | VS_VS_PLATFORM_NAME_2015="v140" |
kevinw@2228 | 69 | VS_SDK_PLATFORM_NAME_2015= |
kevinw@2228 | 70 | # The vcvars of 2015 breaks if 2017 is also installed. Work around this by |
kevinw@2228 | 71 | # explicitly specifying Windows Kit 8.1 to be used. |
kevinw@2228 | 72 | VS_ENV_ARGS_2015="8.1" |
kevinw@2228 | 73 | |
kevinw@2228 | 74 | VS_DESCRIPTION_2017="Microsoft Visual Studio 2017 - CURRENTLY NOT WORKING" |
kevinw@2228 | 75 | VS_VERSION_INTERNAL_2017=141 |
kevinw@2228 | 76 | VS_MSVCR_2017=vcruntime140.dll |
kevinw@2228 | 77 | VS_MSVCP_2017=msvcp140.dll |
kevinw@2228 | 78 | VS_ENVVAR_2017="VS150COMNTOOLS" |
kevinw@2228 | 79 | VS_VS_INSTALLDIR_2017="Microsoft Visual Studio/2017" |
kevinw@2228 | 80 | VS_EDITIONS_2017="Community Professional Enterprise" |
kevinw@2228 | 81 | VS_SDK_INSTALLDIR_2017= |
kevinw@2228 | 82 | VS_VS_PLATFORM_NAME_2017="v141" |
kevinw@2228 | 83 | VS_SDK_PLATFORM_NAME_2017= |
kevinw@2228 | 84 | |
kevinw@2223 | 85 | ################################################################################ |
kevinw@2223 | 86 | |
ohair@494 | 87 | AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT], |
ohair@494 | 88 | [ |
ohair@494 | 89 | if test "x$VS_ENV_CMD" = x; then |
kevinw@2223 | 90 | VS_VERSION="$1" |
kevinw@2223 | 91 | VS_BASE="$2" |
kevinw@2223 | 92 | METHOD="$3" |
kevinw@2223 | 93 | |
kevinw@2228 | 94 | BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(VS_BASE) |
kevinw@2228 | 95 | # In VS 2017, the default installation is in a subdir named after the edition. |
kevinw@2228 | 96 | # Find the first one present and use that. |
kevinw@2228 | 97 | if test "x$VS_EDITIONS" != x; then |
kevinw@2228 | 98 | for edition in $VS_EDITIONS; do |
kevinw@2228 | 99 | if test -d "$VS_BASE/$edition"; then |
kevinw@2228 | 100 | VS_BASE="$VS_BASE/$edition" |
kevinw@2228 | 101 | break |
kevinw@2228 | 102 | fi |
kevinw@2228 | 103 | done |
kevinw@2223 | 104 | fi |
kevinw@2223 | 105 | |
kevinw@2223 | 106 | if test -d "$VS_BASE"; then |
kevinw@2228 | 107 | AC_MSG_NOTICE([Found Visual Studio installation at $VS_BASE using $METHOD]) |
kevinw@2228 | 108 | if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then |
kevinw@2228 | 109 | VCVARSFILES="vc/bin/vcvars32.bat vc/auxiliary/build/vcvars32.bat" |
kevinw@2228 | 110 | else |
kevinw@2228 | 111 | VCVARSFILES="vc/bin/amd64/vcvars64.bat vc/bin/x86_amd64/vcvarsx86_amd64.bat \ |
kevinw@2228 | 112 | vc/auxiliary/build/vcvarsx86_amd64.bat vc/auxiliary/build/vcvars64.bat" |
kevinw@2228 | 113 | fi |
kevinw@2228 | 114 | |
kevinw@2228 | 115 | for VCVARSFILE in $VCVARSFILES; do |
kevinw@2228 | 116 | if test -f "$VS_BASE/$VCVARSFILE"; then |
kevinw@2228 | 117 | VS_ENV_CMD="$VS_BASE/$VCVARSFILE" |
kevinw@2228 | 118 | break |
kevinw@2228 | 119 | fi |
kevinw@2228 | 120 | done |
kevinw@2228 | 121 | |
kevinw@2228 | 122 | if test "x$VS_ENV_CMD" = x; then |
kevinw@2228 | 123 | AC_MSG_NOTICE([Warning: None of $VCVARSFILES were found, Visual Studio installation not recognized. Ignoring]) |
kevinw@2228 | 124 | else |
kevinw@2228 | 125 | # PLATFORM_TOOLSET is used during the compilation of the freetype sources |
kevinw@2228 | 126 | # (see 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', |
kevinw@2228 | 127 | # 'v110' or 'v120' for VS 2010, 2012 or VS2013 |
kevinw@2223 | 128 | eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}" |
kevinw@2228 | 129 | |
ohair@494 | 130 | fi |
ohair@494 | 131 | fi |
ohair@494 | 132 | fi |
ohair@494 | 133 | ]) |
ohair@494 | 134 | |
kevinw@2223 | 135 | ################################################################################ |
kevinw@2223 | 136 | |
ohair@494 | 137 | AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT], |
ohair@494 | 138 | [ |
ohair@494 | 139 | if test "x$VS_ENV_CMD" = x; then |
kevinw@2223 | 140 | VS_VERSION="$1" |
kevinw@2223 | 141 | WIN_SDK_BASE="$2" |
kevinw@2223 | 142 | METHOD="$3" |
ohair@494 | 143 | BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(WIN_SDK_BASE) |
ohair@494 | 144 | if test -d "$WIN_SDK_BASE"; then |
erikj@525 | 145 | # There have been cases of partial or broken SDK installations. A missing |
erikj@525 | 146 | # lib dir is not going to work. |
kevinw@2223 | 147 | if test ! -d "$WIN_SDK_BASE/lib"; then |
erikj@525 | 148 | AC_MSG_NOTICE([Found Windows SDK installation at $WIN_SDK_BASE using $METHOD]) |
erikj@525 | 149 | AC_MSG_NOTICE([Warning: Installation is broken, lib dir is missing. Ignoring]) |
kevinw@2223 | 150 | elif test -f "$WIN_SDK_BASE/Bin/SetEnv.Cmd"; then |
ohair@494 | 151 | AC_MSG_NOTICE([Found Windows SDK installation at $WIN_SDK_BASE using $METHOD]) |
kevinw@2223 | 152 | VS_ENV_CMD="$WIN_SDK_BASE/Bin/SetEnv.Cmd" |
ohair@494 | 153 | if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then |
ohair@494 | 154 | VS_ENV_ARGS="/x86" |
ohair@494 | 155 | else |
ohair@494 | 156 | VS_ENV_ARGS="/x64" |
ohair@494 | 157 | fi |
kevinw@2220 | 158 | # PLATFORM_TOOLSET is used during the compilation of the freetype sources (see |
kevinw@2220 | 159 | # 'LIB_BUILD_FREETYPE' in libraries.m4) and must be 'Windows7.1SDK' for Windows7.1SDK |
kevinw@2220 | 160 | # TODO: improve detection for other versions of SDK |
kevinw@2223 | 161 | eval PLATFORM_TOOLSET="\${VS_SDK_PLATFORM_NAME_${VS_VERSION}}" |
ohair@494 | 162 | else |
ohair@494 | 163 | AC_MSG_NOTICE([Found Windows SDK installation at $WIN_SDK_BASE using $METHOD]) |
ohair@494 | 164 | AC_MSG_NOTICE([Warning: Installation is broken, SetEnv.Cmd is missing. Ignoring]) |
ohair@494 | 165 | fi |
ohair@494 | 166 | fi |
ohair@494 | 167 | fi |
ohair@494 | 168 | ]) |
ohair@494 | 169 | |
kevinw@2223 | 170 | ################################################################################ |
kevinw@2223 | 171 | # Finds the bat or cmd file in Visual Studio or the SDK that sets up a proper |
kevinw@2223 | 172 | # build environment and assigns it to VS_ENV_CMD |
ohair@494 | 173 | AC_DEFUN([TOOLCHAIN_FIND_VISUAL_STUDIO_BAT_FILE], |
ohair@494 | 174 | [ |
kevinw@2223 | 175 | VS_VERSION="$1" |
kevinw@2223 | 176 | eval VS_COMNTOOLS_VAR="\${VS_ENVVAR_${VS_VERSION}}" |
kevinw@2223 | 177 | eval VS_COMNTOOLS="\$${VS_COMNTOOLS_VAR}" |
kevinw@2223 | 178 | eval VS_INSTALL_DIR="\${VS_VS_INSTALLDIR_${VS_VERSION}}" |
kevinw@2228 | 179 | eval VS_EDITIONS="\${VS_EDITIONS_${VS_VERSION}}" |
kevinw@2223 | 180 | eval SDK_INSTALL_DIR="\${VS_SDK_INSTALLDIR_${VS_VERSION}}" |
kevinw@2228 | 181 | eval VS_ENV_ARGS="\${VS_ENV_ARGS_${VS_VERSION}}" |
kevinw@2223 | 182 | |
kevinw@2223 | 183 | # When using --with-tools-dir, assume it points to the correct and default |
kevinw@2223 | 184 | # version of Visual Studio or that --with-toolchain-version was also set. |
kevinw@2223 | 185 | if test "x$with_tools_dir" != x; then |
kevinw@2223 | 186 | TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([${VS_VERSION}], |
kevinw@2223 | 187 | [$with_tools_dir/../..], [--with-tools-dir]) |
kevinw@2223 | 188 | TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([${VS_VERSION}], |
kevinw@2223 | 189 | [$with_tools_dir/../../..], [--with-tools-dir]) |
kevinw@2223 | 190 | if test "x$VS_ENV_CMD" = x; then |
kevinw@2223 | 191 | # Having specified an argument which is incorrect will produce an instant failure; |
kevinw@2223 | 192 | # we should not go on looking |
kevinw@2223 | 193 | AC_MSG_NOTICE([The path given by --with-tools-dir does not contain a valid]) |
kevinw@2223 | 194 | AC_MSG_NOTICE([Visual Studio installation. Please point to the VC/bin or VC/bin/amd64]) |
kevinw@2223 | 195 | AC_MSG_NOTICE([directory within the Visual Studio installation]) |
kevinw@2223 | 196 | AC_MSG_ERROR([Cannot locate a valid Visual Studio installation]) |
kevinw@2223 | 197 | fi |
ihse@839 | 198 | fi |
ohair@494 | 199 | |
ohair@494 | 200 | VS_ENV_CMD="" |
kevinw@2223 | 201 | |
kevinw@2223 | 202 | if test "x$VS_COMNTOOLS" != x; then |
kevinw@2223 | 203 | TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([${VS_VERSION}], |
kevinw@2223 | 204 | [$VS_COMNTOOLS/../..], [$VS_COMNTOOLS_VAR variable]) |
kevinw@2223 | 205 | fi |
kevinw@2223 | 206 | if test "x$PROGRAMFILES" != x; then |
kevinw@2223 | 207 | TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([${VS_VERSION}], |
kevinw@2223 | 208 | [$PROGRAMFILES/$VS_INSTALL_DIR], [well-known name]) |
kevinw@2223 | 209 | fi |
kevinw@2223 | 210 | # Work around the insanely named ProgramFiles(x86) env variable |
kevinw@2223 | 211 | PROGRAMFILES_X86="`env | $SED -n 's/^ProgramFiles(x86)=//p'`" |
kevinw@2223 | 212 | if test "x$PROGRAMFILES_X86" != x; then |
kevinw@2223 | 213 | TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([${VS_VERSION}], |
kevinw@2223 | 214 | [$PROGRAMFILES_X86/$VS_INSTALL_DIR], [well-known name]) |
kevinw@2223 | 215 | fi |
kevinw@2223 | 216 | TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([${VS_VERSION}], |
kevinw@2223 | 217 | [C:/Program Files/$VS_INSTALL_DIR], [well-known name]) |
kevinw@2223 | 218 | TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([${VS_VERSION}], |
kevinw@2223 | 219 | [C:/Program Files (x86)/$VS_INSTALL_DIR], [well-known name]) |
kevinw@2223 | 220 | |
kevinw@2223 | 221 | if test "x$SDK_INSTALL_DIR" != x; then |
kevinw@2223 | 222 | if test "x$ProgramW6432" != x; then |
kevinw@2223 | 223 | TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([${VS_VERSION}], |
kevinw@2223 | 224 | [$ProgramW6432/$SDK_INSTALL_DIR], [well-known name]) |
kevinw@2223 | 225 | fi |
kevinw@2223 | 226 | if test "x$PROGRAMW6432" != x; then |
kevinw@2223 | 227 | TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([${VS_VERSION}], |
kevinw@2223 | 228 | [$PROGRAMW6432/$SDK_INSTALL_DIR], [well-known name]) |
kevinw@2223 | 229 | fi |
kevinw@2223 | 230 | if test "x$PROGRAMFILES" != x; then |
kevinw@2223 | 231 | TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([${VS_VERSION}], |
kevinw@2223 | 232 | [$PROGRAMFILES/$SDK_INSTALL_DIR], [well-known name]) |
kevinw@2223 | 233 | fi |
kevinw@2223 | 234 | TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([${VS_VERSION}], |
kevinw@2223 | 235 | [C:/Program Files/$SDK_INSTALL_DIR], [well-known name]) |
kevinw@2223 | 236 | TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([${VS_VERSION}], |
kevinw@2223 | 237 | [C:/Program Files (x86)/$SDK_INSTALL_DIR], [well-known name]) |
kevinw@2223 | 238 | fi |
kevinw@2223 | 239 | ]) |
kevinw@2223 | 240 | |
kevinw@2223 | 241 | ################################################################################ |
kevinw@2223 | 242 | |
kevinw@2223 | 243 | AC_DEFUN([TOOLCHAIN_FIND_VISUAL_STUDIO], |
kevinw@2223 | 244 | [ |
kevinw@2223 | 245 | AC_ARG_WITH(toolchain-version, [AS_HELP_STRING([--with-toolchain-version], |
kevinw@2223 | 246 | [the version of the toolchain to look for, use '--help' to show possible values @<:@platform dependent@:>@])]) |
kevinw@2223 | 247 | |
kevinw@2223 | 248 | if test "x$with_toolchain_version" = xlist; then |
kevinw@2223 | 249 | # List all toolchains |
kevinw@2223 | 250 | AC_MSG_NOTICE([The following toolchain versions are valid on this platform:]) |
kevinw@2223 | 251 | for version in $VALID_VS_VERSIONS; do |
kevinw@2223 | 252 | eval VS_DESCRIPTION=\${VS_DESCRIPTION_$version} |
kevinw@2223 | 253 | $PRINTF " %-10s %s\n" $version "$VS_DESCRIPTION" |
kevinw@2223 | 254 | done |
kevinw@2223 | 255 | |
kevinw@2223 | 256 | exit 0 |
kevinw@2224 | 257 | elif test "x$DEVKIT_VS_VERSION" != x; then |
kevinw@2224 | 258 | VS_VERSION=$DEVKIT_VS_VERSION |
kevinw@2224 | 259 | TOOLCHAIN_VERSION=$VS_VERSION |
kevinw@2228 | 260 | # If the devkit has a name, use that as description |
kevinw@2228 | 261 | VS_DESCRIPTION="$DEVKIT_NAME" |
kevinw@2228 | 262 | if test "x$VS_DESCRIPTION" = x; then |
kevinw@2228 | 263 | eval VS_DESCRIPTION="\${VS_DESCRIPTION_${VS_VERSION}}" |
kevinw@2228 | 264 | fi |
kevinw@2224 | 265 | eval VS_VERSION_INTERNAL="\${VS_VERSION_INTERNAL_${VS_VERSION}}" |
kevinw@2224 | 266 | eval MSVCR_NAME="\${VS_MSVCR_${VS_VERSION}}" |
kevinw@2224 | 267 | eval MSVCP_NAME="\${VS_MSVCP_${VS_VERSION}}" |
kevinw@2224 | 268 | eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}" |
kevinw@2224 | 269 | VS_PATH="$TOOLCHAIN_PATH:$PATH" |
kevinw@2224 | 270 | |
kevinw@2224 | 271 | # Convert DEVKIT_VS_INCLUDE into windows style VS_INCLUDE so that it |
kevinw@2224 | 272 | # can still be exported as INCLUDE for compiler invocations without |
kevinw@2224 | 273 | # SYSROOT_CFLAGS |
kevinw@2224 | 274 | OLDIFS="$IFS" |
kevinw@2224 | 275 | IFS=";" |
kevinw@2224 | 276 | for i in $DEVKIT_VS_INCLUDE; do |
kevinw@2224 | 277 | ipath=$i |
kevinw@2224 | 278 | BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH([ipath]) |
kevinw@2224 | 279 | VS_INCLUDE="$VS_INCLUDE;$ipath" |
kevinw@2224 | 280 | done |
kevinw@2224 | 281 | # Convert DEVKIT_VS_LIB into VS_LIB so that it can still be exported |
kevinw@2224 | 282 | # as LIB for compiler invocations without SYSROOT_LDFLAGS |
kevinw@2224 | 283 | for i in $DEVKIT_VS_LIB; do |
kevinw@2224 | 284 | libpath=$i |
kevinw@2224 | 285 | BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH([libpath]) |
kevinw@2224 | 286 | VS_LIB="$VS_LIB;$libpath" |
kevinw@2224 | 287 | done |
kevinw@2224 | 288 | IFS="$OLDIFS" |
kevinw@2224 | 289 | |
kevinw@2224 | 290 | AC_MSG_NOTICE([Found devkit $VS_DESCRIPTION]) |
kevinw@2224 | 291 | |
kevinw@2223 | 292 | elif test "x$with_toolchain_version" != x; then |
kevinw@2223 | 293 | # User override; check that it is valid |
kevinw@2223 | 294 | if test "x${VALID_VS_VERSIONS/$with_toolchain_version/}" = "x${VALID_VS_VERSIONS}"; then |
kevinw@2223 | 295 | AC_MSG_NOTICE([Visual Studio version $with_toolchain_version is not valid.]) |
kevinw@2223 | 296 | AC_MSG_NOTICE([Valid Visual Studio versions: $VALID_VS_VERSIONS.]) |
kevinw@2223 | 297 | AC_MSG_ERROR([Cannot continue.]) |
kevinw@2223 | 298 | fi |
kevinw@2223 | 299 | VS_VERSIONS_PROBE_LIST="$with_toolchain_version" |
kevinw@2223 | 300 | else |
kevinw@2223 | 301 | # No flag given, use default |
kevinw@2223 | 302 | VS_VERSIONS_PROBE_LIST="$VALID_VS_VERSIONS" |
ohair@494 | 303 | fi |
ohair@494 | 304 | |
kevinw@2223 | 305 | for VS_VERSION in $VS_VERSIONS_PROBE_LIST; do |
kevinw@2223 | 306 | TOOLCHAIN_FIND_VISUAL_STUDIO_BAT_FILE([$VS_VERSION]) |
kevinw@2223 | 307 | if test "x$VS_ENV_CMD" != x; then |
kevinw@2223 | 308 | TOOLCHAIN_VERSION=$VS_VERSION |
kevinw@2223 | 309 | eval VS_DESCRIPTION="\${VS_DESCRIPTION_${VS_VERSION}}" |
kevinw@2223 | 310 | eval VS_VERSION_INTERNAL="\${VS_VERSION_INTERNAL_${VS_VERSION}}" |
kevinw@2223 | 311 | eval MSVCR_NAME="\${VS_MSVCR_${VS_VERSION}}" |
kevinw@2223 | 312 | eval MSVCP_NAME="\${VS_MSVCP_${VS_VERSION}}" |
kevinw@2223 | 313 | # The rest of the variables are already evaled while probing |
kevinw@2223 | 314 | AC_MSG_NOTICE([Found $VS_DESCRIPTION]) |
kevinw@2223 | 315 | break |
kevinw@2223 | 316 | fi |
kevinw@2223 | 317 | done |
kevinw@2228 | 318 | |
kevinw@2228 | 319 | TOOLCHAIN_DESCRIPTION="$VS_DESCRIPTION" |
kevinw@2228 | 320 | if test "$TOOLCHAIN_VERSION" -gt 2013; then |
kevinw@2228 | 321 | UNSUPPORTED_TOOLCHAIN_VERSION=yes |
kevinw@2228 | 322 | fi |
ohair@494 | 323 | ]) |
ohair@494 | 324 | |
kevinw@2223 | 325 | ################################################################################ |
ohair@494 | 326 | # Check if the VS env variables were setup prior to running configure. |
ohair@494 | 327 | # If not, then find vcvarsall.bat and run it automatically, and integrate |
ohair@494 | 328 | # the set env variables into the spec file. |
ohair@494 | 329 | AC_DEFUN([TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV], |
ohair@494 | 330 | [ |
ihse@839 | 331 | # Store path to cygwin link.exe to help excluding it when searching for |
ohair@494 | 332 | # VS linker. This must be done before changing the PATH when looking for VS. |
ohair@494 | 333 | AC_PATH_PROG(CYGWIN_LINK, link) |
ohair@494 | 334 | if test "x$CYGWIN_LINK" != x; then |
ohair@494 | 335 | AC_MSG_CHECKING([if the first found link.exe is actually the Cygwin link tool]) |
ohair@494 | 336 | "$CYGWIN_LINK" --version > /dev/null |
ohair@494 | 337 | if test $? -eq 0 ; then |
ohair@494 | 338 | AC_MSG_RESULT([yes]) |
ohair@494 | 339 | else |
ohair@494 | 340 | AC_MSG_RESULT([no]) |
ohair@494 | 341 | # This might be the VS linker. Don't exclude it later on. |
ohair@494 | 342 | CYGWIN_LINK="" |
ohair@494 | 343 | fi |
ohair@494 | 344 | fi |
ohair@494 | 345 | |
ohair@494 | 346 | # First-hand choice is to locate and run the vsvars bat file. |
kevinw@2223 | 347 | TOOLCHAIN_FIND_VISUAL_STUDIO |
kevinw@2223 | 348 | |
kevinw@2224 | 349 | # If we have a devkit, skip all of the below. |
kevinw@2224 | 350 | if test "x$DEVKIT_VS_VERSION" = x; then |
kevinw@2224 | 351 | if test "x$VS_ENV_CMD" != x; then |
kevinw@2224 | 352 | # We have found a Visual Studio environment on disk, let's extract variables from the vsvars bat file. |
kevinw@2224 | 353 | BASIC_FIXUP_EXECUTABLE(VS_ENV_CMD) |
ohair@494 | 354 | |
kevinw@2224 | 355 | # Lets extract the variables that are set by vcvarsall.bat/vsvars32.bat/vsvars64.bat |
kevinw@2224 | 356 | AC_MSG_NOTICE([Trying to extract Visual Studio environment variables]) |
ohair@494 | 357 | |
kevinw@2224 | 358 | # We need to create a couple of temporary files. |
kevinw@2224 | 359 | VS_ENV_TMP_DIR="$OUTPUT_ROOT/vs-env" |
kevinw@2224 | 360 | $MKDIR -p $VS_ENV_TMP_DIR |
ohair@494 | 361 | |
kevinw@2224 | 362 | # Cannot use the VS10 setup script directly (since it only updates the DOS subshell environment). |
kevinw@2224 | 363 | # Instead create a shell script which will set the relevant variables when run. |
kevinw@2224 | 364 | WINPATH_VS_ENV_CMD="$VS_ENV_CMD" |
kevinw@2224 | 365 | BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH([WINPATH_VS_ENV_CMD]) |
kevinw@2224 | 366 | WINPATH_BASH="$BASH" |
kevinw@2224 | 367 | BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH([WINPATH_BASH]) |
ohair@494 | 368 | |
kevinw@2224 | 369 | # Generate a DOS batch file which runs $VS_ENV_CMD, and then creates a shell |
kevinw@2224 | 370 | # script (executable by bash) that will setup the important variables. |
kevinw@2224 | 371 | EXTRACT_VC_ENV_BAT_FILE="$VS_ENV_TMP_DIR/extract-vs-env.bat" |
kevinw@2224 | 372 | $ECHO "@echo off" > $EXTRACT_VC_ENV_BAT_FILE |
kevinw@2224 | 373 | # This will end up something like: |
kevinw@2224 | 374 | # call C:/progra~2/micros~2.0/vc/bin/amd64/vcvars64.bat |
kevinw@2224 | 375 | $ECHO "call $WINPATH_VS_ENV_CMD $VS_ENV_ARGS" >> $EXTRACT_VC_ENV_BAT_FILE |
kevinw@2228 | 376 | # In some cases, the VS_ENV_CMD will change directory, change back so |
kevinw@2228 | 377 | # the set-vs-env.sh ends up in the right place. |
kevinw@2228 | 378 | $ECHO 'cd %~dp0' >> $EXTRACT_VC_ENV_BAT_FILE |
kevinw@2224 | 379 | # These will end up something like: |
kevinw@2224 | 380 | # C:/CygWin/bin/bash -c 'echo VS_PATH=\"$PATH\" > localdevenv.sh |
kevinw@2224 | 381 | # The trailing space for everyone except PATH is no typo, but is needed due |
kevinw@2224 | 382 | # to trailing \ in the Windows paths. These will be stripped later. |
kevinw@2224 | 383 | $ECHO "$WINPATH_BASH -c 'echo VS_PATH="'\"$PATH\" > set-vs-env.sh' \ |
kevinw@2224 | 384 | >> $EXTRACT_VC_ENV_BAT_FILE |
kevinw@2224 | 385 | $ECHO "$WINPATH_BASH -c 'echo VS_INCLUDE="'\"$INCLUDE \" >> set-vs-env.sh' \ |
kevinw@2224 | 386 | >> $EXTRACT_VC_ENV_BAT_FILE |
kevinw@2224 | 387 | $ECHO "$WINPATH_BASH -c 'echo VS_LIB="'\"$LIB \" >> set-vs-env.sh' \ |
kevinw@2224 | 388 | >> $EXTRACT_VC_ENV_BAT_FILE |
kevinw@2224 | 389 | $ECHO "$WINPATH_BASH -c 'echo VCINSTALLDIR="'\"$VCINSTALLDIR \" >> set-vs-env.sh' \ |
kevinw@2224 | 390 | >> $EXTRACT_VC_ENV_BAT_FILE |
kevinw@2224 | 391 | $ECHO "$WINPATH_BASH -c 'echo WindowsSdkDir="'\"$WindowsSdkDir \" >> set-vs-env.sh' \ |
kevinw@2224 | 392 | >> $EXTRACT_VC_ENV_BAT_FILE |
kevinw@2224 | 393 | $ECHO "$WINPATH_BASH -c 'echo WINDOWSSDKDIR="'\"$WINDOWSSDKDIR \" >> set-vs-env.sh' \ |
kevinw@2224 | 394 | >> $EXTRACT_VC_ENV_BAT_FILE |
ohair@494 | 395 | |
kevinw@2224 | 396 | # Now execute the newly created bat file. |
kevinw@2224 | 397 | # The | cat is to stop SetEnv.Cmd to mess with system colors on msys. |
kevinw@2224 | 398 | # Change directory so we don't need to mess with Windows paths in redirects. |
kevinw@2224 | 399 | cd $VS_ENV_TMP_DIR |
kevinw@2224 | 400 | cmd /c extract-vs-env.bat | $CAT |
kevinw@2224 | 401 | cd $CURDIR |
ohair@494 | 402 | |
kevinw@2224 | 403 | if test ! -s $VS_ENV_TMP_DIR/set-vs-env.sh; then |
kevinw@2224 | 404 | AC_MSG_NOTICE([Could not succesfully extract the envionment variables needed for the VS setup.]) |
kevinw@2224 | 405 | AC_MSG_NOTICE([Try setting --with-tools-dir to the VC/bin directory within the VS installation]) |
kevinw@2224 | 406 | AC_MSG_NOTICE([or run "bash.exe -l" from a VS command prompt and then run configure from there.]) |
kevinw@2224 | 407 | AC_MSG_ERROR([Cannot continue]) |
kevinw@2224 | 408 | fi |
kevinw@2224 | 409 | |
kevinw@2224 | 410 | # Now set all paths and other env variables. This will allow the rest of |
kevinw@2224 | 411 | # the configure script to find and run the compiler in the proper way. |
kevinw@2224 | 412 | AC_MSG_NOTICE([Setting extracted environment variables]) |
kevinw@2224 | 413 | . $VS_ENV_TMP_DIR/set-vs-env.sh |
kevinw@2224 | 414 | # Now we have VS_PATH, VS_INCLUDE, VS_LIB. For further checking, we |
kevinw@2224 | 415 | # also define VCINSTALLDIR, WindowsSdkDir and WINDOWSSDKDIR. |
kevinw@2224 | 416 | else |
kevinw@2224 | 417 | # We did not find a vsvars bat file, let's hope we are run from a VS command prompt. |
kevinw@2224 | 418 | AC_MSG_NOTICE([Cannot locate a valid Visual Studio installation, checking current environment]) |
ohair@494 | 419 | fi |
ohair@494 | 420 | fi |
ohair@494 | 421 | |
kevinw@2208 | 422 | # At this point, we should have correct variables in the environment, or we can't continue. |
ohair@494 | 423 | AC_MSG_CHECKING([for Visual Studio variables]) |
ihse@839 | 424 | |
kevinw@2224 | 425 | if test "x$VCINSTALLDIR" != x || test "x$WindowsSDKDir" != x \ |
kevinw@2224 | 426 | || test "x$WINDOWSSDKDIR" != x || test "x$DEVKIT_NAME" != x; then |
kevinw@2208 | 427 | if test "x$VS_INCLUDE" = x || test "x$VS_LIB" = x; then |
ohair@494 | 428 | AC_MSG_RESULT([present but broken]) |
ohair@494 | 429 | AC_MSG_ERROR([Your VC command prompt seems broken, INCLUDE and/or LIB is missing.]) |
ohair@494 | 430 | else |
ohair@494 | 431 | AC_MSG_RESULT([ok]) |
kevinw@2208 | 432 | # Remove any trailing "\" and " " from the variables. |
kevinw@2208 | 433 | VS_INCLUDE=`$ECHO "$VS_INCLUDE" | $SED 's/\\\\* *$//'` |
kevinw@2208 | 434 | VS_LIB=`$ECHO "$VS_LIB" | $SED 's/\\\\* *$//'` |
kevinw@2208 | 435 | VCINSTALLDIR=`$ECHO "$VCINSTALLDIR" | $SED 's/\\\\* *$//'` |
kevinw@2208 | 436 | WindowsSDKDir=`$ECHO "$WindowsSDKDir" | $SED 's/\\\\* *$//'` |
kevinw@2208 | 437 | WINDOWSSDKDIR=`$ECHO "$WINDOWSSDKDIR" | $SED 's/\\\\* *$//'` |
kevinw@2209 | 438 | # Remove any paths containing # (typically F#) as that messes up make. This |
kevinw@2209 | 439 | # is needed if visual studio was installed with F# support. |
kevinw@2209 | 440 | VS_PATH=`$ECHO "$VS_PATH" | $SED 's/[[^:#]]*#[^:]*://g'` |
kevinw@2208 | 441 | |
kevinw@2208 | 442 | AC_SUBST(VS_PATH) |
ohair@494 | 443 | AC_SUBST(VS_INCLUDE) |
ohair@494 | 444 | AC_SUBST(VS_LIB) |
ohair@494 | 445 | fi |
ohair@494 | 446 | else |
ohair@494 | 447 | AC_MSG_RESULT([not found]) |
ohair@494 | 448 | |
ohair@494 | 449 | if test "x$VS_ENV_CMD" = x; then |
ohair@494 | 450 | AC_MSG_NOTICE([Cannot locate a valid Visual Studio or Windows SDK installation on disk,]) |
ohair@494 | 451 | AC_MSG_NOTICE([nor is this script run from a Visual Studio command prompt.]) |
ohair@494 | 452 | else |
ohair@494 | 453 | AC_MSG_NOTICE([Running the extraction script failed.]) |
ohair@494 | 454 | fi |
ohair@494 | 455 | AC_MSG_NOTICE([Try setting --with-tools-dir to the VC/bin directory within the VS installation]) |
ohair@494 | 456 | AC_MSG_NOTICE([or run "bash.exe -l" from a VS command prompt and then run configure from there.]) |
ohair@494 | 457 | AC_MSG_ERROR([Cannot continue]) |
ohair@494 | 458 | fi |
ihse@857 | 459 | ]) |
ihse@839 | 460 | |
kevinw@2223 | 461 | AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL], |
ihse@857 | 462 | [ |
kevinw@2223 | 463 | DLL_NAME="$1" |
kevinw@2223 | 464 | POSSIBLE_MSVC_DLL="$2" |
kevinw@2223 | 465 | METHOD="$3" |
kevinw@2223 | 466 | if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then |
kevinw@2224 | 467 | AC_MSG_NOTICE([Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD]) |
kevinw@2223 | 468 | |
ihse@857 | 469 | # Need to check if the found msvcr is correct architecture |
kevinw@2224 | 470 | AC_MSG_CHECKING([found $DLL_NAME architecture]) |
kevinw@2223 | 471 | MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"` |
kevinw@2219 | 472 | if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then |
kevinw@2219 | 473 | # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit" |
kevinw@2219 | 474 | # on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems. |
kevinw@2219 | 475 | if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then |
kevinw@2219 | 476 | CORRECT_MSVCR_ARCH="PE32 executable" |
kevinw@2219 | 477 | else |
kevinw@2219 | 478 | CORRECT_MSVCR_ARCH="PE32+ executable" |
kevinw@2219 | 479 | fi |
ihse@857 | 480 | else |
kevinw@2219 | 481 | if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then |
kevinw@2219 | 482 | CORRECT_MSVCR_ARCH=386 |
kevinw@2219 | 483 | else |
kevinw@2219 | 484 | CORRECT_MSVCR_ARCH=x86-64 |
kevinw@2219 | 485 | fi |
ihse@857 | 486 | fi |
kevinw@2223 | 487 | if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then |
ihse@857 | 488 | AC_MSG_RESULT([ok]) |
kevinw@2223 | 489 | MSVC_DLL="$POSSIBLE_MSVC_DLL" |
kevinw@2224 | 490 | BASIC_FIXUP_PATH(MSVC_DLL) |
kevinw@2224 | 491 | AC_MSG_CHECKING([for $DLL_NAME]) |
kevinw@2223 | 492 | AC_MSG_RESULT([$MSVC_DLL]) |
ihse@857 | 493 | else |
ihse@857 | 494 | AC_MSG_RESULT([incorrect, ignoring]) |
kevinw@2224 | 495 | AC_MSG_NOTICE([The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE]) |
ihse@857 | 496 | fi |
ihse@857 | 497 | fi |
ihse@857 | 498 | ]) |
ihse@857 | 499 | |
kevinw@2223 | 500 | AC_DEFUN([TOOLCHAIN_SETUP_MSVC_DLL], |
ihse@857 | 501 | [ |
kevinw@2224 | 502 | DLL_NAME="$1" |
kevinw@2223 | 503 | MSVC_DLL= |
ihse@857 | 504 | |
kevinw@2223 | 505 | if test "x$MSVC_DLL" = x; then |
ohair@494 | 506 | if test "x$VCINSTALLDIR" != x; then |
ihse@857 | 507 | CYGWIN_VC_INSTALL_DIR="$VCINSTALLDIR" |
ihse@857 | 508 | BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(CYGWIN_VC_INSTALL_DIR) |
kevinw@2228 | 509 | if test "$VS_VERSION" -lt 2017; then |
kevinw@2228 | 510 | # Probe: Using well-known location from Visual Studio 12.0 and older |
kevinw@2228 | 511 | if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then |
kevinw@2228 | 512 | POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x64/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME" |
kevinw@2228 | 513 | else |
kevinw@2228 | 514 | POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x86/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME" |
kevinw@2228 | 515 | fi |
ohair@494 | 516 | else |
kevinw@2228 | 517 | # Probe: Using well-known location from VS 2017 |
kevinw@2228 | 518 | if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then |
kevinw@2228 | 519 | POSSIBLE_MSVC_DLL="`ls $CYGWIN_VC_INSTALL_DIR/Redist/MSVC/*/x64/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME`" |
kevinw@2228 | 520 | else |
kevinw@2228 | 521 | POSSIBLE_MSVC_DLL="`ls $CYGWIN_VC_INSTALL_DIR/Redist/MSVC/*/x86/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME`" |
kevinw@2228 | 522 | fi |
ihse@857 | 523 | fi |
kevinw@2228 | 524 | # In case any of the above finds more than one file, loop over them. |
kevinw@2228 | 525 | for possible_msvc_dll in $POSSIBLE_MSVC_DLL; do |
kevinw@2228 | 526 | $ECHO "POSSIBLE_MSVC_DLL $possible_msvc_dll" |
kevinw@2228 | 527 | TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL([$DLL_NAME], [$possible_msvc_dll], |
kevinw@2223 | 528 | [well-known location in VCINSTALLDIR]) |
kevinw@2228 | 529 | done |
ihse@857 | 530 | fi |
ihse@857 | 531 | fi |
ihse@857 | 532 | |
kevinw@2223 | 533 | if test "x$MSVC_DLL" = x; then |
ihse@857 | 534 | # Probe: Check in the Boot JDK directory. |
kevinw@2223 | 535 | POSSIBLE_MSVC_DLL="$BOOT_JDK/bin/$DLL_NAME" |
kevinw@2223 | 536 | TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL($[DLL_NAME], [$POSSIBLE_MSVC_DLL], |
kevinw@2223 | 537 | [well-known location in Boot JDK]) |
ihse@857 | 538 | fi |
ihse@857 | 539 | |
kevinw@2223 | 540 | if test "x$MSVC_DLL" = x; then |
ihse@857 | 541 | # Probe: Look in the Windows system32 directory |
ihse@857 | 542 | CYGWIN_SYSTEMROOT="$SYSTEMROOT" |
ihse@857 | 543 | BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(CYGWIN_SYSTEMROOT) |
kevinw@2223 | 544 | POSSIBLE_MSVC_DLL="$CYGWIN_SYSTEMROOT/system32/$DLL_NAME" |
kevinw@2223 | 545 | TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL([$DLL_NAME], [$POSSIBLE_MSVC_DLL], |
kevinw@2223 | 546 | [well-known location in SYSTEMROOT]) |
ihse@857 | 547 | fi |
ihse@857 | 548 | |
kevinw@2223 | 549 | if test "x$MSVC_DLL" = x; then |
ihse@857 | 550 | # Probe: If Visual Studio Express is installed, there is usually one with the debugger |
ihse@857 | 551 | if test "x$VS100COMNTOOLS" != x; then |
ihse@857 | 552 | CYGWIN_VS_TOOLS_DIR="$VS100COMNTOOLS/.." |
ihse@857 | 553 | BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(CYGWIN_VS_TOOLS_DIR) |
ihse@857 | 554 | if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then |
kevinw@2223 | 555 | POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name $DLL_NAME \ |
kevinw@2223 | 556 | | $GREP -i /x64/ | $HEAD --lines 1` |
ihse@857 | 557 | else |
kevinw@2223 | 558 | POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name $DLL_NAME \ |
kevinw@2223 | 559 | | $GREP -i /x86/ | $HEAD --lines 1` |
ihse@857 | 560 | fi |
kevinw@2223 | 561 | TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL([$DLL_NAME], [$POSSIBLE_MSVC_DLL], |
kevinw@2223 | 562 | [search of VS100COMNTOOLS]) |
ihse@857 | 563 | fi |
ihse@857 | 564 | fi |
ihse@857 | 565 | |
kevinw@2223 | 566 | if test "x$MSVC_DLL" = x; then |
ihse@857 | 567 | # Probe: Search wildly in the VCINSTALLDIR. We've probably lost by now. |
kevinw@2223 | 568 | # (This was the original behaviour; kept since it might turn something up) |
ihse@857 | 569 | if test "x$CYGWIN_VC_INSTALL_DIR" != x; then |
ihse@857 | 570 | if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then |
kevinw@2223 | 571 | POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name $DLL_NAME \ |
kevinw@2223 | 572 | | $GREP x64 | $HEAD --lines 1` |
ihse@857 | 573 | else |
kevinw@2223 | 574 | POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name $DLL_NAME \ |
kevinw@2223 | 575 | | $GREP x86 | $GREP -v ia64 | $GREP -v x64 | $HEAD --lines 1` |
kevinw@2223 | 576 | if test "x$POSSIBLE_MSVC_DLL" = x; then |
ihse@857 | 577 | # We're grasping at straws now... |
kevinw@2223 | 578 | POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name $DLL_NAME \ |
kevinw@2223 | 579 | | $HEAD --lines 1` |
ohair@494 | 580 | fi |
ohair@494 | 581 | fi |
ihse@857 | 582 | |
kevinw@2223 | 583 | TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL([$DLL_NAME], [$POSSIBLE_MSVC_DLL], |
kevinw@2223 | 584 | [search of VCINSTALLDIR]) |
ohair@494 | 585 | fi |
ohair@494 | 586 | fi |
ihse@857 | 587 | |
kevinw@2223 | 588 | if test "x$MSVC_DLL" = x; then |
kevinw@2223 | 589 | AC_MSG_CHECKING([for $DLL_NAME]) |
ohair@494 | 590 | AC_MSG_RESULT([no]) |
kevinw@2223 | 591 | AC_MSG_ERROR([Could not find $DLL_NAME. Please specify using --with-msvcr-dll.]) |
ohair@494 | 592 | fi |
ohair@494 | 593 | ]) |
kevinw@2223 | 594 | |
kevinw@2223 | 595 | AC_DEFUN([TOOLCHAIN_SETUP_VS_RUNTIME_DLLS], |
kevinw@2223 | 596 | [ |
kevinw@2223 | 597 | AC_ARG_WITH(msvcr-dll, [AS_HELP_STRING([--with-msvcr-dll], |
kevinw@2223 | 598 | [path to microsoft C runtime dll (msvcr*.dll) (Windows only) @<:@probed@:>@])]) |
kevinw@2223 | 599 | |
kevinw@2223 | 600 | if test "x$with_msvcr_dll" != x; then |
kevinw@2223 | 601 | # If given explicitely by user, do not probe. If not present, fail directly. |
kevinw@2224 | 602 | TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL($MSVCR_NAME, [$with_msvcr_dll], [--with-msvcr-dll]) |
kevinw@2223 | 603 | if test "x$MSVC_DLL" = x; then |
kevinw@2223 | 604 | AC_MSG_ERROR([Could not find a proper $MSVCR_NAME as specified by --with-msvcr-dll]) |
kevinw@2223 | 605 | fi |
kevinw@2224 | 606 | MSVCR_DLL="$MSVC_DLL" |
kevinw@2224 | 607 | elif test "x$DEVKIT_MSVCR_DLL" != x; then |
kevinw@2224 | 608 | TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL($MSVCR_NAME, [$DEVKIT_MSVCR_DLL], [devkit]) |
kevinw@2224 | 609 | if test "x$MSVC_DLL" = x; then |
kevinw@2224 | 610 | AC_MSG_ERROR([Could not find a proper $MSVCR_NAME as specified by devkit]) |
kevinw@2224 | 611 | fi |
kevinw@2224 | 612 | MSVCR_DLL="$MSVC_DLL" |
kevinw@2223 | 613 | else |
kevinw@2224 | 614 | TOOLCHAIN_SETUP_MSVC_DLL([${MSVCR_NAME}]) |
kevinw@2224 | 615 | MSVCR_DLL="$MSVC_DLL" |
kevinw@2223 | 616 | fi |
kevinw@2224 | 617 | AC_SUBST(MSVCR_DLL) |
kevinw@2223 | 618 | |
kevinw@2223 | 619 | AC_ARG_WITH(msvcp-dll, [AS_HELP_STRING([--with-msvcp-dll], |
kevinw@2223 | 620 | [path to microsoft C++ runtime dll (msvcp*.dll) (Windows only) @<:@probed@:>@])]) |
kevinw@2223 | 621 | |
kevinw@2223 | 622 | if test "x$MSVCP_NAME" != "x"; then |
kevinw@2223 | 623 | if test "x$with_msvcp_dll" != x; then |
kevinw@2223 | 624 | # If given explicitely by user, do not probe. If not present, fail directly. |
kevinw@2224 | 625 | TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL($MSVCP_NAME, [$with_msvcp_dll], [--with-msvcp-dll]) |
kevinw@2223 | 626 | if test "x$MSVC_DLL" = x; then |
kevinw@2223 | 627 | AC_MSG_ERROR([Could not find a proper $MSVCP_NAME as specified by --with-msvcp-dll]) |
kevinw@2223 | 628 | fi |
kevinw@2224 | 629 | MSVCP_DLL="$MSVC_DLL" |
kevinw@2224 | 630 | elif test "x$DEVKIT_MSVCP_DLL" != x; then |
kevinw@2224 | 631 | TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL($MSVCP_NAME, [$DEVKIT_MSVCP_DLL], [devkit]) |
kevinw@2224 | 632 | if test "x$MSVC_DLL" = x; then |
kevinw@2224 | 633 | AC_MSG_ERROR([Could not find a proper $MSVCP_NAME as specified by devkit]) |
kevinw@2224 | 634 | fi |
kevinw@2224 | 635 | MSVCP_DLL="$MSVC_DLL" |
kevinw@2223 | 636 | else |
kevinw@2224 | 637 | TOOLCHAIN_SETUP_MSVC_DLL([${MSVCP_NAME}]) |
kevinw@2224 | 638 | MSVCP_DLL="$MSVC_DLL" |
kevinw@2223 | 639 | fi |
kevinw@2224 | 640 | AC_SUBST(MSVCP_DLL) |
kevinw@2223 | 641 | fi |
kevinw@2223 | 642 | ]) |
kevinw@2223 | 643 |