-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.ps1
86 lines (65 loc) · 2.09 KB
/
setup.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
param(
[switch]$msquic = $false
)
$dotnetRuntimeRoot = "$PSScriptRoot\src\dotnet-runtime"
$opensslRoot = "$PSScriptRoot\extern\openssl"
$opensslArtifactRoot = "$PSScriptRoot\artifacts\openssl"
$msquicRoot = "$PSScriptRoot\extern\msquic"
$msquicArtifactRoot = "$PSScriptRoot\artifacts\msquic"
if(!(Get-Command nmake -ErrorAction SilentlyContinue))
{
echo "Cannot find nmake, are you running from developer shell instance?"
exit 1;
}
if (! [System.IO.File]::Exists("$opensslRoot\Configure"))
{
echo "Cannot find $opensslRoot\Configure, did you clone all submodules?";
exit 1
}
if (! [System.IO.File]::Exists("$dotnetRuntimeRoot\build.cmd"))
{
echo "Cannot find $dotnetRuntimeRoot\build.cmd, did you clone all submodules?";
exit 1
}
if ($msquic)
{
echo "Building msquic"
$null = New-Item -ItemType Directory "$msquicArtifactRoot" -Force
pushd $msquicRoot
# msquic references many submodules during build
git submodule update --init
pwsh .\scripts\build.ps1 -Tls Schannel -Config Release
# artifacts directory for msquic build script is not customizable, so we just manually copy the results
# this command expects there to be a single build in the artifacts directory, otherwise the copy needs
# to be done manually for the selected build
cp .\artifacts\*\*\* $msquicArtifactRoot
popd
}
echo "Checking build prerequisities";
foreach ($command in "perl", "nasm")
{
if(!(Get-Command $command -ErrorAction SilentlyContinue))
{
echo "Cannot find $command, make sure it is in path"
exit 1;
}
}
echo "Building custom OpenSSL"
$null = New-Item -ItemType Directory "$opensslArtifactRoot" -Force
pushd $opensslRoot
echo "Checking build prerequisities";
foreach ($command in "perl", "nasm")
{
if(!(Get-Command $command -ErrorAction SilentlyContinue))
{
echo "Cannot find $command, make sure it is in path"
exit 1;
}
}
perl "Configure" VC-WIN64A "--prefix=$opensslArtifactRoot"
nmake install_sw
popd
echo "Restoring dotnet-runtime NuGet packages"
pushd $dotnetRuntimeRoot
.\eng\build.ps1 -restore
popd