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