make/devkit/createWindowsDevkit2019.sh
author herrick
Thu, 06 Jun 2019 19:07:18 -0400
branchJDK-8200758-branch
changeset 57389 cce526c681dc
parent 54635 14615b8ac24c
permissions -rw-r--r--
8222901: different behavior when --name option not used Reviewed-by: asemenyuk, almatvee
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
54635
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
     1
#!/bin/bash
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
     2
#
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
     3
# Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
     4
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
     5
#
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
     6
# This code is free software; you can redistribute it and/or modify it
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
     7
# under the terms of the GNU General Public License version 2 only, as
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
     8
# published by the Free Software Foundation.  Oracle designates this
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
     9
# particular file as subject to the "Classpath" exception as provided
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    10
# by Oracle in the LICENSE file that accompanied this code.
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    11
#
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    12
# This code is distributed in the hope that it will be useful, but WITHOUT
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    13
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    14
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    15
# version 2 for more details (a copy is included in the LICENSE file that
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    16
# accompanied this code).
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    17
#
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    18
# You should have received a copy of the GNU General Public License version
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    19
# 2 along with this work; if not, write to the Free Software Foundation,
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    20
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    21
#
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    22
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    23
# or visit www.oracle.com if you need additional information or have any
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    24
# questions.
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    25
#
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    26
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    27
# This script copies parts of a Visual Studio installation into a devkit
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    28
# suitable for building OpenJDK and OracleJDK. Needs to run in Cygwin or WSL.
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    29
# erik.joelsson@oracle.com
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    30
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    31
VS_VERSION="2019"
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    32
VS_VERSION_NUM_NODOT="160"
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    33
VS_DLL_VERSION="140"
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    34
SDK_VERSION="10"
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    35
SDK_FULL_VERSION="10.0.17763.0"
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    36
MSVC_DIR="Microsoft.VC141.CRT"
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    37
MSVC_FULL_VERSION="14.12.27508"
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    38
REDIST_FULL_VERSION="14.20.27508"
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    39
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    40
SCRIPT_DIR="$(cd "$(dirname $0)" > /dev/null && pwd)"
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    41
BUILD_DIR="${SCRIPT_DIR}/../../build/devkit"
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    42
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    43
################################################################################
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    44
# Prepare settings
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    45
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    46
UNAME_SYSTEM=`uname -s`
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    47
UNAME_RELEASE=`uname -r`
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    48
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    49
# Detect cygwin or WSL
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    50
IS_CYGWIN=`echo $UNAME_SYSTEM | grep -i CYGWIN`
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    51
IS_WSL=`echo $UNAME_RELEASE | grep Microsoft`
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    52
if test "x$IS_CYGWIN" != "x"; then
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    53
    BUILD_ENV="cygwin"
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    54
elif test "x$IS_WSL" != "x"; then
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    55
    BUILD_ENV="wsl"
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    56
else
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    57
    echo "Unknown environment; only Cygwin and WSL are supported."
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    58
    exit 1
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    59
fi
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    60
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    61
if test "x$BUILD_ENV" = "xcygwin"; then
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    62
    WINDOWS_PATH_TO_UNIX_PATH="cygpath -u"
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    63
elif test "x$BUILD_ENV" = "xwsl"; then
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    64
    WINDOWS_PATH_TO_UNIX_PATH="wslpath -u"
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    65
fi
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    66
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    67
# Work around the insanely named ProgramFiles(x86) env variable
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    68
PROGRAMFILES_X86="$($WINDOWS_PATH_TO_UNIX_PATH "$(cmd.exe /c set | sed -n 's/^ProgramFiles(x86)=//p' | tr -d '\r')")"
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    69
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    70
# Find Visual Studio installation dir
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    71
VSNNNCOMNTOOLS=`cmd.exe /c echo %VS${VS_VERSION_NUM_NODOT}COMNTOOLS% | tr -d '\r'`
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    72
if [ -d "$VSNNNCOMNTOOLS" ]; then
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    73
    VS_INSTALL_DIR="$($WINDOWS_PATH_TO_UNIX_PATH "$VSNNNCOMNTOOLS/../..")"
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    74
else
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    75
    VS_INSTALL_DIR="${PROGRAMFILES_X86}/Microsoft Visual Studio/2019"
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    76
    VS_INSTALL_DIR="$(ls -d "${VS_INSTALL_DIR}/"{Community,Professional,Enterprise} 2>/dev/null | head -n1)"
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    77
fi
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    78
echo "VS_INSTALL_DIR: $VS_INSTALL_DIR"
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    79
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    80
# Extract semantic version
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    81
POTENTIAL_INI_FILES="Common7/IDE/wdexpress.isolation.ini Common7/IDE/devenv.isolation.ini"
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    82
for f in $POTENTIAL_INI_FILES; do
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    83
    if [ -f "$VS_INSTALL_DIR/$f" ]; then
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    84
        VS_VERSION_SP="$(grep ^SemanticVersion= "$VS_INSTALL_DIR/$f")"
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    85
        # Remove SemnaticVersion=
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    86
        VS_VERSION_SP="${VS_VERSION_SP#*=}"
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    87
        # Remove suffix of too detailed numbering starting with +
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    88
        VS_VERSION_SP="${VS_VERSION_SP%+*}"
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    89
        break
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    90
    fi
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    91
done
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    92
if [ -z "$VS_VERSION_SP" ]; then
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    93
    echo "Failed to find SP version"
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    94
    exit 1
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    95
fi
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    96
echo "Found Version SP: $VS_VERSION_SP"
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    97
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    98
# Setup output dirs
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
    99
DEVKIT_ROOT="${BUILD_DIR}/VS${VS_VERSION}-${VS_VERSION_SP}-devkit"
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   100
DEVKIT_BUNDLE="${DEVKIT_ROOT}.tar.gz"
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   101
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   102
echo "Creating devkit in $DEVKIT_ROOT"
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   103
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   104
MSVCR_DLL=${MSVC_DIR}/vcruntime${VS_DLL_VERSION}.dll
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   105
MSVCP_DLL=${MSVC_DIR}/msvcp${VS_DLL_VERSION}.dll
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   106
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   107
################################################################################
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   108
# Copy Visual Studio files
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   109
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   110
TOOLS_VERSION="$(ls "$VS_INSTALL_DIR/VC/Tools/MSVC" | sort -r -n | head -n1)"
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   111
echo "Found Tools version: $TOOLS_VERSION"
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   112
VC_SUBDIR="VC/Tools/MSVC/$TOOLS_VERSION"
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   113
REDIST_VERSION="$(ls "$VS_INSTALL_DIR/VC/Redist/MSVC" | sort -r -n | head -n1)"
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   114
echo "Found Redist version: $REDIST_VERSION"
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   115
REDIST_SUBDIR="VC/Redist/MSVC/$REDIST_VERSION"
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   116
echo "Copying VC..."
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   117
rm -rf $DEVKIT_ROOT/VC
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   118
mkdir -p $DEVKIT_ROOT/VC/bin
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   119
cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/bin/Hostx64/x64" $DEVKIT_ROOT/VC/bin/
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   120
cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/bin/Hostx86/x86" $DEVKIT_ROOT/VC/bin/
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   121
mkdir -p $DEVKIT_ROOT/VC/lib
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   122
cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/lib/x64" $DEVKIT_ROOT/VC/lib/
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   123
cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/lib/x86" $DEVKIT_ROOT/VC/lib/
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   124
cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/include" $DEVKIT_ROOT/VC/
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   125
mkdir -p $DEVKIT_ROOT/VC/atlmfc/lib
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   126
cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/atlmfc/lib/x64" $DEVKIT_ROOT/VC/atlmfc/lib/
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   127
cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/atlmfc/lib/x86" $DEVKIT_ROOT/VC/atlmfc/lib/
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   128
cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/atlmfc/include" $DEVKIT_ROOT/VC/atlmfc/
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   129
mkdir -p $DEVKIT_ROOT/VC/Auxiliary
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   130
cp -r "$VS_INSTALL_DIR/VC/Auxiliary/Build" $DEVKIT_ROOT/VC/Auxiliary/
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   131
mkdir -p $DEVKIT_ROOT/VC/redist
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   132
cp -r "$VS_INSTALL_DIR/$REDIST_SUBDIR/x64" $DEVKIT_ROOT/VC/redist/
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   133
cp -r "$VS_INSTALL_DIR/$REDIST_SUBDIR/x86" $DEVKIT_ROOT/VC/redist/
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   134
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   135
# The redist runtime libs are needed to run the compiler but may not be
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   136
# installed on the machine where the devkit will be used.
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   137
cp $DEVKIT_ROOT/VC/redist/x86/$MSVCR_DLL $DEVKIT_ROOT/VC/bin/x86
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   138
cp $DEVKIT_ROOT/VC/redist/x86/$MSVCP_DLL $DEVKIT_ROOT/VC/bin/x86
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   139
cp $DEVKIT_ROOT/VC/redist/x64/$MSVCR_DLL $DEVKIT_ROOT/VC/bin/x64
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   140
cp $DEVKIT_ROOT/VC/redist/x64/$MSVCP_DLL $DEVKIT_ROOT/VC/bin/x64
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   141
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   142
################################################################################
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   143
# Copy SDK files
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   144
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   145
SDK_INSTALL_DIR="$PROGRAMFILES_X86/Windows Kits/$SDK_VERSION"
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   146
echo "SDK_INSTALL_DIR: $SDK_INSTALL_DIR"
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   147
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   148
SDK_FULL_VERSION="$(ls "$SDK_INSTALL_DIR/bin" | sort -r -n | head -n1)"
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   149
echo "Found SDK version: $SDK_FULL_VERSION"
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   150
UCRT_VERSION="$(ls "$SDK_INSTALL_DIR/Redist" | grep $SDK_VERSION | sort -r -n | head -n1)"
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   151
echo "Found UCRT version: $UCRT_VERSION"
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   152
echo "Copying SDK..."
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   153
rm -rf $DEVKIT_ROOT/$SDK_VERSION
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   154
mkdir -p $DEVKIT_ROOT/$SDK_VERSION/bin
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   155
cp -r "$SDK_INSTALL_DIR/bin/$SDK_FULL_VERSION/x64" $DEVKIT_ROOT/$SDK_VERSION/bin/
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   156
cp -r "$SDK_INSTALL_DIR/bin/$SDK_FULL_VERSION/x86" $DEVKIT_ROOT/$SDK_VERSION/bin/
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   157
mkdir -p $DEVKIT_ROOT/$SDK_VERSION/lib
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   158
cp -r "$SDK_INSTALL_DIR/lib/$SDK_FULL_VERSION/um/x64" $DEVKIT_ROOT/$SDK_VERSION/lib/
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   159
cp -r "$SDK_INSTALL_DIR/lib/$SDK_FULL_VERSION/um/x86" $DEVKIT_ROOT/$SDK_VERSION/lib/
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   160
cp -r "$SDK_INSTALL_DIR/lib/$SDK_FULL_VERSION/ucrt/x64" $DEVKIT_ROOT/$SDK_VERSION/lib/
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   161
cp -r "$SDK_INSTALL_DIR/lib/$SDK_FULL_VERSION/ucrt/x86" $DEVKIT_ROOT/$SDK_VERSION/lib/
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   162
mkdir -p $DEVKIT_ROOT/$SDK_VERSION/Redist
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   163
cp -r "$SDK_INSTALL_DIR/Redist/$UCRT_VERSION/ucrt" $DEVKIT_ROOT/$SDK_VERSION/Redist/
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   164
mkdir -p $DEVKIT_ROOT/$SDK_VERSION/include
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   165
cp -r "$SDK_INSTALL_DIR/include/$SDK_FULL_VERSION/"* $DEVKIT_ROOT/$SDK_VERSION/include/
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   166
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   167
################################################################################
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   168
# Generate devkit.info
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   169
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   170
echo-info() {
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   171
    echo "$1" >> $DEVKIT_ROOT/devkit.info
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   172
}
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   173
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   174
echo "Generating devkit.info..."
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   175
rm -f $DEVKIT_ROOT/devkit.info
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   176
echo-info "# This file describes to configure how to interpret the contents of this devkit"
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   177
echo-info "DEVKIT_NAME=\"Microsoft Visual Studio $VS_VERSION $VS_VERSION_SP (devkit)\""
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   178
echo-info "DEVKIT_VS_VERSION=\"$VS_VERSION\""
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   179
echo-info ""
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   180
echo-info "DEVKIT_TOOLCHAIN_PATH_x86=\"\$DEVKIT_ROOT/VC/bin/x86:\$DEVKIT_ROOT/$SDK_VERSION/bin/x86\""
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   181
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/ucrt;\$DEVKIT_ROOT/$SDK_VERSION/include/um;\$DEVKIT_ROOT/$SDK_VERSION/include/winrt\""
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   182
echo-info "DEVKIT_VS_LIB_x86=\"\$DEVKIT_ROOT/VC/lib/x86;\$DEVKIT_ROOT/VC/atlmfc/lib/x86;\$DEVKIT_ROOT/$SDK_VERSION/lib/x86\""
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   183
echo-info "DEVKIT_MSVCR_DLL_x86=\"\$DEVKIT_ROOT/VC/redist/x86/$MSVCR_DLL\""
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   184
echo-info "DEVKIT_MSVCP_DLL_x86=\"\$DEVKIT_ROOT/VC/redist/x86/$MSVCP_DLL\""
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   185
echo-info "DEVKIT_UCRT_DLL_DIR_x86=\"\$DEVKIT_ROOT/10/Redist/ucrt/DLLs/x86\""
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   186
echo-info ""
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   187
echo-info "DEVKIT_TOOLCHAIN_PATH_x86_64=\"\$DEVKIT_ROOT/VC/bin/x64:\$DEVKIT_ROOT/$SDK_VERSION/bin/x64:\$DEVKIT_ROOT/$SDK_VERSION/bin/x86\""
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   188
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/ucrt;\$DEVKIT_ROOT/$SDK_VERSION/include/um;\$DEVKIT_ROOT/$SDK_VERSION/include/winrt\""
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   189
echo-info "DEVKIT_VS_LIB_x86_64=\"\$DEVKIT_ROOT/VC/lib/x64;\$DEVKIT_ROOT/VC/atlmfc/lib/x64;\$DEVKIT_ROOT/$SDK_VERSION/lib/x64\""
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   190
echo-info "DEVKIT_MSVCR_DLL_x86_64=\"\$DEVKIT_ROOT/VC/redist/x64/$MSVCR_DLL\""
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   191
echo-info "DEVKIT_MSVCP_DLL_x86_64=\"\$DEVKIT_ROOT/VC/redist/x64/$MSVCP_DLL\""
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   192
echo-info "DEVKIT_UCRT_DLL_DIR_x86_64=\"\$DEVKIT_ROOT/10/Redist/ucrt/DLLs/x64\""
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   193
echo-info ""
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   194
echo-info "DEVKIT_TOOLS_VERSION=\"$TOOLS_VERSION\""
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   195
echo-info "DEVKIT_REDIST_VERSION=\"$REDIST_VERSION\""
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   196
echo-info "DEVKIT_SDK_VERSION=\"$SDK_FULL_VERSION\""
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   197
echo-info "DEVKIT_UCRT_VERSION=\"$UCRT_VERSION\""
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   198
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   199
################################################################################
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   200
# Copy this script
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   201
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   202
echo "Copying this script..."
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   203
cp $0 $DEVKIT_ROOT/
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   204
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   205
################################################################################
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   206
# Create bundle
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   207
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   208
echo "Creating bundle: $DEVKIT_BUNDLE"
14615b8ac24c 8221988: add possibility to build with Visual Studio 2019
avoitylov
parents:
diff changeset
   209
(cd "$DEVKIT_ROOT" && tar zcf "$DEVKIT_BUNDLE" .)