author | herrick |
Thu, 28 Mar 2019 13:49:38 -0400 | |
branch | JDK-8200758-branch |
changeset 57292 | 7a683c461b80 |
parent 54265 | 1b0163c877c0 |
child 54455 | 542735f2a53e |
permissions | -rw-r--r-- |
14111 | 1 |
# |
52804
28094715ae71
8214718: Update missing copyright year in build system
ihse
parents:
50639
diff
changeset
|
2 |
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. |
14111 | 3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
# |
|
5 |
# This code is free software; you can redistribute it and/or modify it |
|
6 |
# under the terms of the GNU General Public License version 2 only, as |
|
7 |
# published by the Free Software Foundation. Oracle designates this |
|
8 |
# particular file as subject to the "Classpath" exception as provided |
|
9 |
# by Oracle in the LICENSE file that accompanied this code. |
|
10 |
# |
|
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
# accompanied this code). |
|
16 |
# |
|
17 |
# You should have received a copy of the GNU General Public License version |
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
# |
|
21 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
22 |
# or visit www.oracle.com if you need additional information or have any |
|
23 |
# questions. |
|
24 |
# |
|
25 |
||
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
26 |
################################################################################ |
29643
89e91c724316
8076531: Switch default compiler on Windows to VS2013
erikj
parents:
29065
diff
changeset
|
27 |
# The order of these defines the priority by which we try to find them. |
50273
737a17045ffe
8203795: Change default compiler on Windows to VS2017
erikj
parents:
50073
diff
changeset
|
28 |
VALID_VS_VERSIONS="2017 2013 2015 2012 2010" |
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
29 |
|
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
30 |
VS_DESCRIPTION_2010="Microsoft Visual Studio 2010" |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
31 |
VS_VERSION_INTERNAL_2010=100 |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
32 |
VS_MSVCR_2010=msvcr100.dll |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
33 |
# We don't use msvcp on Visual Studio 2010 |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
34 |
#VS_MSVCP_2010=msvcp100.dll |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
35 |
VS_ENVVAR_2010="VS100COMNTOOLS" |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
36 |
VS_VS_INSTALLDIR_2010="Microsoft Visual Studio 10.0" |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
37 |
VS_SDK_INSTALLDIR_2010="Microsoft SDKs/Windows/v7.1" |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
38 |
VS_VS_PLATFORM_NAME_2010="v100" |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
39 |
VS_SDK_PLATFORM_NAME_2010="Windows7.1SDK" |
50639
c12c79a49ca2
8205183: Warning about using VS2017 should be removed
erikj
parents:
50273
diff
changeset
|
40 |
VS_SUPPORTED_2010=false |
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
41 |
|
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
42 |
VS_DESCRIPTION_2012="Microsoft Visual Studio 2012" |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
43 |
VS_VERSION_INTERNAL_2012=110 |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
44 |
VS_MSVCR_2012=msvcr110.dll |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
45 |
VS_MSVCP_2012=msvcp110.dll |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
46 |
VS_ENVVAR_2012="VS110COMNTOOLS" |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
47 |
VS_VS_INSTALLDIR_2012="Microsoft Visual Studio 11.0" |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
48 |
VS_SDK_INSTALLDIR_2012= |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
49 |
VS_VS_PLATFORM_NAME_2012="v110" |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
50 |
VS_SDK_PLATFORM_NAME_2012= |
50639
c12c79a49ca2
8205183: Warning about using VS2017 should be removed
erikj
parents:
50273
diff
changeset
|
51 |
VS_SUPPORTED_2012=false |
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
52 |
|
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
53 |
VS_DESCRIPTION_2013="Microsoft Visual Studio 2013" |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
54 |
VS_VERSION_INTERNAL_2013=120 |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
55 |
VS_MSVCR_2013=msvcr120.dll |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
56 |
VS_MSVCP_2013=msvcp120.dll |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
57 |
VS_ENVVAR_2013="VS120COMNTOOLS" |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
58 |
VS_VS_INSTALLDIR_2013="Microsoft Visual Studio 12.0" |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
59 |
VS_SDK_INSTALLDIR_2013= |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
60 |
VS_VS_PLATFORM_NAME_2013="v120" |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
61 |
VS_SDK_PLATFORM_NAME_2013= |
50639
c12c79a49ca2
8205183: Warning about using VS2017 should be removed
erikj
parents:
50273
diff
changeset
|
62 |
VS_SUPPORTED_2013=false |
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
63 |
|
50273
737a17045ffe
8203795: Change default compiler on Windows to VS2017
erikj
parents:
50073
diff
changeset
|
64 |
VS_DESCRIPTION_2015="Microsoft Visual Studio 2015" |
48678 | 65 |
VS_VERSION_INTERNAL_2015=140 |
66 |
VS_MSVCR_2015=vcruntime140.dll |
|
67 |
VS_MSVCP_2015=msvcp140.dll |
|
68 |
VS_ENVVAR_2015="VS140COMNTOOLS" |
|
69 |
VS_VS_INSTALLDIR_2015="Microsoft Visual Studio 14.0" |
|
70 |
VS_SDK_INSTALLDIR_2015= |
|
71 |
VS_VS_PLATFORM_NAME_2015="v140" |
|
72 |
VS_SDK_PLATFORM_NAME_2015= |
|
73 |
# The vcvars of 2015 breaks if 2017 is also installed. Work around this by |
|
74 |
# explicitly specifying Windows Kit 8.1 to be used. |
|
75 |
VS_ENV_ARGS_2015="8.1" |
|
50639
c12c79a49ca2
8205183: Warning about using VS2017 should be removed
erikj
parents:
50273
diff
changeset
|
76 |
VS_SUPPORTED_2015=false |
48678 | 77 |
|
50273
737a17045ffe
8203795: Change default compiler on Windows to VS2017
erikj
parents:
50073
diff
changeset
|
78 |
VS_DESCRIPTION_2017="Microsoft Visual Studio 2017" |
48678 | 79 |
VS_VERSION_INTERNAL_2017=141 |
80 |
VS_MSVCR_2017=vcruntime140.dll |
|
81 |
VS_MSVCP_2017=msvcp140.dll |
|
82 |
VS_ENVVAR_2017="VS150COMNTOOLS" |
|
50073
35b22ca681d1
8202557: OpenJDK fails to start in Windows 7 and 8.1 after upgrading compiler to VC 2017
erikj
parents:
49566
diff
changeset
|
83 |
VS_USE_UCRT_2017="true" |
48678 | 84 |
VS_VS_INSTALLDIR_2017="Microsoft Visual Studio/2017" |
49208
a9d89773efca
8199473: Support Visual Studio BuildTools with VS2017
erikj
parents:
48678
diff
changeset
|
85 |
VS_EDITIONS_2017="BuildTools Community Professional Enterprise" |
48678 | 86 |
VS_SDK_INSTALLDIR_2017= |
87 |
VS_VS_PLATFORM_NAME_2017="v141" |
|
88 |
VS_SDK_PLATFORM_NAME_2017= |
|
50639
c12c79a49ca2
8205183: Warning about using VS2017 should be removed
erikj
parents:
50273
diff
changeset
|
89 |
VS_SUPPORTED_2017=true |
54265
1b0163c877c0
8220445: Support for side by side MSVC Toolset versions
erikj
parents:
53240
diff
changeset
|
90 |
VS_TOOLSET_SUPPORTED_2017=true |
48678 | 91 |
|
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
92 |
################################################################################ |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
93 |
|
14111 | 94 |
AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT], |
95 |
[ |
|
96 |
if test "x$VS_ENV_CMD" = x; then |
|
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
97 |
VS_VERSION="$1" |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
98 |
VS_BASE="$2" |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
99 |
METHOD="$3" |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
100 |
|
48678 | 101 |
BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(VS_BASE) |
102 |
# In VS 2017, the default installation is in a subdir named after the edition. |
|
103 |
# Find the first one present and use that. |
|
104 |
if test "x$VS_EDITIONS" != x; then |
|
105 |
for edition in $VS_EDITIONS; do |
|
106 |
if test -d "$VS_BASE/$edition"; then |
|
107 |
VS_BASE="$VS_BASE/$edition" |
|
108 |
break |
|
109 |
fi |
|
110 |
done |
|
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
111 |
fi |
29643
89e91c724316
8076531: Switch default compiler on Windows to VS2013
erikj
parents:
29065
diff
changeset
|
112 |
|
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
113 |
if test -d "$VS_BASE"; then |
48678 | 114 |
AC_MSG_NOTICE([Found Visual Studio installation at $VS_BASE using $METHOD]) |
115 |
if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then |
|
116 |
VCVARSFILES="vc/bin/vcvars32.bat vc/auxiliary/build/vcvars32.bat" |
|
117 |
else |
|
118 |
VCVARSFILES="vc/bin/amd64/vcvars64.bat vc/bin/x86_amd64/vcvarsx86_amd64.bat \ |
|
53110 | 119 |
VC/Auxiliary/Build/vcvarsx86_amd64.bat VC/Auxiliary/Build/vcvars64.bat" |
48678 | 120 |
fi |
121 |
||
122 |
for VCVARSFILE in $VCVARSFILES; do |
|
123 |
if test -f "$VS_BASE/$VCVARSFILE"; then |
|
124 |
VS_ENV_CMD="$VS_BASE/$VCVARSFILE" |
|
125 |
break |
|
126 |
fi |
|
127 |
done |
|
128 |
||
129 |
if test "x$VS_ENV_CMD" = x; then |
|
130 |
AC_MSG_NOTICE([Warning: None of $VCVARSFILES were found, Visual Studio installation not recognized. Ignoring]) |
|
131 |
else |
|
132 |
# PLATFORM_TOOLSET is used during the compilation of the freetype sources |
|
133 |
# (see 'LIB_BUILD_FREETYPE' in libraries.m4) and must be one of 'v100', |
|
134 |
# 'v110' or 'v120' for VS 2010, 2012 or VS2013 |
|
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
135 |
eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}" |
14111 | 136 |
fi |
137 |
fi |
|
138 |
fi |
|
139 |
]) |
|
140 |
||
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
141 |
################################################################################ |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
142 |
|
14111 | 143 |
AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT], |
144 |
[ |
|
145 |
if test "x$VS_ENV_CMD" = x; then |
|
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
146 |
VS_VERSION="$1" |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
147 |
WIN_SDK_BASE="$2" |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
148 |
METHOD="$3" |
14111 | 149 |
BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(WIN_SDK_BASE) |
150 |
if test -d "$WIN_SDK_BASE"; then |
|
14565 | 151 |
# There have been cases of partial or broken SDK installations. A missing |
152 |
# lib dir is not going to work. |
|
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
153 |
if test ! -d "$WIN_SDK_BASE/lib"; then |
14565 | 154 |
AC_MSG_NOTICE([Found Windows SDK installation at $WIN_SDK_BASE using $METHOD]) |
155 |
AC_MSG_NOTICE([Warning: Installation is broken, lib dir is missing. Ignoring]) |
|
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
156 |
elif test -f "$WIN_SDK_BASE/Bin/SetEnv.Cmd"; then |
14111 | 157 |
AC_MSG_NOTICE([Found Windows SDK installation at $WIN_SDK_BASE using $METHOD]) |
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
158 |
VS_ENV_CMD="$WIN_SDK_BASE/Bin/SetEnv.Cmd" |
14111 | 159 |
if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then |
160 |
VS_ENV_ARGS="/x86" |
|
161 |
else |
|
162 |
VS_ENV_ARGS="/x64" |
|
163 |
fi |
|
26400
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25882
diff
changeset
|
164 |
# PLATFORM_TOOLSET is used during the compilation of the freetype sources (see |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25882
diff
changeset
|
165 |
# 'LIB_BUILD_FREETYPE' in libraries.m4) and must be 'Windows7.1SDK' for Windows7.1SDK |
4d6c6f2df610
8057538: Build the freetype library during configure on Windows
simonis
parents:
25882
diff
changeset
|
166 |
# TODO: improve detection for other versions of SDK |
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
167 |
eval PLATFORM_TOOLSET="\${VS_SDK_PLATFORM_NAME_${VS_VERSION}}" |
14111 | 168 |
else |
169 |
AC_MSG_NOTICE([Found Windows SDK installation at $WIN_SDK_BASE using $METHOD]) |
|
170 |
AC_MSG_NOTICE([Warning: Installation is broken, SetEnv.Cmd is missing. Ignoring]) |
|
171 |
fi |
|
172 |
fi |
|
173 |
fi |
|
174 |
]) |
|
175 |
||
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
176 |
################################################################################ |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
177 |
# Finds the bat or cmd file in Visual Studio or the SDK that sets up a proper |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
178 |
# build environment and assigns it to VS_ENV_CMD |
14111 | 179 |
AC_DEFUN([TOOLCHAIN_FIND_VISUAL_STUDIO_BAT_FILE], |
180 |
[ |
|
54265
1b0163c877c0
8220445: Support for side by side MSVC Toolset versions
erikj
parents:
53240
diff
changeset
|
181 |
# VS2017 provides the option to install previous minor versions of the MSVC |
1b0163c877c0
8220445: Support for side by side MSVC Toolset versions
erikj
parents:
53240
diff
changeset
|
182 |
# toolsets. It is not possible to directly download earlier minor versions of |
1b0163c877c0
8220445: Support for side by side MSVC Toolset versions
erikj
parents:
53240
diff
changeset
|
183 |
# VS2017 and in order to build with a previous minor compiler toolset version, |
1b0163c877c0
8220445: Support for side by side MSVC Toolset versions
erikj
parents:
53240
diff
changeset
|
184 |
# it is now possible to compile with earlier minor versions by passing |
1b0163c877c0
8220445: Support for side by side MSVC Toolset versions
erikj
parents:
53240
diff
changeset
|
185 |
# -vcvars_ver=<toolset_version> argument to vcvarsall.bat. |
1b0163c877c0
8220445: Support for side by side MSVC Toolset versions
erikj
parents:
53240
diff
changeset
|
186 |
AC_ARG_WITH(msvc-toolset-version, [AS_HELP_STRING([--with-msvc-toolset-version], |
1b0163c877c0
8220445: Support for side by side MSVC Toolset versions
erikj
parents:
53240
diff
changeset
|
187 |
[specific MSVC toolset version to use, passed as -vcvars_ver argument to |
1b0163c877c0
8220445: Support for side by side MSVC Toolset versions
erikj
parents:
53240
diff
changeset
|
188 |
pass to vcvarsall.bat (Windows only)])]) |
1b0163c877c0
8220445: Support for side by side MSVC Toolset versions
erikj
parents:
53240
diff
changeset
|
189 |
|
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
190 |
VS_VERSION="$1" |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
191 |
eval VS_COMNTOOLS_VAR="\${VS_ENVVAR_${VS_VERSION}}" |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
192 |
eval VS_COMNTOOLS="\$${VS_COMNTOOLS_VAR}" |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
193 |
eval VS_INSTALL_DIR="\${VS_VS_INSTALLDIR_${VS_VERSION}}" |
48678 | 194 |
eval VS_EDITIONS="\${VS_EDITIONS_${VS_VERSION}}" |
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
195 |
eval SDK_INSTALL_DIR="\${VS_SDK_INSTALLDIR_${VS_VERSION}}" |
48678 | 196 |
eval VS_ENV_ARGS="\${VS_ENV_ARGS_${VS_VERSION}}" |
54265
1b0163c877c0
8220445: Support for side by side MSVC Toolset versions
erikj
parents:
53240
diff
changeset
|
197 |
eval VS_TOOLSET_SUPPORTED="\${VS_TOOLSET_SUPPORTED_${VS_VERSION}}" |
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
198 |
|
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
199 |
# When using --with-tools-dir, assume it points to the correct and default |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
200 |
# version of Visual Studio or that --with-toolchain-version was also set. |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
201 |
if test "x$with_tools_dir" != x; then |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
202 |
TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([${VS_VERSION}], |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
203 |
[$with_tools_dir/../..], [--with-tools-dir]) |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
204 |
TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([${VS_VERSION}], |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
205 |
[$with_tools_dir/../../..], [--with-tools-dir]) |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
206 |
if test "x$VS_ENV_CMD" = x; then |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
207 |
# Having specified an argument which is incorrect will produce an instant failure; |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
208 |
# we should not go on looking |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
209 |
AC_MSG_NOTICE([The path given by --with-tools-dir does not contain a valid]) |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
210 |
AC_MSG_NOTICE([Visual Studio installation. Please point to the VC/bin or VC/bin/amd64]) |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
211 |
AC_MSG_NOTICE([directory within the Visual Studio installation]) |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
212 |
AC_MSG_ERROR([Cannot locate a valid Visual Studio installation]) |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
213 |
fi |
20363 | 214 |
fi |
14111 | 215 |
|
216 |
VS_ENV_CMD="" |
|
217 |
||
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
218 |
if test "x$VS_COMNTOOLS" != x; then |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
219 |
TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([${VS_VERSION}], |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
220 |
[$VS_COMNTOOLS/../..], [$VS_COMNTOOLS_VAR variable]) |
17818
cfaa38a17d56
8008707: build-infra: Closed (deploy) can't be built using environment from SDK SetEnv.cmd
erikj
parents:
15844
diff
changeset
|
221 |
fi |
cfaa38a17d56
8008707: build-infra: Closed (deploy) can't be built using environment from SDK SetEnv.cmd
erikj
parents:
15844
diff
changeset
|
222 |
if test "x$PROGRAMFILES" != x; then |
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
223 |
TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([${VS_VERSION}], |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
224 |
[$PROGRAMFILES/$VS_INSTALL_DIR], [well-known name]) |
17818
cfaa38a17d56
8008707: build-infra: Closed (deploy) can't be built using environment from SDK SetEnv.cmd
erikj
parents:
15844
diff
changeset
|
225 |
fi |
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
226 |
# Work around the insanely named ProgramFiles(x86) env variable |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
227 |
PROGRAMFILES_X86="`env | $SED -n 's/^ProgramFiles(x86)=//p'`" |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
228 |
if test "x$PROGRAMFILES_X86" != x; then |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
229 |
TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([${VS_VERSION}], |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
230 |
[$PROGRAMFILES_X86/$VS_INSTALL_DIR], [well-known name]) |
14111 | 231 |
fi |
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
232 |
TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([${VS_VERSION}], |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
233 |
[C:/Program Files/$VS_INSTALL_DIR], [well-known name]) |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
234 |
TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([${VS_VERSION}], |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
235 |
[C:/Program Files (x86)/$VS_INSTALL_DIR], [well-known name]) |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
236 |
if test "x$SDK_INSTALL_DIR" != x; then |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
237 |
if test "x$ProgramW6432" != x; then |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
238 |
TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([${VS_VERSION}], |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
239 |
[$ProgramW6432/$SDK_INSTALL_DIR], [well-known name]) |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
240 |
fi |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
241 |
if test "x$PROGRAMW6432" != x; then |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
242 |
TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([${VS_VERSION}], |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
243 |
[$PROGRAMW6432/$SDK_INSTALL_DIR], [well-known name]) |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
244 |
fi |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
245 |
if test "x$PROGRAMFILES" != x; then |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
246 |
TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([${VS_VERSION}], |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
247 |
[$PROGRAMFILES/$SDK_INSTALL_DIR], [well-known name]) |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
248 |
fi |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
249 |
TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([${VS_VERSION}], |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
250 |
[C:/Program Files/$SDK_INSTALL_DIR], [well-known name]) |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
251 |
TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([${VS_VERSION}], |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
252 |
[C:/Program Files (x86)/$SDK_INSTALL_DIR], [well-known name]) |
14111 | 253 |
fi |
54265
1b0163c877c0
8220445: Support for side by side MSVC Toolset versions
erikj
parents:
53240
diff
changeset
|
254 |
|
1b0163c877c0
8220445: Support for side by side MSVC Toolset versions
erikj
parents:
53240
diff
changeset
|
255 |
if test "x$VS_TOOLSET_SUPPORTED" != x; then |
1b0163c877c0
8220445: Support for side by side MSVC Toolset versions
erikj
parents:
53240
diff
changeset
|
256 |
if test "x$with_msvc_toolset_version" != x; then |
1b0163c877c0
8220445: Support for side by side MSVC Toolset versions
erikj
parents:
53240
diff
changeset
|
257 |
VS_ENV_ARGS="$VS_ENV_ARGS -vcvars_ver=$with_msvc_toolset_version" |
1b0163c877c0
8220445: Support for side by side MSVC Toolset versions
erikj
parents:
53240
diff
changeset
|
258 |
fi |
1b0163c877c0
8220445: Support for side by side MSVC Toolset versions
erikj
parents:
53240
diff
changeset
|
259 |
fi |
14111 | 260 |
]) |
261 |
||
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
262 |
################################################################################ |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
263 |
|
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
264 |
AC_DEFUN([TOOLCHAIN_FIND_VISUAL_STUDIO], |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
265 |
[ |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
266 |
AC_ARG_WITH(toolchain-version, [AS_HELP_STRING([--with-toolchain-version], |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
267 |
[the version of the toolchain to look for, use '--help' to show possible values @<:@platform dependent@:>@])]) |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
268 |
|
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
269 |
if test "x$with_toolchain_version" = xlist; then |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
270 |
# List all toolchains |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
271 |
AC_MSG_NOTICE([The following toolchain versions are valid on this platform:]) |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
272 |
for version in $VALID_VS_VERSIONS; do |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
273 |
eval VS_DESCRIPTION=\${VS_DESCRIPTION_$version} |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
274 |
$PRINTF " %-10s %s\n" $version "$VS_DESCRIPTION" |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
275 |
done |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
276 |
|
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
277 |
exit 0 |
30022 | 278 |
elif test "x$DEVKIT_VS_VERSION" != x; then |
279 |
VS_VERSION=$DEVKIT_VS_VERSION |
|
280 |
TOOLCHAIN_VERSION=$VS_VERSION |
|
48678 | 281 |
# If the devkit has a name, use that as description |
282 |
VS_DESCRIPTION="$DEVKIT_NAME" |
|
283 |
if test "x$VS_DESCRIPTION" = x; then |
|
284 |
eval VS_DESCRIPTION="\${VS_DESCRIPTION_${VS_VERSION}}" |
|
285 |
fi |
|
30022 | 286 |
eval VS_VERSION_INTERNAL="\${VS_VERSION_INTERNAL_${VS_VERSION}}" |
287 |
eval MSVCR_NAME="\${VS_MSVCR_${VS_VERSION}}" |
|
288 |
eval MSVCP_NAME="\${VS_MSVCP_${VS_VERSION}}" |
|
50073
35b22ca681d1
8202557: OpenJDK fails to start in Windows 7 and 8.1 after upgrading compiler to VC 2017
erikj
parents:
49566
diff
changeset
|
289 |
eval USE_UCRT="\${VS_USE_UCRT_${VS_VERSION}}" |
50639
c12c79a49ca2
8205183: Warning about using VS2017 should be removed
erikj
parents:
50273
diff
changeset
|
290 |
eval VS_SUPPORTED="\${VS_SUPPORTED_${VS_VERSION}}" |
30022 | 291 |
eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}" |
53240 | 292 |
|
293 |
# The TOOLCHAIN_PATH from a devkit is in Unix format. In WSL we need a |
|
294 |
# windows version of the complete VS_PATH as VS_PATH_WINDOWS |
|
295 |
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.wsl"; then |
|
296 |
# Convert the toolchain path |
|
297 |
OLDIFS="$IFS" |
|
298 |
IFS=":" |
|
299 |
VS_PATH_WINDOWS="" |
|
300 |
for i in $TOOLCHAIN_PATH; do |
|
301 |
path=$i |
|
302 |
BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH([path]) |
|
303 |
VS_PATH_WINDOWS="$VS_PATH_WINDOWS;$path" |
|
304 |
done |
|
305 |
IFS="$OLDIFS" |
|
306 |
# Append the current path from Windows env |
|
307 |
WINDOWS_PATH="`$CMD /c echo %PATH%`" |
|
308 |
VS_PATH_WINDOWS="$VS_PATH_WINDOWS;$WINDOWS_PATH" |
|
309 |
else |
|
310 |
VS_PATH="$TOOLCHAIN_PATH:$PATH" |
|
311 |
fi |
|
30022 | 312 |
|
313 |
# Convert DEVKIT_VS_INCLUDE into windows style VS_INCLUDE so that it |
|
314 |
# can still be exported as INCLUDE for compiler invocations without |
|
315 |
# SYSROOT_CFLAGS |
|
316 |
OLDIFS="$IFS" |
|
317 |
IFS=";" |
|
318 |
for i in $DEVKIT_VS_INCLUDE; do |
|
319 |
ipath=$i |
|
320 |
BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH([ipath]) |
|
321 |
VS_INCLUDE="$VS_INCLUDE;$ipath" |
|
322 |
done |
|
323 |
# Convert DEVKIT_VS_LIB into VS_LIB so that it can still be exported |
|
324 |
# as LIB for compiler invocations without SYSROOT_LDFLAGS |
|
325 |
for i in $DEVKIT_VS_LIB; do |
|
326 |
libpath=$i |
|
327 |
BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH([libpath]) |
|
328 |
VS_LIB="$VS_LIB;$libpath" |
|
329 |
done |
|
330 |
IFS="$OLDIFS" |
|
331 |
||
332 |
AC_MSG_NOTICE([Found devkit $VS_DESCRIPTION]) |
|
333 |
||
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
334 |
elif test "x$with_toolchain_version" != x; then |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
335 |
# User override; check that it is valid |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
336 |
if test "x${VALID_VS_VERSIONS/$with_toolchain_version/}" = "x${VALID_VS_VERSIONS}"; then |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
337 |
AC_MSG_NOTICE([Visual Studio version $with_toolchain_version is not valid.]) |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
338 |
AC_MSG_NOTICE([Valid Visual Studio versions: $VALID_VS_VERSIONS.]) |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
339 |
AC_MSG_ERROR([Cannot continue.]) |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
340 |
fi |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
341 |
VS_VERSIONS_PROBE_LIST="$with_toolchain_version" |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
342 |
else |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
343 |
# No flag given, use default |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
344 |
VS_VERSIONS_PROBE_LIST="$VALID_VS_VERSIONS" |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
345 |
fi |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
346 |
|
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
347 |
for VS_VERSION in $VS_VERSIONS_PROBE_LIST; do |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
348 |
TOOLCHAIN_FIND_VISUAL_STUDIO_BAT_FILE([$VS_VERSION]) |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
349 |
if test "x$VS_ENV_CMD" != x; then |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
350 |
TOOLCHAIN_VERSION=$VS_VERSION |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
351 |
eval VS_DESCRIPTION="\${VS_DESCRIPTION_${VS_VERSION}}" |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
352 |
eval VS_VERSION_INTERNAL="\${VS_VERSION_INTERNAL_${VS_VERSION}}" |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
353 |
eval MSVCR_NAME="\${VS_MSVCR_${VS_VERSION}}" |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
354 |
eval MSVCP_NAME="\${VS_MSVCP_${VS_VERSION}}" |
50073
35b22ca681d1
8202557: OpenJDK fails to start in Windows 7 and 8.1 after upgrading compiler to VC 2017
erikj
parents:
49566
diff
changeset
|
355 |
eval USE_UCRT="\${VS_USE_UCRT_${VS_VERSION}}" |
50639
c12c79a49ca2
8205183: Warning about using VS2017 should be removed
erikj
parents:
50273
diff
changeset
|
356 |
eval VS_SUPPORTED="\${VS_SUPPORTED_${VS_VERSION}}" |
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
357 |
# The rest of the variables are already evaled while probing |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
358 |
AC_MSG_NOTICE([Found $VS_DESCRIPTION]) |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
359 |
break |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
360 |
fi |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
361 |
done |
48678 | 362 |
|
363 |
TOOLCHAIN_DESCRIPTION="$VS_DESCRIPTION" |
|
50639
c12c79a49ca2
8205183: Warning about using VS2017 should be removed
erikj
parents:
50273
diff
changeset
|
364 |
if test "x$VS_SUPPORTED" = "xfalse"; then |
48678 | 365 |
UNSUPPORTED_TOOLCHAIN_VERSION=yes |
366 |
fi |
|
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
367 |
]) |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
368 |
|
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
369 |
################################################################################ |
14111 | 370 |
# Check if the VS env variables were setup prior to running configure. |
371 |
# If not, then find vcvarsall.bat and run it automatically, and integrate |
|
372 |
# the set env variables into the spec file. |
|
373 |
AC_DEFUN([TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV], |
|
374 |
[ |
|
20363 | 375 |
# Store path to cygwin link.exe to help excluding it when searching for |
14111 | 376 |
# VS linker. This must be done before changing the PATH when looking for VS. |
53110 | 377 |
AC_PATH_PROG(CYGWIN_LINK, link.exe) |
14111 | 378 |
if test "x$CYGWIN_LINK" != x; then |
379 |
AC_MSG_CHECKING([if the first found link.exe is actually the Cygwin link tool]) |
|
380 |
"$CYGWIN_LINK" --version > /dev/null |
|
381 |
if test $? -eq 0 ; then |
|
382 |
AC_MSG_RESULT([yes]) |
|
383 |
else |
|
384 |
AC_MSG_RESULT([no]) |
|
385 |
# This might be the VS linker. Don't exclude it later on. |
|
386 |
CYGWIN_LINK="" |
|
387 |
fi |
|
388 |
fi |
|
389 |
||
390 |
# First-hand choice is to locate and run the vsvars bat file. |
|
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
391 |
TOOLCHAIN_FIND_VISUAL_STUDIO |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
392 |
|
30022 | 393 |
# If we have a devkit, skip all of the below. |
394 |
if test "x$DEVKIT_VS_VERSION" = x; then |
|
395 |
if test "x$VS_ENV_CMD" != x; then |
|
396 |
# We have found a Visual Studio environment on disk, let's extract variables from the vsvars bat file. |
|
397 |
BASIC_FIXUP_EXECUTABLE(VS_ENV_CMD) |
|
14111 | 398 |
|
30022 | 399 |
# Lets extract the variables that are set by vcvarsall.bat/vsvars32.bat/vsvars64.bat |
400 |
AC_MSG_NOTICE([Trying to extract Visual Studio environment variables]) |
|
23429 | 401 |
|
30022 | 402 |
# We need to create a couple of temporary files. |
403 |
VS_ENV_TMP_DIR="$CONFIGURESUPPORT_OUTPUTDIR/vs-env" |
|
404 |
$MKDIR -p $VS_ENV_TMP_DIR |
|
14111 | 405 |
|
30022 | 406 |
# Cannot use the VS10 setup script directly (since it only updates the DOS subshell environment). |
407 |
# Instead create a shell script which will set the relevant variables when run. |
|
408 |
WINPATH_VS_ENV_CMD="$VS_ENV_CMD" |
|
409 |
BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH([WINPATH_VS_ENV_CMD]) |
|
53110 | 410 |
|
411 |
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.wsl"; then |
|
412 |
WINPATH_BASH="bash" |
|
413 |
else |
|
414 |
WINPATH_BASH="$BASH" |
|
415 |
BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH([WINPATH_BASH]) |
|
416 |
fi |
|
14111 | 417 |
|
30022 | 418 |
# Generate a DOS batch file which runs $VS_ENV_CMD, and then creates a shell |
419 |
# script (executable by bash) that will setup the important variables. |
|
420 |
EXTRACT_VC_ENV_BAT_FILE="$VS_ENV_TMP_DIR/extract-vs-env.bat" |
|
421 |
$ECHO "@echo off" > $EXTRACT_VC_ENV_BAT_FILE |
|
422 |
# This will end up something like: |
|
423 |
# call C:/progra~2/micros~2.0/vc/bin/amd64/vcvars64.bat |
|
53110 | 424 |
$ECHO "call \"$WINPATH_VS_ENV_CMD\" $VS_ENV_ARGS" >> $EXTRACT_VC_ENV_BAT_FILE |
48678 | 425 |
# In some cases, the VS_ENV_CMD will change directory, change back so |
426 |
# the set-vs-env.sh ends up in the right place. |
|
427 |
$ECHO 'cd %~dp0' >> $EXTRACT_VC_ENV_BAT_FILE |
|
53110 | 428 |
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.wsl"; then |
429 |
# These will end up something like: |
|
430 |
# echo VS_PATH=\"$PATH\" > set-vs-env.sh |
|
431 |
# The trailing space for everyone except PATH is no typo, but is needed due |
|
432 |
# to trailing \ in the Windows paths. These will be stripped later. |
|
433 |
# Trying pure CMD extract. This results in windows paths that need to |
|
434 |
# be converted post extraction, but a simpler script. |
|
435 |
$ECHO 'echo VS_PATH="%PATH%" > set-vs-env.sh' \ |
|
436 |
>> $EXTRACT_VC_ENV_BAT_FILE |
|
437 |
$ECHO 'echo VS_INCLUDE="%INCLUDE% " >> set-vs-env.sh' \ |
|
438 |
>> $EXTRACT_VC_ENV_BAT_FILE |
|
439 |
$ECHO 'echo VS_LIB="%LIB% " >> set-vs-env.sh' \ |
|
440 |
>> $EXTRACT_VC_ENV_BAT_FILE |
|
441 |
$ECHO 'echo VCINSTALLDIR="%VCINSTALLDIR% " >> set-vs-env.sh' \ |
|
442 |
>> $EXTRACT_VC_ENV_BAT_FILE |
|
54265
1b0163c877c0
8220445: Support for side by side MSVC Toolset versions
erikj
parents:
53240
diff
changeset
|
443 |
$ECHO 'echo VCToolsRedistDir="%VCToolsRedistDir% " >> set-vs-env.sh' \ |
1b0163c877c0
8220445: Support for side by side MSVC Toolset versions
erikj
parents:
53240
diff
changeset
|
444 |
>> $EXTRACT_VC_ENV_BAT_FILE |
53110 | 445 |
$ECHO 'echo WindowsSdkDir="%WindowsSdkDir% " >> set-vs-env.sh' \ |
446 |
>> $EXTRACT_VC_ENV_BAT_FILE |
|
447 |
$ECHO 'echo WINDOWSSDKDIR="%WINDOWSSDKDIR% " >> set-vs-env.sh' \ |
|
448 |
>> $EXTRACT_VC_ENV_BAT_FILE |
|
449 |
else |
|
450 |
# These will end up something like: |
|
451 |
# C:/CygWin/bin/bash -c 'echo VS_PATH=\"$PATH\" > localdevenv.sh |
|
452 |
# The trailing space for everyone except PATH is no typo, but is needed due |
|
453 |
# to trailing \ in the Windows paths. These will be stripped later. |
|
454 |
$ECHO "$WINPATH_BASH -c 'echo VS_PATH="'\"$PATH\" > set-vs-env.sh' \ |
|
455 |
>> $EXTRACT_VC_ENV_BAT_FILE |
|
456 |
$ECHO "$WINPATH_BASH -c 'echo VS_INCLUDE="'\"$INCLUDE\;$include \" >> set-vs-env.sh' \ |
|
457 |
>> $EXTRACT_VC_ENV_BAT_FILE |
|
458 |
$ECHO "$WINPATH_BASH -c 'echo VS_LIB="'\"$LIB\;$lib \" >> set-vs-env.sh' \ |
|
459 |
>> $EXTRACT_VC_ENV_BAT_FILE |
|
460 |
$ECHO "$WINPATH_BASH -c 'echo VCINSTALLDIR="'\"$VCINSTALLDIR \" >> set-vs-env.sh' \ |
|
461 |
>> $EXTRACT_VC_ENV_BAT_FILE |
|
54265
1b0163c877c0
8220445: Support for side by side MSVC Toolset versions
erikj
parents:
53240
diff
changeset
|
462 |
$ECHO "$WINPATH_BASH -c 'echo VCToolsRedistDir="'\"$VCToolsRedistDir \" >> set-vs-env.sh' \ |
1b0163c877c0
8220445: Support for side by side MSVC Toolset versions
erikj
parents:
53240
diff
changeset
|
463 |
>> $EXTRACT_VC_ENV_BAT_FILE |
53110 | 464 |
$ECHO "$WINPATH_BASH -c 'echo WindowsSdkDir="'\"$WindowsSdkDir \" >> set-vs-env.sh' \ |
465 |
>> $EXTRACT_VC_ENV_BAT_FILE |
|
466 |
$ECHO "$WINPATH_BASH -c 'echo WINDOWSSDKDIR="'\"$WINDOWSSDKDIR \" >> set-vs-env.sh' \ |
|
467 |
>> $EXTRACT_VC_ENV_BAT_FILE |
|
468 |
fi |
|
14111 | 469 |
|
30022 | 470 |
# Now execute the newly created bat file. |
471 |
# The | cat is to stop SetEnv.Cmd to mess with system colors on msys. |
|
472 |
# Change directory so we don't need to mess with Windows paths in redirects. |
|
473 |
cd $VS_ENV_TMP_DIR |
|
53110 | 474 |
$CMD /c extract-vs-env.bat | $CAT |
30022 | 475 |
cd $CURDIR |
14111 | 476 |
|
30022 | 477 |
if test ! -s $VS_ENV_TMP_DIR/set-vs-env.sh; then |
53110 | 478 |
AC_MSG_NOTICE([Could not succesfully extract the environment variables needed for the VS setup.]) |
30022 | 479 |
AC_MSG_NOTICE([Try setting --with-tools-dir to the VC/bin directory within the VS installation]) |
480 |
AC_MSG_NOTICE([or run "bash.exe -l" from a VS command prompt and then run configure from there.]) |
|
481 |
AC_MSG_ERROR([Cannot continue]) |
|
482 |
fi |
|
14111 | 483 |
|
53110 | 484 |
# Remove windows line endings |
485 |
$SED -i -e 's|\r||g' $VS_ENV_TMP_DIR/set-vs-env.sh |
|
486 |
||
30022 | 487 |
# Now set all paths and other env variables. This will allow the rest of |
488 |
# the configure script to find and run the compiler in the proper way. |
|
489 |
AC_MSG_NOTICE([Setting extracted environment variables]) |
|
490 |
. $VS_ENV_TMP_DIR/set-vs-env.sh |
|
491 |
# Now we have VS_PATH, VS_INCLUDE, VS_LIB. For further checking, we |
|
492 |
# also define VCINSTALLDIR, WindowsSdkDir and WINDOWSSDKDIR. |
|
53240 | 493 |
|
494 |
# In WSL, the extracted VS_PATH is Windows style. This needs to be |
|
495 |
# rewritten as Unix style and the Windows style version is saved |
|
496 |
# in VS_PATH_WINDOWS. |
|
497 |
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.wsl"; then |
|
498 |
OLDIFS="$IFS" |
|
499 |
IFS=";" |
|
500 |
# Convert VS_PATH to unix style |
|
501 |
VS_PATH_WINDOWS="$VS_PATH" |
|
502 |
VS_PATH="" |
|
503 |
for i in $VS_PATH_WINDOWS; do |
|
504 |
path=$i |
|
505 |
# Only process non-empty elements |
|
506 |
if test "x$path" != x; then |
|
507 |
IFS="$OLDIFS" |
|
508 |
# Check that directory exists before calling fixup_path |
|
509 |
testpath=$path |
|
510 |
BASIC_WINDOWS_REWRITE_AS_UNIX_PATH([testpath]) |
|
511 |
if test -d "$testpath"; then |
|
512 |
BASIC_FIXUP_PATH([path]) |
|
513 |
BASIC_APPEND_TO_PATH(VS_PATH, $path) |
|
514 |
fi |
|
515 |
IFS=";" |
|
516 |
fi |
|
517 |
done |
|
518 |
IFS="$OLDIFS" |
|
519 |
fi |
|
520 |
||
30022 | 521 |
else |
522 |
# We did not find a vsvars bat file, let's hope we are run from a VS command prompt. |
|
523 |
AC_MSG_NOTICE([Cannot locate a valid Visual Studio installation, checking current environment]) |
|
524 |
fi |
|
14111 | 525 |
fi |
526 |
||
23429 | 527 |
# At this point, we should have correct variables in the environment, or we can't continue. |
14111 | 528 |
AC_MSG_CHECKING([for Visual Studio variables]) |
20363 | 529 |
|
30022 | 530 |
if test "x$VCINSTALLDIR" != x || test "x$WindowsSDKDir" != x \ |
531 |
|| test "x$WINDOWSSDKDIR" != x || test "x$DEVKIT_NAME" != x; then |
|
23429 | 532 |
if test "x$VS_INCLUDE" = x || test "x$VS_LIB" = x; then |
14111 | 533 |
AC_MSG_RESULT([present but broken]) |
534 |
AC_MSG_ERROR([Your VC command prompt seems broken, INCLUDE and/or LIB is missing.]) |
|
535 |
else |
|
536 |
AC_MSG_RESULT([ok]) |
|
28809
6481e27e00ee
8071329: Stop exporting INCLUDE and LIB when building on windows
erikj
parents:
28287
diff
changeset
|
537 |
# Remove any trailing "\" ";" and " " from the variables. |
6481e27e00ee
8071329: Stop exporting INCLUDE and LIB when building on windows
erikj
parents:
28287
diff
changeset
|
538 |
VS_INCLUDE=`$ECHO "$VS_INCLUDE" | $SED -e 's/\\\\*;* *$//'` |
6481e27e00ee
8071329: Stop exporting INCLUDE and LIB when building on windows
erikj
parents:
28287
diff
changeset
|
539 |
VS_LIB=`$ECHO "$VS_LIB" | $SED 's/\\\\*;* *$//'` |
23429 | 540 |
VCINSTALLDIR=`$ECHO "$VCINSTALLDIR" | $SED 's/\\\\* *$//'` |
54265
1b0163c877c0
8220445: Support for side by side MSVC Toolset versions
erikj
parents:
53240
diff
changeset
|
541 |
VCToolsRedistDir=`$ECHO "$VCToolsRedistDir" | $SED 's/\\\\* *$//'` |
50073
35b22ca681d1
8202557: OpenJDK fails to start in Windows 7 and 8.1 after upgrading compiler to VC 2017
erikj
parents:
49566
diff
changeset
|
542 |
WindowsSdkDir=`$ECHO "$WindowsSdkDir" | $SED 's/\\\\* *$//'` |
23429 | 543 |
WINDOWSSDKDIR=`$ECHO "$WINDOWSSDKDIR" | $SED 's/\\\\* *$//'` |
50073
35b22ca681d1
8202557: OpenJDK fails to start in Windows 7 and 8.1 after upgrading compiler to VC 2017
erikj
parents:
49566
diff
changeset
|
544 |
if test -z "$WINDOWSSDKDIR"; then |
35b22ca681d1
8202557: OpenJDK fails to start in Windows 7 and 8.1 after upgrading compiler to VC 2017
erikj
parents:
49566
diff
changeset
|
545 |
WINDOWSSDKDIR="$WindowsSdkDir" |
35b22ca681d1
8202557: OpenJDK fails to start in Windows 7 and 8.1 after upgrading compiler to VC 2017
erikj
parents:
49566
diff
changeset
|
546 |
fi |
23432
f8964bac59db
8039030: 9-dev windows-i586 build failed with mktemp: command not found
erikj
parents:
23429
diff
changeset
|
547 |
# Remove any paths containing # (typically F#) as that messes up make. This |
f8964bac59db
8039030: 9-dev windows-i586 build failed with mktemp: command not found
erikj
parents:
23429
diff
changeset
|
548 |
# is needed if visual studio was installed with F# support. |
f8964bac59db
8039030: 9-dev windows-i586 build failed with mktemp: command not found
erikj
parents:
23429
diff
changeset
|
549 |
VS_PATH=`$ECHO "$VS_PATH" | $SED 's/[[^:#]]*#[^:]*://g'` |
23429 | 550 |
|
551 |
AC_SUBST(VS_PATH) |
|
14111 | 552 |
AC_SUBST(VS_INCLUDE) |
553 |
AC_SUBST(VS_LIB) |
|
28809
6481e27e00ee
8071329: Stop exporting INCLUDE and LIB when building on windows
erikj
parents:
28287
diff
changeset
|
554 |
|
53240 | 555 |
# Convert VS_INCLUDE into SYSROOT_CFLAGS |
28809
6481e27e00ee
8071329: Stop exporting INCLUDE and LIB when building on windows
erikj
parents:
28287
diff
changeset
|
556 |
OLDIFS="$IFS" |
6481e27e00ee
8071329: Stop exporting INCLUDE and LIB when building on windows
erikj
parents:
28287
diff
changeset
|
557 |
IFS=";" |
6481e27e00ee
8071329: Stop exporting INCLUDE and LIB when building on windows
erikj
parents:
28287
diff
changeset
|
558 |
for i in $VS_INCLUDE; do |
6481e27e00ee
8071329: Stop exporting INCLUDE and LIB when building on windows
erikj
parents:
28287
diff
changeset
|
559 |
ipath=$i |
29065
907bcc4ce290
8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents:
28908
diff
changeset
|
560 |
# Only process non-empty elements |
907bcc4ce290
8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents:
28908
diff
changeset
|
561 |
if test "x$ipath" != x; then |
907bcc4ce290
8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents:
28908
diff
changeset
|
562 |
IFS="$OLDIFS" |
907bcc4ce290
8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents:
28908
diff
changeset
|
563 |
# Check that directory exists before calling fixup_path |
907bcc4ce290
8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents:
28908
diff
changeset
|
564 |
testpath=$ipath |
907bcc4ce290
8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents:
28908
diff
changeset
|
565 |
BASIC_WINDOWS_REWRITE_AS_UNIX_PATH([testpath]) |
907bcc4ce290
8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents:
28908
diff
changeset
|
566 |
if test -d "$testpath"; then |
907bcc4ce290
8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents:
28908
diff
changeset
|
567 |
BASIC_FIXUP_PATH([ipath]) |
907bcc4ce290
8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents:
28908
diff
changeset
|
568 |
SYSROOT_CFLAGS="$SYSROOT_CFLAGS -I$ipath" |
907bcc4ce290
8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents:
28908
diff
changeset
|
569 |
fi |
907bcc4ce290
8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents:
28908
diff
changeset
|
570 |
IFS=";" |
907bcc4ce290
8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents:
28908
diff
changeset
|
571 |
fi |
28809
6481e27e00ee
8071329: Stop exporting INCLUDE and LIB when building on windows
erikj
parents:
28287
diff
changeset
|
572 |
done |
6481e27e00ee
8071329: Stop exporting INCLUDE and LIB when building on windows
erikj
parents:
28287
diff
changeset
|
573 |
# Convert VS_LIB into SYSROOT_LDFLAGS |
6481e27e00ee
8071329: Stop exporting INCLUDE and LIB when building on windows
erikj
parents:
28287
diff
changeset
|
574 |
for i in $VS_LIB; do |
6481e27e00ee
8071329: Stop exporting INCLUDE and LIB when building on windows
erikj
parents:
28287
diff
changeset
|
575 |
libpath=$i |
29065
907bcc4ce290
8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents:
28908
diff
changeset
|
576 |
# Only process non-empty elements |
907bcc4ce290
8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents:
28908
diff
changeset
|
577 |
if test "x$libpath" != x; then |
907bcc4ce290
8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents:
28908
diff
changeset
|
578 |
IFS="$OLDIFS" |
907bcc4ce290
8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents:
28908
diff
changeset
|
579 |
# Check that directory exists before calling fixup_path |
907bcc4ce290
8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents:
28908
diff
changeset
|
580 |
testpath=$libpath |
907bcc4ce290
8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents:
28908
diff
changeset
|
581 |
BASIC_WINDOWS_REWRITE_AS_UNIX_PATH([testpath]) |
907bcc4ce290
8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents:
28908
diff
changeset
|
582 |
if test -d "$testpath"; then |
907bcc4ce290
8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents:
28908
diff
changeset
|
583 |
BASIC_FIXUP_PATH([libpath]) |
907bcc4ce290
8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents:
28908
diff
changeset
|
584 |
SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS -libpath:$libpath" |
907bcc4ce290
8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents:
28908
diff
changeset
|
585 |
fi |
907bcc4ce290
8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents:
28908
diff
changeset
|
586 |
IFS=";" |
907bcc4ce290
8073864: Configure must handle invalid elements on INCLUDE/LIB for visualstudio
ihse
parents:
28908
diff
changeset
|
587 |
fi |
28809
6481e27e00ee
8071329: Stop exporting INCLUDE and LIB when building on windows
erikj
parents:
28287
diff
changeset
|
588 |
done |
6481e27e00ee
8071329: Stop exporting INCLUDE and LIB when building on windows
erikj
parents:
28287
diff
changeset
|
589 |
IFS="$OLDIFS" |
53110 | 590 |
|
591 |
AC_SUBST(VS_PATH_WINDOWS) |
|
14111 | 592 |
fi |
593 |
else |
|
594 |
AC_MSG_RESULT([not found]) |
|
595 |
||
596 |
if test "x$VS_ENV_CMD" = x; then |
|
597 |
AC_MSG_NOTICE([Cannot locate a valid Visual Studio or Windows SDK installation on disk,]) |
|
598 |
AC_MSG_NOTICE([nor is this script run from a Visual Studio command prompt.]) |
|
599 |
else |
|
600 |
AC_MSG_NOTICE([Running the extraction script failed.]) |
|
601 |
fi |
|
602 |
AC_MSG_NOTICE([Try setting --with-tools-dir to the VC/bin directory within the VS installation]) |
|
603 |
AC_MSG_NOTICE([or run "bash.exe -l" from a VS command prompt and then run configure from there.]) |
|
604 |
AC_MSG_ERROR([Cannot continue]) |
|
605 |
fi |
|
20643 | 606 |
]) |
20363 | 607 |
|
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
608 |
AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL], |
20643 | 609 |
[ |
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
610 |
DLL_NAME="$1" |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
611 |
POSSIBLE_MSVC_DLL="$2" |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
612 |
METHOD="$3" |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
613 |
if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then |
30022 | 614 |
AC_MSG_NOTICE([Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD]) |
29643
89e91c724316
8076531: Switch default compiler on Windows to VS2013
erikj
parents:
29065
diff
changeset
|
615 |
|
20643 | 616 |
# Need to check if the found msvcr is correct architecture |
30022 | 617 |
AC_MSG_CHECKING([found $DLL_NAME architecture]) |
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
618 |
MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"` |
25882 | 619 |
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then |
620 |
# The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit" |
|
621 |
# on x32 and "PE32+ executable for MS Windows (DLL) (GUI) Mono/.Net assembly" on x64 systems. |
|
622 |
if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then |
|
623 |
CORRECT_MSVCR_ARCH="PE32 executable" |
|
624 |
else |
|
625 |
CORRECT_MSVCR_ARCH="PE32+ executable" |
|
626 |
fi |
|
20643 | 627 |
else |
25882 | 628 |
if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then |
629 |
CORRECT_MSVCR_ARCH=386 |
|
630 |
else |
|
631 |
CORRECT_MSVCR_ARCH=x86-64 |
|
632 |
fi |
|
20643 | 633 |
fi |
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
634 |
if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then |
20643 | 635 |
AC_MSG_RESULT([ok]) |
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
636 |
MSVC_DLL="$POSSIBLE_MSVC_DLL" |
30022 | 637 |
AC_MSG_CHECKING([for $DLL_NAME]) |
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
638 |
AC_MSG_RESULT([$MSVC_DLL]) |
20643 | 639 |
else |
640 |
AC_MSG_RESULT([incorrect, ignoring]) |
|
30022 | 641 |
AC_MSG_NOTICE([The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE]) |
20643 | 642 |
fi |
643 |
fi |
|
644 |
]) |
|
645 |
||
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
646 |
AC_DEFUN([TOOLCHAIN_SETUP_MSVC_DLL], |
20643 | 647 |
[ |
30022 | 648 |
DLL_NAME="$1" |
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
649 |
MSVC_DLL= |
20643 | 650 |
|
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
651 |
if test "x$MSVC_DLL" = x; then |
14111 | 652 |
if test "x$VCINSTALLDIR" != x; then |
20643 | 653 |
CYGWIN_VC_INSTALL_DIR="$VCINSTALLDIR" |
50073
35b22ca681d1
8202557: OpenJDK fails to start in Windows 7 and 8.1 after upgrading compiler to VC 2017
erikj
parents:
49566
diff
changeset
|
654 |
BASIC_FIXUP_PATH(CYGWIN_VC_INSTALL_DIR) |
48678 | 655 |
if test "$VS_VERSION" -lt 2017; then |
656 |
# Probe: Using well-known location from Visual Studio 12.0 and older |
|
657 |
if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then |
|
658 |
POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x64/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME" |
|
659 |
else |
|
660 |
POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x86/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME" |
|
661 |
fi |
|
14111 | 662 |
else |
54265
1b0163c877c0
8220445: Support for side by side MSVC Toolset versions
erikj
parents:
53240
diff
changeset
|
663 |
CYGWIN_VC_TOOLS_REDIST_DIR="$VCToolsRedistDir" |
1b0163c877c0
8220445: Support for side by side MSVC Toolset versions
erikj
parents:
53240
diff
changeset
|
664 |
BASIC_FIXUP_PATH(CYGWIN_VC_TOOLS_REDIST_DIR) |
48678 | 665 |
# Probe: Using well-known location from VS 2017 |
666 |
if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then |
|
54265
1b0163c877c0
8220445: Support for side by side MSVC Toolset versions
erikj
parents:
53240
diff
changeset
|
667 |
POSSIBLE_MSVC_DLL="`ls $CYGWIN_VC_TOOLS_REDIST_DIR/x64/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME`" |
48678 | 668 |
else |
54265
1b0163c877c0
8220445: Support for side by side MSVC Toolset versions
erikj
parents:
53240
diff
changeset
|
669 |
POSSIBLE_MSVC_DLL="`ls $CYGWIN_VC_TOOLS_REDIST_DIR/x86/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME`" |
48678 | 670 |
fi |
20643 | 671 |
fi |
48678 | 672 |
# In case any of the above finds more than one file, loop over them. |
673 |
for possible_msvc_dll in $POSSIBLE_MSVC_DLL; do |
|
674 |
$ECHO "POSSIBLE_MSVC_DLL $possible_msvc_dll" |
|
675 |
TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL([$DLL_NAME], [$possible_msvc_dll], |
|
676 |
[well-known location in VCINSTALLDIR]) |
|
677 |
done |
|
20643 | 678 |
fi |
679 |
fi |
|
680 |
||
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
681 |
if test "x$MSVC_DLL" = x; then |
20643 | 682 |
# Probe: Check in the Boot JDK directory. |
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
683 |
POSSIBLE_MSVC_DLL="$BOOT_JDK/bin/$DLL_NAME" |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
684 |
TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL([$DLL_NAME], [$POSSIBLE_MSVC_DLL], |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
685 |
[well-known location in Boot JDK]) |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
686 |
fi |
29643
89e91c724316
8076531: Switch default compiler on Windows to VS2013
erikj
parents:
29065
diff
changeset
|
687 |
|
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
688 |
if test "x$MSVC_DLL" = x; then |
29643
89e91c724316
8076531: Switch default compiler on Windows to VS2013
erikj
parents:
29065
diff
changeset
|
689 |
# Probe: Look in the Windows system32 directory |
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
690 |
CYGWIN_SYSTEMROOT="$SYSTEMROOT" |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
691 |
BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(CYGWIN_SYSTEMROOT) |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
692 |
POSSIBLE_MSVC_DLL="$CYGWIN_SYSTEMROOT/system32/$DLL_NAME" |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
693 |
TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL([$DLL_NAME], [$POSSIBLE_MSVC_DLL], |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
694 |
[well-known location in SYSTEMROOT]) |
20643 | 695 |
fi |
27595
cff167b3bfa2
8065914: Various improvements and cleanup of build system
ihse
parents:
26400
diff
changeset
|
696 |
|
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
697 |
if test "x$MSVC_DLL" = x; then |
20643 | 698 |
# Probe: If Visual Studio Express is installed, there is usually one with the debugger |
699 |
if test "x$VS100COMNTOOLS" != x; then |
|
700 |
CYGWIN_VS_TOOLS_DIR="$VS100COMNTOOLS/.." |
|
701 |
BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(CYGWIN_VS_TOOLS_DIR) |
|
702 |
if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then |
|
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
703 |
POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name $DLL_NAME \ |
53110 | 704 |
| $GREP -i /x64/ | $HEAD --lines 1` |
20643 | 705 |
else |
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
706 |
POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name $DLL_NAME \ |
53110 | 707 |
| $GREP -i /x86/ | $HEAD --lines 1` |
20643 | 708 |
fi |
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
709 |
TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL([$DLL_NAME], [$POSSIBLE_MSVC_DLL], |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
710 |
[search of VS100COMNTOOLS]) |
20643 | 711 |
fi |
712 |
fi |
|
29643
89e91c724316
8076531: Switch default compiler on Windows to VS2013
erikj
parents:
29065
diff
changeset
|
713 |
|
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
714 |
if test "x$MSVC_DLL" = x; then |
20643 | 715 |
# Probe: Search wildly in the VCINSTALLDIR. We've probably lost by now. |
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
716 |
# (This was the original behaviour; kept since it might turn something up) |
20643 | 717 |
if test "x$CYGWIN_VC_INSTALL_DIR" != x; then |
718 |
if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then |
|
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
719 |
POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name $DLL_NAME \ |
53110 | 720 |
| $GREP x64 | $HEAD --lines 1` |
20643 | 721 |
else |
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
722 |
POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name $DLL_NAME \ |
53110 | 723 |
| $GREP x86 | $GREP -v ia64 | $GREP -v x64 | $HEAD --lines 1` |
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
724 |
if test "x$POSSIBLE_MSVC_DLL" = x; then |
20643 | 725 |
# We're grasping at straws now... |
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
726 |
POSSIBLE_MSVC_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name $DLL_NAME \ |
53110 | 727 |
| $HEAD --lines 1` |
14111 | 728 |
fi |
729 |
fi |
|
29643
89e91c724316
8076531: Switch default compiler on Windows to VS2013
erikj
parents:
29065
diff
changeset
|
730 |
|
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
731 |
TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL([$DLL_NAME], [$POSSIBLE_MSVC_DLL], |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
732 |
[search of VCINSTALLDIR]) |
14111 | 733 |
fi |
734 |
fi |
|
29643
89e91c724316
8076531: Switch default compiler on Windows to VS2013
erikj
parents:
29065
diff
changeset
|
735 |
|
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
736 |
if test "x$MSVC_DLL" = x; then |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
737 |
AC_MSG_CHECKING([for $DLL_NAME]) |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
738 |
AC_MSG_RESULT([no]) |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
739 |
AC_MSG_ERROR([Could not find $DLL_NAME. Please specify using --with-msvcr-dll.]) |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
740 |
fi |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
741 |
]) |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
742 |
|
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
743 |
AC_DEFUN([TOOLCHAIN_SETUP_VS_RUNTIME_DLLS], |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
744 |
[ |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
745 |
AC_ARG_WITH(msvcr-dll, [AS_HELP_STRING([--with-msvcr-dll], |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
746 |
[path to microsoft C runtime dll (msvcr*.dll) (Windows only) @<:@probed@:>@])]) |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
747 |
|
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
748 |
if test "x$with_msvcr_dll" != x; then |
42300
218374d35efd
8039103: "explicitly" is misspelled as "explicitely" in configure scripts
ihse
parents:
30022
diff
changeset
|
749 |
# If given explicitly by user, do not probe. If not present, fail directly. |
30022 | 750 |
TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL($MSVCR_NAME, [$with_msvcr_dll], [--with-msvcr-dll]) |
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
751 |
if test "x$MSVC_DLL" = x; then |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
752 |
AC_MSG_ERROR([Could not find a proper $MSVCR_NAME as specified by --with-msvcr-dll]) |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
753 |
fi |
30022 | 754 |
MSVCR_DLL="$MSVC_DLL" |
755 |
elif test "x$DEVKIT_MSVCR_DLL" != x; then |
|
756 |
TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL($MSVCR_NAME, [$DEVKIT_MSVCR_DLL], [devkit]) |
|
757 |
if test "x$MSVC_DLL" = x; then |
|
758 |
AC_MSG_ERROR([Could not find a proper $MSVCR_NAME as specified by devkit]) |
|
48678 | 759 |
fi |
30022 | 760 |
MSVCR_DLL="$MSVC_DLL" |
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
761 |
else |
30022 | 762 |
TOOLCHAIN_SETUP_MSVC_DLL([${MSVCR_NAME}]) |
763 |
MSVCR_DLL="$MSVC_DLL" |
|
14111 | 764 |
fi |
30022 | 765 |
AC_SUBST(MSVCR_DLL) |
20643 | 766 |
|
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
767 |
AC_ARG_WITH(msvcp-dll, [AS_HELP_STRING([--with-msvcp-dll], |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
768 |
[path to microsoft C++ runtime dll (msvcp*.dll) (Windows only) @<:@probed@:>@])]) |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
769 |
|
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
770 |
if test "x$MSVCP_NAME" != "x"; then |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
771 |
if test "x$with_msvcp_dll" != x; then |
42300
218374d35efd
8039103: "explicitly" is misspelled as "explicitely" in configure scripts
ihse
parents:
30022
diff
changeset
|
772 |
# If given explicitly by user, do not probe. If not present, fail directly. |
30022 | 773 |
TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL($MSVCP_NAME, [$with_msvcp_dll], [--with-msvcp-dll]) |
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
774 |
if test "x$MSVC_DLL" = x; then |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
775 |
AC_MSG_ERROR([Could not find a proper $MSVCP_NAME as specified by --with-msvcp-dll]) |
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
776 |
fi |
30022 | 777 |
MSVCP_DLL="$MSVC_DLL" |
778 |
elif test "x$DEVKIT_MSVCP_DLL" != x; then |
|
779 |
TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL($MSVCP_NAME, [$DEVKIT_MSVCP_DLL], [devkit]) |
|
780 |
if test "x$MSVC_DLL" = x; then |
|
781 |
AC_MSG_ERROR([Could not find a proper $MSVCP_NAME as specified by devkit]) |
|
48678 | 782 |
fi |
30022 | 783 |
MSVCP_DLL="$MSVC_DLL" |
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
784 |
else |
30022 | 785 |
TOOLCHAIN_SETUP_MSVC_DLL([${MSVCP_NAME}]) |
786 |
MSVCP_DLL="$MSVC_DLL" |
|
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
787 |
fi |
30022 | 788 |
AC_SUBST(MSVCP_DLL) |
28901
5acc0ec03d06
8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents:
28287
diff
changeset
|
789 |
fi |
50073
35b22ca681d1
8202557: OpenJDK fails to start in Windows 7 and 8.1 after upgrading compiler to VC 2017
erikj
parents:
49566
diff
changeset
|
790 |
|
35b22ca681d1
8202557: OpenJDK fails to start in Windows 7 and 8.1 after upgrading compiler to VC 2017
erikj
parents:
49566
diff
changeset
|
791 |
AC_ARG_WITH(ucrt-dll-dir, [AS_HELP_STRING([--with-ucrt-dll-dir], |
35b22ca681d1
8202557: OpenJDK fails to start in Windows 7 and 8.1 after upgrading compiler to VC 2017
erikj
parents:
49566
diff
changeset
|
792 |
[path to Microsoft Windows Kit UCRT DLL dir (Windows only) @<:@probed@:>@])]) |
35b22ca681d1
8202557: OpenJDK fails to start in Windows 7 and 8.1 after upgrading compiler to VC 2017
erikj
parents:
49566
diff
changeset
|
793 |
|
35b22ca681d1
8202557: OpenJDK fails to start in Windows 7 and 8.1 after upgrading compiler to VC 2017
erikj
parents:
49566
diff
changeset
|
794 |
if test "x$USE_UCRT" = "xtrue"; then |
35b22ca681d1
8202557: OpenJDK fails to start in Windows 7 and 8.1 after upgrading compiler to VC 2017
erikj
parents:
49566
diff
changeset
|
795 |
AC_MSG_CHECKING([for UCRT DLL dir]) |
35b22ca681d1
8202557: OpenJDK fails to start in Windows 7 and 8.1 after upgrading compiler to VC 2017
erikj
parents:
49566
diff
changeset
|
796 |
if test "x$with_ucrt_dll_dir" != x; then |
53110 | 797 |
if test -z "$(ls -d $with_ucrt_dll_dir/*.dll 2> /dev/null)"; then |
50073
35b22ca681d1
8202557: OpenJDK fails to start in Windows 7 and 8.1 after upgrading compiler to VC 2017
erikj
parents:
49566
diff
changeset
|
798 |
AC_MSG_RESULT([no]) |
35b22ca681d1
8202557: OpenJDK fails to start in Windows 7 and 8.1 after upgrading compiler to VC 2017
erikj
parents:
49566
diff
changeset
|
799 |
AC_MSG_ERROR([Could not find any dlls in $with_ucrt_dll_dir]) |
35b22ca681d1
8202557: OpenJDK fails to start in Windows 7 and 8.1 after upgrading compiler to VC 2017
erikj
parents:
49566
diff
changeset
|
800 |
else |
35b22ca681d1
8202557: OpenJDK fails to start in Windows 7 and 8.1 after upgrading compiler to VC 2017
erikj
parents:
49566
diff
changeset
|
801 |
AC_MSG_RESULT([$with_ucrt_dll_dir]) |
35b22ca681d1
8202557: OpenJDK fails to start in Windows 7 and 8.1 after upgrading compiler to VC 2017
erikj
parents:
49566
diff
changeset
|
802 |
UCRT_DLL_DIR="$with_ucrt_dll_dir" |
35b22ca681d1
8202557: OpenJDK fails to start in Windows 7 and 8.1 after upgrading compiler to VC 2017
erikj
parents:
49566
diff
changeset
|
803 |
BASIC_FIXUP_PATH([UCRT_DLL_DIR]) |
35b22ca681d1
8202557: OpenJDK fails to start in Windows 7 and 8.1 after upgrading compiler to VC 2017
erikj
parents:
49566
diff
changeset
|
804 |
fi |
35b22ca681d1
8202557: OpenJDK fails to start in Windows 7 and 8.1 after upgrading compiler to VC 2017
erikj
parents:
49566
diff
changeset
|
805 |
elif test "x$DEVKIT_UCRT_DLL_DIR" != "x"; then |
35b22ca681d1
8202557: OpenJDK fails to start in Windows 7 and 8.1 after upgrading compiler to VC 2017
erikj
parents:
49566
diff
changeset
|
806 |
UCRT_DLL_DIR="$DEVKIT_UCRT_DLL_DIR" |
35b22ca681d1
8202557: OpenJDK fails to start in Windows 7 and 8.1 after upgrading compiler to VC 2017
erikj
parents:
49566
diff
changeset
|
807 |
AC_MSG_RESULT($UCRT_DLL_DIR) |
35b22ca681d1
8202557: OpenJDK fails to start in Windows 7 and 8.1 after upgrading compiler to VC 2017
erikj
parents:
49566
diff
changeset
|
808 |
else |
35b22ca681d1
8202557: OpenJDK fails to start in Windows 7 and 8.1 after upgrading compiler to VC 2017
erikj
parents:
49566
diff
changeset
|
809 |
CYGWIN_WINDOWSSDKDIR="${WINDOWSSDKDIR}" |
35b22ca681d1
8202557: OpenJDK fails to start in Windows 7 and 8.1 after upgrading compiler to VC 2017
erikj
parents:
49566
diff
changeset
|
810 |
BASIC_FIXUP_PATH([CYGWIN_WINDOWSSDKDIR]) |
35b22ca681d1
8202557: OpenJDK fails to start in Windows 7 and 8.1 after upgrading compiler to VC 2017
erikj
parents:
49566
diff
changeset
|
811 |
dll_subdir=$OPENJDK_TARGET_CPU |
35b22ca681d1
8202557: OpenJDK fails to start in Windows 7 and 8.1 after upgrading compiler to VC 2017
erikj
parents:
49566
diff
changeset
|
812 |
if test "x$dll_subdir" = "xx86_64"; then |
35b22ca681d1
8202557: OpenJDK fails to start in Windows 7 and 8.1 after upgrading compiler to VC 2017
erikj
parents:
49566
diff
changeset
|
813 |
dll_subdir="x64" |
35b22ca681d1
8202557: OpenJDK fails to start in Windows 7 and 8.1 after upgrading compiler to VC 2017
erikj
parents:
49566
diff
changeset
|
814 |
fi |
35b22ca681d1
8202557: OpenJDK fails to start in Windows 7 and 8.1 after upgrading compiler to VC 2017
erikj
parents:
49566
diff
changeset
|
815 |
UCRT_DLL_DIR="$CYGWIN_WINDOWSSDKDIR/Redist/ucrt/DLLs/$dll_subdir" |
35b22ca681d1
8202557: OpenJDK fails to start in Windows 7 and 8.1 after upgrading compiler to VC 2017
erikj
parents:
49566
diff
changeset
|
816 |
if test -z "$(ls -d "$UCRT_DLL_DIR/"*.dll 2> /dev/null)"; then |
53110 | 817 |
# Try with version subdir |
818 |
UCRT_DLL_DIR="`ls -d $CYGWIN_WINDOWSSDKDIR/Redist/*/ucrt/DLLs/$dll_subdir \ |
|
819 |
2> /dev/null | $SORT -d | $HEAD -n1`" |
|
820 |
if test -z "$UCRT_DLL_DIR" \ |
|
821 |
|| test -z "$(ls -d "$UCRT_DLL_DIR/"*.dll 2> /dev/null)"; then |
|
822 |
AC_MSG_RESULT([no]) |
|
823 |
AC_MSG_ERROR([Could not find any dlls in $UCRT_DLL_DIR]) |
|
824 |
else |
|
825 |
AC_MSG_RESULT($UCRT_DLL_DIR) |
|
826 |
fi |
|
50073
35b22ca681d1
8202557: OpenJDK fails to start in Windows 7 and 8.1 after upgrading compiler to VC 2017
erikj
parents:
49566
diff
changeset
|
827 |
else |
35b22ca681d1
8202557: OpenJDK fails to start in Windows 7 and 8.1 after upgrading compiler to VC 2017
erikj
parents:
49566
diff
changeset
|
828 |
AC_MSG_RESULT($UCRT_DLL_DIR) |
35b22ca681d1
8202557: OpenJDK fails to start in Windows 7 and 8.1 after upgrading compiler to VC 2017
erikj
parents:
49566
diff
changeset
|
829 |
fi |
35b22ca681d1
8202557: OpenJDK fails to start in Windows 7 and 8.1 after upgrading compiler to VC 2017
erikj
parents:
49566
diff
changeset
|
830 |
fi |
35b22ca681d1
8202557: OpenJDK fails to start in Windows 7 and 8.1 after upgrading compiler to VC 2017
erikj
parents:
49566
diff
changeset
|
831 |
else |
35b22ca681d1
8202557: OpenJDK fails to start in Windows 7 and 8.1 after upgrading compiler to VC 2017
erikj
parents:
49566
diff
changeset
|
832 |
UCRT_DLL_DIR= |
35b22ca681d1
8202557: OpenJDK fails to start in Windows 7 and 8.1 after upgrading compiler to VC 2017
erikj
parents:
49566
diff
changeset
|
833 |
fi |
35b22ca681d1
8202557: OpenJDK fails to start in Windows 7 and 8.1 after upgrading compiler to VC 2017
erikj
parents:
49566
diff
changeset
|
834 |
AC_SUBST(UCRT_DLL_DIR) |
14111 | 835 |
]) |