openssl을 Windows에서 사용하기 위해 Windows빌드 하는 방법을 정리해본다. 과거 Openssl 1.x버전을 빌드하여 사용하였었는데 1.x는 EOL되어 이제 LTS버전인 3.0.x버전을 사용하여 빌드 해본다.
0. 준비
- Visual studio 2019
- Strawberry perl (https://strawberryperl.com/)
- jom (https://wiki.qt.io/Jom)
우선 msvc컴파일러를 사용하여 빌드하므로 visual stdio가 설치되어있어야 한다. 나는 2022버전을 설치하였다.
또 openssl 빌드과정 중 perl스크립트를 사용하므로 perl을 설치해야한다. Windows에서는 무료 라이선스 Strawberry Perl을 추천한다.
Strawberry Perl for Windows
Perl is a programming language suitable for writing simple scripts as well as complex applications — see https://www.perl.org. Strawberry Perl is a perl environment for MS Windows containing all you need to run and develop perl applications. It is design
strawberryperl.com
병렬 빌드를 위해 jom도 다운로드 해준다.
다운로드 받은 jom은 편한 위치에 넣고 환경 변수에 등록해주면 어디든 쓸 수 있다.
나는 귀찮으므로 c:\jom에 설치해놓고 그냥 쓰려한다.
1. Openssl 소스 다운로드
openssl github에서 소스를 clone한다.
git clone https://github.com/openssl/openssl.git
LTS버전 최신 3.0.14 버전으로 checkout한다.
git checkout tags/openssl-3.0.14
2. Visual studio 개발자 프롬프트 실행
개발 툴체인 환경변수가 설정되는 개발자 프롬프트를 실행한다.(관리자 권한으로)
3. Configure
x86 Configure
perl Configure VC-WIN32 no-tests no-idea no-md2 no-mdc2 no-rc5 no-rc4 no-asm --prefix=[빌드결과 절대 경로] /FS
x64 Configure
perl Configure VC-WIN64A no-tests no-idea no-md2 no-mdc2 no-rc5 no-rc4 no-asm --prefix=[빌드결과 절대 경로] /FS
/FS는 jom 병렬빌드를 하기 위함이다.
4. namke or jom
nmake명령으로 빌드
nmake
혹은 jom빌드를 하려면
c:\jom\jom.exe -j [cpu갯수]
jom빌드를 하면 cpu가 100%가 되는 것을 볼 수 있다.
5. nmake install
nmake install
6. 실행 확인
빌드된 폴더에 openssl을 실행하여 본다.
jom을 사용하여 openssl을 좀 더 빠르게 빌드 할 수 있다.
참고
https://github.com/openssl/openssl/issues/9931
Parallel build of OpenSSL · Issue #9931 · openssl/openssl
I build Openssl on windows using nmake. It is currently taking me 11 minutes. Request you to support parallel build. For Release build we use: perl Configure VC-WIN32 no-unit-test no-asm For Debug ...
github.com
https://www.lesstif.com/system-admin/openssl-compile-build-6291508.html
OpenSSL 컴파일(compile) & 빌드(build)
현재 코드 페이지(number)에서 표시할 수 없는 문자가 파일에 들어 있습니다. 데이터가 손실되지 않게 하려면 해당 파일을 유니코드 형식으로 저장하십시오. The file contains a character that cannot be repre
www.lesstif.com
'개발 > Windows' 카테고리의 다른 글
[WTL] Visual studio 2022에서 WTL Wizard 설치하기 (1) | 2024.08.26 |
---|---|
[WinUI3/c++] 창 사이즈 변경하기 (0) | 2024.08.17 |
[Winui3] Unpackaged 프로젝트로 설정하기 (0) | 2024.05.26 |
[WinUI3] WinUI3 써먹을 수 있을까? (0) | 2024.05.26 |
[Win32] 메시지 루프는 어떻게 창에 메시지를 전달할까? (0) | 2022.07.31 |
댓글