OpenSSL windows下编译过程

源码下面包含文件INSTALL.W32,里边有详细的编译过程如下,共分X步骤

1、下载ActiveState Perl 地址如下,如果安装目录不在环境变量中,需要添加到环境变量中避免下一步dos状态下找不到perl命令。

You need Perl for Win32.  Unless you will build on Cygwin, you will need
 ActiveState Perl, available from http://www.activestate.com/ActivePerl.

 and one of the following C compilers:

  * Visual C++
  * Borland C
  * GNU C (Cygwin or MinGW)

 If you are compiling from a tarball or a CVS snapshot then the Win32 files
 may well be not up to date. This may mean that some "tweaking" is required to
 get it all to work. See the trouble shooting section later on for if (when?)
 it goes wrong.

 Visual C++
 ----------

 If you want to compile in the assembly language routines with Visual C++ then
 you will need an assembler. This is worth doing because it will result in
 faster code: for example it will typically result in a 2 times speedup in the
 RSA routines. Currently the following assemblers are supported:

  * Microsoft MASM (aka "ml")
  * Free Netwide Assembler NASM.

 MASM is distributed with most versions of VC++. For the versions where it is
 not included in VC++, it is also distributed with some Microsoft DDKs, for
 example the Windows NT 4.0 DDK and the Windows 98 DDK. If you do not have
 either of these DDKs then you can just download the binaries for the Windows
 98 DDK and extract and rename the two files XXXXXml.exe and XXXXXml.err, to
 ml.exe and ml.err and install somewhere on your PATH. Both DDKs can be
 downloaded from the Microsoft developers site www.msdn.com.

 NASM is freely available. Version 0.98 was used during testing: other versions
 may also work. It is available from many places, see for example:
 http://www.kernel.org/pub/software/devel/nasm/binaries/win32/
 The NASM binary nasmw.exe needs to be installed anywhere on your PATH.

2、进入到Openssl源码目录执行如下命令,在ms目录生成批处理信息 do_ms.bat用于执行编译

Firstly you should run Configure:

 > perl Configure VC-WIN32 --prefix=c:/some/openssl/dir

Where the prefix argument specifies where OpenSSL will be installed to.

 Next you need to build the Makefiles and optionally the assembly language
 files:

 - If you are using MASM then run:

   > ms\do_masm

 - If you are using NASM then run:

   > ms\do_nasm

3、生成X86版本的makefile编译文件ntdll.mak

 - If you don't want to use the assembly language files at all then run:

   > ms\do_ms

 If you get errors about things not having numbers assigned then check the
 troubleshooting section: you probably won't be able to compile it as it
 stands.

4、执行下面的命令进行编译生成lib,dll等信息

 Then from the VC++ environment at a prompt do:

 > nmake -f ms\ntdll.mak

 If all is well it should compile and you will have some DLLs and executables
 in out32dll. If you want to try the tests then do:
 
 > nmake -f ms\ntdll.mak test

5、将编译好的文件拷贝到--prefix=c:/some/openssl/dir目录中,生成bin,include,lib信息用于后续编程使用
To install OpenSSL to the specified location do:

> nmake -f ms\ntdll.mak install

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值