@@ -190,20 +190,6 @@ function Start-OpenSSHBootstrap
190
190
[Environment ]::SetEnvironmentVariable(' Path' , $newMachineEnvironmentPath , ' MACHINE' )
191
191
}
192
192
193
- # install nasm
194
- $packageName = " nasm"
195
- $nasmPath = " ${env: ProgramFiles(x86)} \NASM"
196
-
197
- if (-not (Test-Path - Path $nasmPath - PathType Container))
198
- {
199
- Write-BuildMsg - AsInfo - Message " $packageName not present. Installing $packageName ." - Silent:$silent
200
- choco install $packageName - y -- force -- limitoutput -- execution- timeout 10000 2>&1 >> $script :BuildLogFile
201
- }
202
- else
203
- {
204
- Write-BuildMsg - AsVerbose - Message " $packageName present. Skipping installation." - Silent:$silent
205
- }
206
-
207
193
# Install Visual Studio 2015 Community
208
194
$packageName = " VisualStudio2015Community"
209
195
$VSPackageInstalled = Get-ItemProperty " HKLM:\software\WOW6432Node\Microsoft\VisualStudio\14.0\setup\vs" - ErrorAction SilentlyContinue
@@ -380,7 +366,9 @@ function Build-OpenSSH
380
366
[string ]$NativeHostArch = " x64" ,
381
367
382
368
[ValidateSet (' Debug' , ' Release' , ' ' )]
383
- [string ]$Configuration = " Release"
369
+ [string ]$Configuration = " Release" ,
370
+
371
+ [switch ]$NoOpenSSL
384
372
)
385
373
Set-StrictMode - Version Latest
386
374
$script :BuildLogFile = $null
@@ -407,12 +395,30 @@ function Build-OpenSSH
407
395
408
396
Start-OpenSSHBootstrap
409
397
410
- Clone- Win32OpenSSH
411
- Copy-OpenSSLSDK
398
+ if (-not (Test-Path (Join-Path $PSScriptRoot OpenSSLSDK)))
399
+ {
400
+ Clone- Win32OpenSSH
401
+ Copy-OpenSSLSDK
402
+ }
403
+
404
+ if ($NoOpenSSL )
405
+ {
406
+ $f = Join-Path $PSScriptRoot paths.targets
407
+ (Get-Content $f ).Replace(' <!-- <UseOpenSSL>false</UseOpenSSL> -->' , ' <UseOpenSSL>false</UseOpenSSL>' ) | Set-Content $f
408
+ $f = Join-Path $PSScriptRoot config.h.vs
409
+ (Get-Content $f ).Replace(' #define WITH_OPENSSL 1' , ' ' ) | Set-Content $f
410
+ (Get-Content $f ).Replace(' #define OPENSSL_HAS_ECC 1' , ' ' ) | Set-Content $f
411
+ (Get-Content $f ).Replace(' #define OPENSSL_HAS_NISTP521 1' , ' ' ) | Set-Content $f
412
+ }
413
+
412
414
$msbuildCmd = " msbuild.exe"
413
415
$solutionFile = Get-SolutionFile - root $repositoryRoot.FullName
414
416
$cmdMsg = @ (" ${solutionFile} " , " /p:Platform=${NativeHostArch} " , " /p:Configuration=${Configuration} " , " /m" , " /noconlog" , " /nologo" , " /fl" , " /flp:LogFile=${ script:BuildLogFile } `;Append`;Verbosity=diagnostic" )
415
417
418
+ if ($NoOpenSSL ) {
419
+ $cmdMsg += @ (" /t:core\scp" , " /t:core\sftp" , " /t:core\sftp-server" , " /t:core\ssh" , " /t:core\ssh-add" , " /t:core\ssh-agent" , " /t:core\sshd" , " /t:core\ssh-keygen" , " /t:core\ssh-shellhost" )
420
+ }
421
+
416
422
& $msbuildCmd $cmdMsg
417
423
$errorCode = $LASTEXITCODE
418
424
0 commit comments