author | xuelei |
Thu, 17 May 2018 11:12:52 -0700 | |
branch | JDK-8145252-TLS13-branch |
changeset 56570 | 60ff67126765 |
parent 48678 | bcce1fa183e7 |
permissions | -rw-r--r-- |
31124 | 1 |
#!/bin/bash |
2 |
# |
|
48678 | 3 |
# Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. |
31124 | 4 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
5 |
# |
|
6 |
# This code is free software; you can redistribute it and/or modify it |
|
7 |
# under the terms of the GNU General Public License version 2 only, as |
|
8 |
# published by the Free Software Foundation. Oracle designates this |
|
9 |
# particular file as subject to the "Classpath" exception as provided |
|
10 |
# by Oracle in the LICENSE file that accompanied this code. |
|
11 |
# |
|
12 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
|
13 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
14 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
15 |
# version 2 for more details (a copy is included in the LICENSE file that |
|
16 |
# accompanied this code). |
|
17 |
# |
|
18 |
# You should have received a copy of the GNU General Public License version |
|
19 |
# 2 along with this work; if not, write to the Free Software Foundation, |
|
20 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
21 |
# |
|
22 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
23 |
# or visit www.oracle.com if you need additional information or have any |
|
24 |
# questions. |
|
25 |
# |
|
26 |
||
48678 | 27 |
# This script copies parts of a Visual Studio installation into a devkit |
31124 | 28 |
# suitable for building OpenJDK and OracleJDK. Needs to run in Cygwin. |
29 |
# erik.joelsson@oracle.com |
|
30 |
||
48678 | 31 |
VS_VERSION="2015" |
32 |
VS_VERSION_NUM="14.0" |
|
33 |
VS_VERSION_NUM_NODOT="140" |
|
31124 | 34 |
SDK_VERSION="8.1" |
48678 | 35 |
VS_VERSION_SP="update3" |
31124 | 36 |
|
37 |
SCRIPT_DIR="$(cd "$(dirname $0)" > /dev/null && pwd)" |
|
38 |
BUILD_DIR="${SCRIPT_DIR}/../../build/devkit" |
|
33029
06a8c5e5959b
8139735: Switch compilers in JPRT for windows and linux
erikj
parents:
31124
diff
changeset
|
39 |
DEVKIT_ROOT="${BUILD_DIR}/VS${VS_VERSION}${VS_VERSION_SP}-devkit" |
31124 | 40 |
DEVKIT_BUNDLE="${DEVKIT_ROOT}.tar.gz" |
41 |
||
42 |
echo "Creating devkit in $DEVKIT_ROOT" |
|
43 |
||
48678 | 44 |
MSVCR_DLL=Microsoft.VC${VS_VERSION_NUM_NODOT}.CRT/vcruntime${VS_VERSION_NUM_NODOT}.dll |
31124 | 45 |
MSVCP_DLL=Microsoft.VC${VS_VERSION_NUM_NODOT}.CRT/msvcp${VS_VERSION_NUM_NODOT}.dll |
46 |
||
47 |
################################################################################ |
|
48 |
# Copy Visual Studio files |
|
49 |
||
50 |
eval VSNNNCOMNTOOLS="\"\${VS${VS_VERSION_NUM_NODOT}COMNTOOLS}\"" |
|
51 |
VS_INSTALL_DIR="$(cygpath "$VSNNNCOMNTOOLS/../..")" |
|
52 |
echo "VS_INSTALL_DIR: $VS_INSTALL_DIR" |
|
53 |
||
54 |
if [ ! -d $DEVKIT_ROOT/VC ]; then |
|
55 |
echo "Copying VC..." |
|
56 |
mkdir -p $DEVKIT_ROOT/VC/bin |
|
57 |
cp -r "$VS_INSTALL_DIR/VC/bin/amd64" $DEVKIT_ROOT/VC/bin/ |
|
58 |
cp "$VS_INSTALL_DIR/VC/bin/"*.* $DEVKIT_ROOT/VC/bin/ |
|
59 |
cp -r "$VS_INSTALL_DIR/VC/bin/1033/" $DEVKIT_ROOT/VC/bin/ |
|
60 |
mkdir -p $DEVKIT_ROOT/VC/lib |
|
61 |
cp -r "$VS_INSTALL_DIR/VC/lib/amd64" $DEVKIT_ROOT/VC/lib/ |
|
62 |
cp "$VS_INSTALL_DIR/VC/lib/"*.* $DEVKIT_ROOT/VC/lib/ |
|
63 |
cp -r "$VS_INSTALL_DIR/VC/include" $DEVKIT_ROOT/VC/ |
|
64 |
mkdir -p $DEVKIT_ROOT/VC/atlmfc/lib |
|
65 |
cp -r "$VS_INSTALL_DIR/VC/atlmfc/include" $DEVKIT_ROOT/VC/atlmfc/ |
|
66 |
cp -r "$VS_INSTALL_DIR/VC/atlmfc/lib/amd64" $DEVKIT_ROOT/VC/atlmfc/lib/ |
|
67 |
cp "$VS_INSTALL_DIR/VC/atlmfc/lib/"*.* $DEVKIT_ROOT/VC/atlmfc/lib/ |
|
68 |
mkdir -p $DEVKIT_ROOT/VC/redist |
|
69 |
cp -r "$VS_INSTALL_DIR/VC/redist/x64" $DEVKIT_ROOT/VC/redist/ |
|
70 |
cp -r "$VS_INSTALL_DIR/VC/redist/x86" $DEVKIT_ROOT/VC/redist/ |
|
71 |
# The redist runtime libs are needed to run the compiler but may not be |
|
72 |
# installed on the machine where the devkit will be used. |
|
73 |
cp $DEVKIT_ROOT/VC/redist/x86/$MSVCR_DLL $DEVKIT_ROOT/VC/bin/ |
|
74 |
cp $DEVKIT_ROOT/VC/redist/x86/$MSVCP_DLL $DEVKIT_ROOT/VC/bin/ |
|
75 |
cp $DEVKIT_ROOT/VC/redist/x64/$MSVCR_DLL $DEVKIT_ROOT/VC/bin/amd64/ |
|
76 |
cp $DEVKIT_ROOT/VC/redist/x64/$MSVCP_DLL $DEVKIT_ROOT/VC/bin/amd64/ |
|
36283
690f25ee7152
8151435: Windows devkit missing 32bit msvcdis120.dll
erikj
parents:
33029
diff
changeset
|
77 |
# The msvcdis dll is needed to run some of the tools in VC/bin but is not |
690f25ee7152
8151435: Windows devkit missing 32bit msvcdis120.dll
erikj
parents:
33029
diff
changeset
|
78 |
# shipped in that directory. Copy it from the common dir. |
690f25ee7152
8151435: Windows devkit missing 32bit msvcdis120.dll
erikj
parents:
33029
diff
changeset
|
79 |
cp "$VS_INSTALL_DIR/Common7/IDE/msvcdis${VS_VERSION_NUM_NODOT}.dll" \ |
690f25ee7152
8151435: Windows devkit missing 32bit msvcdis120.dll
erikj
parents:
33029
diff
changeset
|
80 |
$DEVKIT_ROOT/VC/bin/ |
31124 | 81 |
fi |
82 |
||
83 |
################################################################################ |
|
84 |
# Copy SDK files |
|
85 |
||
86 |
PROGRAMFILES_X86="`env | sed -n 's/^ProgramFiles(x86)=//p'`" |
|
87 |
SDK_INSTALL_DIR="$(cygpath "$PROGRAMFILES_X86/Windows Kits/$SDK_VERSION")" |
|
88 |
echo "SDK_INSTALL_DIR: $SDK_INSTALL_DIR" |
|
89 |
||
90 |
if [ ! -d $DEVKIT_ROOT/$SDK_VERSION ]; then |
|
91 |
echo "Copying SDK..." |
|
92 |
mkdir -p $DEVKIT_ROOT/$SDK_VERSION/bin |
|
93 |
cp -r "$SDK_INSTALL_DIR/bin/x64" $DEVKIT_ROOT/$SDK_VERSION/bin/ |
|
94 |
cp -r "$SDK_INSTALL_DIR/bin/x86" $DEVKIT_ROOT/$SDK_VERSION/bin/ |
|
95 |
mkdir -p $DEVKIT_ROOT/$SDK_VERSION/lib |
|
96 |
cp -r "$SDK_INSTALL_DIR/lib/"winv*/um/x64 $DEVKIT_ROOT/$SDK_VERSION/lib/ |
|
97 |
cp -r "$SDK_INSTALL_DIR/lib/"winv*/um/x86 $DEVKIT_ROOT/$SDK_VERSION/lib/ |
|
98 |
cp -r "$SDK_INSTALL_DIR/include" $DEVKIT_ROOT/$SDK_VERSION/ |
|
48678 | 99 |
# In 2015, the new Universal CRT is delivered in the sdk 10 directory |
100 |
# so need to include that as well. |
|
101 |
mkdir -p $DEVKIT_ROOT/10/lib |
|
102 |
cp -r "$SDK_INSTALL_DIR/../10/lib/10.0.10240.0/ucrt" $DEVKIT_ROOT/10/lib/ |
|
103 |
mkdir -p $DEVKIT_ROOT/10/include |
|
104 |
cp -r "$SDK_INSTALL_DIR/../10/include/10.0.10240.0/ucrt" $DEVKIT_ROOT/10/include/ |
|
31124 | 105 |
fi |
106 |
||
107 |
################################################################################ |
|
108 |
# Generate devkit.info |
|
109 |
||
110 |
echo-info() { |
|
111 |
echo "$1" >> $DEVKIT_ROOT/devkit.info |
|
112 |
} |
|
113 |
||
114 |
echo "Generating devkit.info..." |
|
115 |
rm -f $DEVKIT_ROOT/devkit.info |
|
116 |
echo-info "# This file describes to configure how to interpret the contents of this devkit" |
|
33029
06a8c5e5959b
8139735: Switch compilers in JPRT for windows and linux
erikj
parents:
31124
diff
changeset
|
117 |
echo-info "DEVKIT_NAME=\"Microsoft Visual Studio $VS_VERSION $VS_VERSION_SP (devkit)\"" |
31124 | 118 |
echo-info "DEVKIT_VS_VERSION=\"$VS_VERSION\"" |
119 |
echo-info "" |
|
120 |
echo-info "DEVKIT_TOOLCHAIN_PATH_x86=\"\$DEVKIT_ROOT/VC/bin:\$DEVKIT_ROOT/$SDK_VERSION/bin/x86\"" |
|
48678 | 121 |
echo-info "DEVKIT_VS_INCLUDE_x86=\"\$DEVKIT_ROOT/VC/include;\$DEVKIT_ROOT/VC/atlmfc/include;\$DEVKIT_ROOT/$SDK_VERSION/include/shared;\$DEVKIT_ROOT/$SDK_VERSION/include/um;\$DEVKIT_ROOT/$SDK_VERSION/include/winrt;\$DEVKIT_ROOT/10/include/ucrt\"" |
122 |
echo-info "DEVKIT_VS_LIB_x86=\"\$DEVKIT_ROOT/VC/lib;\$DEVKIT_ROOT/VC/atlmfc/lib;\$DEVKIT_ROOT/$SDK_VERSION/lib/x86;\$DEVKIT_ROOT/10/lib/ucrt/x86\"" |
|
31124 | 123 |
echo-info "DEVKIT_MSVCR_DLL_x86=\"\$DEVKIT_ROOT/VC/redist/x86/$MSVCR_DLL\"" |
124 |
echo-info "DEVKIT_MSVCP_DLL_x86=\"\$DEVKIT_ROOT/VC/redist/x86/$MSVCP_DLL\"" |
|
125 |
echo-info "" |
|
126 |
echo-info "DEVKIT_TOOLCHAIN_PATH_x86_64=\"\$DEVKIT_ROOT/VC/bin/amd64:\$DEVKIT_ROOT/$SDK_VERSION/bin/x64:\$DEVKIT_ROOT/$SDK_VERSION/bin/x86\"" |
|
48678 | 127 |
echo-info "DEVKIT_VS_INCLUDE_x86_64=\"\$DEVKIT_ROOT/VC/include;\$DEVKIT_ROOT/VC/atlmfc/include;\$DEVKIT_ROOT/$SDK_VERSION/include/shared;\$DEVKIT_ROOT/$SDK_VERSION/include/um;\$DEVKIT_ROOT/$SDK_VERSION/include/winrt;\$DEVKIT_ROOT/10/include/ucrt\"" |
128 |
echo-info "DEVKIT_VS_LIB_x86_64=\"\$DEVKIT_ROOT/VC/lib/amd64;\$DEVKIT_ROOT/VC/atlmfc/lib/amd64;\$DEVKIT_ROOT/$SDK_VERSION/lib/x64;\$DEVKIT_ROOT/10/lib/ucrt/x64\"" |
|
31124 | 129 |
echo-info "DEVKIT_MSVCR_DLL_x86_64=\"\$DEVKIT_ROOT/VC/redist/x64/$MSVCR_DLL\"" |
130 |
echo-info "DEVKIT_MSVCP_DLL_x86_64=\"\$DEVKIT_ROOT/VC/redist/x64/$MSVCP_DLL\"" |
|
131 |
||
132 |
################################################################################ |
|
133 |
# Copy this script |
|
134 |
||
135 |
echo "Copying this script..." |
|
136 |
cp $0 $DEVKIT_ROOT/ |
|
137 |
||
138 |
################################################################################ |
|
139 |
# Create bundle |
|
140 |
||
141 |
echo "Creating bundle: $DEVKIT_BUNDLE" |
|
142 |
(cd "$DEVKIT_ROOT" && tar zcf "$DEVKIT_BUNDLE" .) |