开篇说明
优秀成熟的开源项目,文档都是很完备的,不过大多数是英文的。为了准确和快速,以下参照OpenSSL官方说明文档,安装OpenSSL-1.1.0C.
官方安装说明文档
1. 主参照文档:INSTALL
安装前提:
To install OpenSSL, you will need:
- A make implementation
- Perl 5 with core modules (please read NOTES.PERL)
- The perl module Text::Template (please read NOTES.PERL)
- an ANSI C compiler
- a development environment in the form of development libraries and C
header files - a supported operating system
安装步骤:
on Unix:
$ ./config
$ make
$ make test
$ make installon OpenVMS:
$ @config
$ mms
$ mms test
$ mms installon 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. 次参照文档:NOTES.WIN
依赖软件:
In addition to the requirements and instructions listed in INSTALL,
this are required as well:You need Perl. We recommend ActiveState Perl, available from https://www.activestate.com/ActivePerl.
You also need the perl module Text::Template, available on CPAN. Please read NOTES.PERL for more information.You need a C compiler. OpenSSL has been tested to build with these:
Visual C++Netwide Assembler, a.k.a. NASM, available from http://www.nasm.us, is required if you intend to utilize assembler modules. Note that NASM is the only supported assembler. The Microsoft provided assembler is NOT supported.
默认安装目录:
The default installation directories are derived from environment variables.
- For VC-WIN32, the following defaults are use:
- PREFIX: %ProgramFiles(86)%\OpenSSL
- OPENSSLDIR: %CommonProgramFiles(86)%\SSL
- For VC-WIN64, the following defaults are use:
- PREFIX: %ProgramW6432%\OpenSSL
- OPENSSLDIR: %CommonProgramW6432%\SSL
安装步骤
1. 依赖软件的安装
VC++
执行VC\Bin\vcvars32.bat, 将VC加入到系统环境变量
ActivePerl 5
NASM
将NASM安装目录加入到系统变量PATH中
2. 配置OpenSSL
进入OpenSSL源代码主目录,执行:
perl Configure VC-WIN32
配置成功图例:
3. 编译构建OpenSSL
执行命令:
nmake
这一步执行的时间较长,实际是VC 的 cl.exe命令编译链接的过程。
执行结果:
编译前后目录变化:
4. 测试编译生成的库
上一步生成了重要的库文件:
执行命令测试库文件的正确性:
nmake test
执行结果:
5. 安装OpenSSL
执行命令:
nmake install
默认安装目录:
C:\Program Files\OpenSSL
执行结果: