openssl编译

关于windows下,openssl编译

环境准备
  1. 安装 perl:https://djvniu.jb51.net/200906/tools/ActivePerl5_64.rar
  2. 安装nasm:https://www.nasm.us/pub/nasm/releasebuilds/2.13.01/win64/nasm-2.13.01-installer-x64.exe
  3. 下载opensll源码:https://openssl-library.org/source/old/3.0/index.html
  4. 加入系统PATH变量
  5. 验证
#验证perl
perl --version
#验证nasm
nasm --version

在这里插入图片描述

编译

打开vs 工具=>命令行=>开发者命令提示 (如果配置环境变量之前vs已打开,则关闭vs之后重新打开),不要使用cmd,会提示找不到nmake

#默认Release
#--prefix 需要绝对路径
perl configure VC-WIN64A --prefix=F:\project\openssl-3.0.14\build\vs2019\release\
nmake 
nmake test
nmake install

configuer option:default Release /MD

- `perl Configure VC-WIN32`     if you want 32-bit OpenSSL or
- `perl Configure VC-WIN64A`    if you want 64-bit OpenSSL or
- `perl Configure VC-WIN64-ARM` if you want Windows on Arm (win-arm64)
Debug or Release
#Release
`perl Configure VC-WIN64A`

#debug recommand
`perl Configure VC-WIN64A --debug`
or
`perl Configure debug-VC-WIN64A`
静态库
#如果指定no-shared则默认MT,否则默认MD
#lib & MD
perl Configure VC-WIN32 -static 

#lib & MT
perl Configure VC-WIN32 -static no-shared
/MD /MT
#MT
perl configure VC-WIN64A -static no-shared /MTd --debug
perl configure VC-WIN64A -static no-shared /MT 
#MD
perl configure VC-WIN64A -static /MDd --debug
perl configure VC-WIN64A -static /MD 
demo
    perl configure VC-WIN64A -static no-shared /MTd --prefix=F:\project\openssl-3.0.14\build\vs2019static\debug\ --debug
DOC
查看源文件目录下:NOTES-*.md INSTALL.md
编译 1.x.x版本

整体和上面没有区别,当arch不匹配的时候会报错。
1.编译x86,以管理员身份打开x86 Native Tools Command Prompt for VS 2019
2.编译x64,以管理员身份打开x64 Native Tools Command Prompt for VS 2019

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值