티스토리 뷰
728x90
param(
[string]$vsVersion,
[string]$buildType = "Release",
[string]$arch = "x64"
)
if (-not $vsVersion -or ($buildType -notin @("Debug", "Release", "Release-MD")) -or ($arch -notin @("x64", "x86"))) {
Write-Host "Usage: .\build_openssl.ps1 -vsVersion <version> [-buildType Debug|Release|Release-MD] [-arch x64|x86]"
exit
}
# 변수 설정
$opensslSrcPath = "G:\ThirdParty\Source\OpenSSL\openssl_3.2.1\openssl-Debug"
$buildPath = "G:\ThirdParty\Source\OpenSSL\openssl_3.2.1\openssl-Debug\builds"
$perlPath = "C:\Strawberry\perl\bin"
$nasmPath = "C:\Program Files\NASM"
# 환경변수 설정
$env:Path += ";$perlPath;$nasmPath"
# 빌드 디렉토리 생성
$currentBuildPath = Join-Path $buildPath ("OpenSSL_${vsVersion}_${buildType}_${arch}")
New-Item -Path $currentBuildPath -ItemType Directory -Force
# 작업 디렉토리 변경
Set-Location -Path $opensslSrcPath
# Prepare OpenSSL configuration
$configureOptions = "no-idea no-md2 no-mdc2 no-rc5 no-rc4"
if ($buildType -eq "Release-MD") {
# $configureOptions += " no-static" # Dynamic linking for Release-MD
} else {
$configureOptions += " no-shared" # Static linking for Debug and Release
}
# Set the target based on architecture
if ($arch -eq "x64")
{
$target = "VC-WIN64A"
}
else
{
$target = "VC-WIN32"
}
if ($buildType -eq "Debug") {
$configureCommand = "perl Configure debug-$target $configureOptions --openssldir=$currentBuildPath --prefix=$currentBuildPath"
} elseif ($buildType -eq "Release") {
$configureCommand = "perl Configure $target $configureOptions --openssldir=$currentBuildPath --prefix=$currentBuildPath"
} elseif ($buildType -eq "Release-MD") {
$configureCommand = "perl Configure $target $configureOptions --openssldir=$currentBuildPath --prefix=$currentBuildPath"
}
# 사용자 정보 출력
Write-Host "====================================================================" -ForegroundColor Cyan
Write-Host "=== INFORMATION" -ForegroundColor Yellow
Write-Host "=== [VS Version]: $vsVersion" -ForegroundColor Green
Write-Host "=== [BUILD Type]: $buildType" -ForegroundColor Green
Write-Host "=== [ARCH]: $arch" -ForegroundColor Green
Write-Host "=== [configureOptions]: $configureOptions" -ForegroundColor Red
Write-Host "=== [DIR PATH]: $currentBuildPath" -ForegroundColor Green
Write-Host "=== [configureCommand]: $configureCommand" -ForegroundColor Blue
Write-Host "====================================================================" -ForegroundColor Cyan
# 사용자 확인 요청
$response = Read-Host "Is the above information correct? (y/n)"
if ($response -ne 'y') {
Write-Host "Process aborted by user." -ForegroundColor Red
exit
}
Write-Host "Configuring OpenSSL for Visual Studio $vsVersion, $buildType, $arch..."
Invoke-Expression -Command $configureCommand
# OpenSSL 빌드
Write-Host "Building OpenSSL..."
Invoke-Expression -Command "nmake"
# OpenSSL 빌드 테스트
Write-Host "Testing OpenSSL build..."
Invoke-Expression -Command "nmake test"
# OpenSSL 설치
Write-Host "Installing OpenSSL..."
Invoke-Expression -Command "nmake install"
# 작업 디렉토리 복원
Set-Location -Path $currentBuildPath
# 정리
Invoke-Expression -Command "nmake clean"
Write-Host "Build process for Visual Studio $vsVersion $buildType $arch completed."
반응형
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- 스쿠버다이빙
- 블루버블
- 윈도우
- 스쿠버 다이빙
- Linux
- 서귀포
- Windows
- C++
- CMake
- DLL
- PowerShell
- 티스토리챌린지
- Build
- 울릉도
- 블루버블다이브팀
- script
- 성산블루버블
- C#
- 암호화
- 현포다이브
- ip
- C# 고급 기술
- 제주도
- 외돌개
- 블루버블다이빙팀
- 패턴
- 서귀포블루버블
- C#.NET
- C
- OpenSource
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함
250x250