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