ActivePerl、dmake、nasm、nmake编译OpenSSL(1.1.0系列)
来源:互联网 发布:下载卖装备软件 编辑:程序博客网 时间:2024/06/09 15:18
开篇提示:本文为本人原创,本文欢迎转载,但必须注明本文出处,例如:
注1:本文基于Win x64位平台来讲解,x86基本相同:
“该文引用自 CruiseYoung的:“ActivePerl、dmake、nasm、nmake编译OpenSSL(1.1.0系列)” http://blog.csdn.net/fksec/article/details/52667055”否则说明阁下愿意支付以100元人民币每字计的稿费,敬请留意。
注1:本文基于Win x64位平台来讲解,x86基本相同:
注2:ActivePerl、nasm、nmake编译OpenSSL(1.0.1系列):http://blog.csdn.net/fksec/article/details/25969257
1 下载软件包
1.1 ActivePerl(x64):http://www.activestate.com/activeperl/downloads
1.2 nasm(x64):http://www.nasm.us/
1.3 zlib编译见“nmake、cmake、Visual Studio编译zlib”:http://blog.csdn.net/fksec/article/details/25906419
1.4 OpenSSL:http://www.openssl.org/source/
代码托管地址:https://github.com/openssl/openssl(在Tags中选对应版本进行下载,否则静态版本能编译通过,而动态版本编译不能通过)
2 准备工作
2.1 阅读:
2.1.1 编译方法
READMENOTES.WINConfigurations\READMEConfigurations\windows-makefile.tmpl
2.1.2 编译选项
文件INSTALL--with-zlib-include=DIR--with-zlib-lib=LIBzlibzlib-dynamic
2.1.3 编译配置(方式)
文件INSTALL注意以下内容:$ perl d:\PATH\TO\OPENSSL\SOURCE\Configure {{ target }} [[ options ]]--prefix=OpenSSL--openssldir=SSL--with-zlib-include=DIR--with-zlib-lib=LIBzlibzlib-dynamic--debug--release (default)no-sharedno-threads (default)threadson Windows (only pick one of the targets for configuration):$ perl Configure { VC-WIN32 | VC-WIN64A | VC-WIN64I | VC-CE }$ nmake$ nmake test$ nmake install
2.2 编译环境:点击“开始”-->"所有程序"-->"Visual Studio 2013"-->"Visual Studio Tools"-->"VS2013 x64 本机工具命令提示"
2.3 编译前工具安装(openssl-1.1.0系列):
2.3.1 安装nasm,下载链接http://www.nasm.us/安装后,右击“我的电脑”-->属性-->高级-->环境变量-->系统变量-->path项添加:D:\Tools\NASM2.3.2 安装ActivePerl
2.3.2.1 安装ActivePerl2.3.2.1 安装dmake(必须在联网的情况下),点击“开始”-->"所有程序"-->"Visual Studio 2013"-->"Visual Studio Tools"-->"VS2013 x64 本机工具命令提示" :ppm install dmake
2.4 解压“openssl-1.1.0a.tar.gz”到当前文件夹,如得到“openssl-1.1.0a.tar”文件则再次解压“openssl-1.1.0a.tar”到当前文件夹,用以下命令切换到“openssl-1.1.0a”目录
3 Release编译
3.1 运行configure:
如果编译“openssl-1.1.0a”,执行:cd /d E:\Projects\compile\openssl-1.1.0aperl Configure VC-WIN64A --release --prefix=D:\comm\openssl\release_x64 --openssldir=D:\comm\ssl\release_x64perl Configure VC-WIN64A --release --prefix=D:\comm\openssl\release_x64 --openssldir=D:\comm\ssl\release_x64 zlib --with-zlib-include=D:\comm\zlib\release_x64\include --with-zlib-lib=D:\comm\zlib\release_x64\lib\zdll.libperl Configure VC-WIN64A --release --prefix=D:\comm\openssl\release_x64 --openssldir=D:\comm\ssl\release_x64 zlib-dynamic --with-zlib-include=D:\comm\zlib\release_x64\include --with-zlib-lib=D:\comm\zlib\release_x64\lib\zdll.lib注1:如果不需引入“zlib”库,则请用第1条perl命令;注2:如果引入“zlib”静态库,则请用第2条perl命令;此方式适用于“zlib”一个工程内只有“OpenSSL”库用到或通过“OpenSSL”库用到“zlib”库的功能;这种方式编译需要修改openssl-1.1.0a\configdata.pm和openssl-1.1.0a\makefile两个文件,搜索 “/MD” 字符串,替换成 “/MT”, 这将导致静态链接 C 运行,避免了在目标机器上安装 VC 再发行包等等操作。注3:如果引入“zlib”动态库,则请用第3条perl命令;此方式适用于所有情况;注4:约定:本文“OpenSSL”静态库库引入“zlib”静态库,“OpenSSL”动态库引入“zlib”动态库;
3.2 编译、测试、安装、清除上次的编译以便重新编译:nmake allnmake installnmake distclean
4 Debug编译
4.1 运行configure:
如果编译“openssl-1.1.0a”,执行:
cd /d E:\Projects\compile\openssl-1.1.0aperl Configure VC-WIN64A --debug --prefix=D:\comm\openssl\debug_x64 --openssldir=D:\comm\ssl\debug_x64perl Configure VC-WIN64A --debug --prefix=D:\comm\openssl\debug_x64 --openssldir=D:\comm\ssl\debug_x64 zlib --with-zlib-include=D:\comm\zlib\debug_x64\include --with-zlib-lib=D:\comm\zlib\debug_x64\lib\zdll.libperl Configure VC-WIN64A --debug --prefix=D:\comm\openssl\debug_x64 --openssldir=D:\comm\ssl\debug_x64 zlib-dynamic --with-zlib-include=D:\comm\zlib\debug_x64\include --with-zlib-lib=D:\comm\zlib\debug_x64\lib\zdll.lib
注1:如果不需引入“zlib”库,则请用第1条perl命令;注2:如果引入“zlib”静态库,则请用第2条perl命令;此方式适用于“zlib”一个工程内只有“OpenSSL”库用到或通过“OpenSSL”库用到“zlib”库的功能;这种方式编译需要修改openssl-1.1.0a\configdata.pm和openssl-1.1.0a\makefile两个文件,搜索 “/MDd” 字符串,替换成 “/MTd”, 这将导致静态链接 C 运行,避免了在目标机器上安装 VC 再发行包等等操作。注3:如果引入“zlib”动态库,则请用第3条perl命令;此方式适用于所有情况;注4:约定:本文“OpenSSL”静态库库引入“zlib”静态库,“OpenSSL”动态库引入“zlib”动态库;
4.2 编译、测试、安装、清除上次的编译以便重新编译:
nmake allnmake installnmake distclean
5 如果不想编译,直接下载OpenSSL安装包
Binary Distributions:http://www.openssl.org/related/binaries.html
OpenSSL for Windows:http://www.slproweb.com/products/Win32OpenSSL.html
6 参考文章
在 Windows下用 Visual Studio 编译 OpenSSL 1.1.0:http://www.cnblogs.com/chinalantian/p/5819105.html
0 0
- ActivePerl、dmake、nasm、nmake编译OpenSSL(1.1.0系列)
- ActivePerl、dmake、nasm、nmake编译OpenSSL(1.1.0系列)
- ActivePerl、nmake编译OpenSSL(1.0.x系列)
- 编译工具make、gmake、cmake、nmake和Dmake的区别
- nmake编译openssl
- openssl nasm 编译
- gmake和make、nmake、Dmake
- vs2010 vc nmake编译openssl-0.9.8e
- nmake与dmake对makefile中宏的不同处理
- NMAKE命令行编译
- luasql编译 - nmake使用方法
- nmake编译dll
- VS2010 nmake编译工程
- nmake && shapelib 编译
- nmake编译libtiff
- Openssl 1.1.0C VS2013编译
- VS2015编译Openssl-1.1.0f
- VS2005编译Openssl-1.1.0f
- 你需要了解深度学习和神经网络这项技术吗?
- i.MX6Q -- Linux系统下FlexCAN总线的使用记录
- android数据存储的五种方式
- a href=#与 a href=javascript:void(0) 的区别
- Android 资源匹配过程详解
- ActivePerl、dmake、nasm、nmake编译OpenSSL(1.1.0系列)
- 百度高德地图 坐标系转换
- 二叉树面试题--已知二叉树的两种遍历序列,求出另一种遍历序列
- easy-ui取得选中行数据项
- 基于珠海鼎芯科技imx6开发板 tslib1.4的移植
- C# 生成一个随机数
- 如何安装最新的 XFCE 桌面?
- 【NOIP2004】合唱队形
- Hibernate中JPA的简单使用,实现简单的对表的增删改查操作