当前位置: 首页 > article >正文

windows 平台编译openssl

文章目录

  • 准备环境
    • 安装perl
    • 安装NASM
    • 获取源码
  • 源码编译
    • 配置
    • 编译

准备环境

安装perl

下载Perl 5.40.0.1 Portable zip
strawberryperl

解压后设置系统环境变量
测试安装是否成功

perl --version

This is perl 5, version 40, subversion 0 (v5.40.0) built for MSWin32-x64-multi-thread

Copyright 1987-2024, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at https://www.perl.org/, the Perl Home Page.

安装NASM

nasm官网
nasm-2.16.03-win64

下载解压后要加入系统环境变量中

获取源码

openssl官网
openssl源码3.4.1

源码编译

配置

打开VS2019 开发人员命令提示符​

  • x64 Native Tools Command Prompt for VS 2019
  • x86 Native Tools Command Prompt for VS 2019

正确安装了VisualStudio2019的话可以在win菜单中打到,可以在win任务栏的搜索中搜到

进入openssl 源码目录

E:
cd E:\openssl\openssl-3.4.1

# 64位动态库(默认)
perl Configure VC-WIN64A --prefix=D:\openssl-output
# 32位静态库(无汇编优化)
perl Configure VC-WIN32 no-asm --prefix=D:\openssl-output[2,7](@ref)

​关键参数说明:

  • –prefix:指定输出目录(默认安装到系统路径)。
  • no-asm:禁用汇编优化(避免 NASM 依赖问题)。
  • no-shared:生成静态库(.lib 而非 .dll)。

使用64位编译,输出

perl Configure VC-WIN64A --prefix=D:\openssl-output
Configuring OpenSSL version 3.4.1 for target VC-WIN64A
Using os-specific seed configuration
Created configdata.pm
Running configdata.pm
Created makefile.in
Created makefile
Created include\openssl\configuration.h

**********************************************************************
***                                                                ***
***   OpenSSL has been successfully configured                     ***
***                                                                ***
***   If you encounter a problem while building, please open an    ***
***   issue on GitHub <https://github.com/openssl/openssl/issues>  ***
***   and include the output from the following command:           ***
***                                                                ***
***       perl configdata.pm --dump                                ***
***                                                                ***
***   (If you are new to OpenSSL, you might want to consult the    ***
***   'Troubleshooting' section in the INSTALL.md file first)      ***
***                                                                ***
**********************************************************************

编译

然后可以nmake

nmake      # 仅编译
nmake test # 运行测试(可选,确保功能正常)
nmake install  # 安装到 --prefix 指定目录[3,8](@ref)
原文地址:https://blog.csdn.net/weixin_43868793/article/details/146375679
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.kler.cn/a/595706.html

相关文章:

  • 击退手抖困扰:全面解析健康护理指南
  • 小程序API —— 52 小程序界面交互 - 模态对话框 - 消息对话框
  • Windows 图形显示驱动开发-WDDM 2.9功能- 支持跨适配器资源扫描 (CASO)(二)
  • 基于FPGA频率、幅度、相位可调的任意函数发生器(DDS)实现
  • hexo+butterfly博客功能完善和美化(三)---评论功能载入
  • C#Dictionary值拷贝还是引用
  • IDEA导入jar包后提示无法解析jar包中的类,比如无法解析符号 ‘log4j‘
  • 流式语音识别概述-paddlespeech
  • Solana Anchor 程序接口定义语言(IDL)
  • 【回归算法解析系列09】梯度提升回归树(GBRT, XGBoost, LightGBM)
  • Metasploit 跳板攻击
  • StarRocks 升级注意事项
  • django怎么配置404和500
  • VLAN综合实验报告
  • 【 Kubernetes 风云录 】- MutatingWebhook 实现自动注入
  • 解决 SQL Server 日常使用中的疑难杂症,提供实用解决方案
  • 阿里云国际站代理商:服务器网页如何应对恶意网络爬虫?
  • CI/CD管道
  • Apache Tomcat CVE-2025-24813 安全漏洞
  • MES汽车零部件制造生产监控看板大屏